Import Upstream version 1.0.21

This commit is contained in:
Guus Sliepen 2019-08-26 13:44:43 +02:00
parent d131e9a06f
commit 37abcfc1ea
38 changed files with 2387 additions and 11248 deletions

View file

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.11.5 from Makefile.am.
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,

View file

@ -41,6 +41,10 @@
#define ETH_P_IPV6 0x86DD
#endif
#ifndef ETH_P_8021Q
#define ETH_P_8021Q 0x8100
#endif
#ifndef HAVE_STRUCT_ETHER_HEADER
struct ether_header {
uint8_t ether_dhost[ETH_ALEN];

View file

@ -32,11 +32,13 @@ static int charhex2bin(char c) {
return toupper(c) - 'A' + 10;
}
void hex2bin(char *src, char *dst, int length) {
int i;
for(i = 0; i < length; i++)
bool hex2bin(char *src, char *dst, int length) {
for(int i = 0; i < length; i++) {
if(!isxdigit(src[i * 2]) || !isxdigit(src[i * 2 + 1]))
return false;
dst[i] = charhex2bin(src[i * 2]) * 16 + charhex2bin(src[i * 2 + 1]);
}
return true;
}
void bin2hex(char *src, char *dst, int length) {

View file

@ -21,7 +21,7 @@
#ifndef __TINC_UTILS_H__
#define __TINC_UTILS_H__
extern void hex2bin(char *src, char *dst, int length);
extern bool hex2bin(char *src, char *dst, int length);
extern void bin2hex(char *src, char *dst, int length);
#ifdef HAVE_MINGW