--- libelwix/src/net.c 2017/01/09 12:40:40 1.16.2.1 +++ libelwix/src/net.c 2018/03/15 14:49:56 1.17.10.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: net.c,v 1.16.2.1 2017/01/09 12:40:40 misho Exp $ +* $Id: net.c,v 1.17.10.1 2018/03/15 14:49:56 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2017 +Copyright 2004 - 2018 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -50,6 +50,18 @@ SUCH DAMAGE. static char hexlist[] = "0123456789abcdef"; #ifndef HAVE_LINK_ADDR + +/* States*/ +#define NAMING 0 +#define GOTONE 1 +#define GOTTWO 2 +#define RESET 3 +/* Inputs */ +#define DIGIT (4*0) +#define END (4*1) +#define DELIM (4*2) +#define LETTER (4*3) + void link_addr(const char *addr, struct sockaddr_dl *sdl) { @@ -551,7 +563,7 @@ e_getnet(const char *net) #endif n->addr.sin.sin_family = host->h_addrtype; memcpy(&n->addr.sin.sin_addr, host->h_addr, sizeof n->addr.sin.sin_addr); - if (wrk) + if (wrk && strtol(wrk, NULL, 10) != 32) n->mask.in.s_addr = E_CIDRMASK(strtol(wrk, NULL, 10)); else n->mask.in.s_addr = 0xFFFFFFFF;