[Dhcp-agent-commits] dhcp-agent Makefile.in,1.28,1.29 README,1.7,1.8 TODO,1.34,1.35 config.h.in,1.13
Status: Alpha
Brought to you by:
actmodern
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv29892 Modified Files: Makefile.in README TODO config.h.in dhcp-arp.c dhcp-packet-build.c dhcp-stringbuffer.c dhcp-stringbuffer.h Removed Files: acconfig.h Log Message: no need for auxiliary files with new autoconf Index: Makefile.in =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/Makefile.in,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Makefile.in 11 Sep 2002 23:52:28 -0000 1.28 --- Makefile.in 11 Sep 2002 23:55:16 -0000 1.29 *************** *** 203,208 **** DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in THANKS \ ! TODO acinclude.m4 aclocal.m4 config.h.in configure configure.in \ ! depcomp install-sh missing mkinstalldirs SOURCES = $(dhcpclient_SOURCES) $(dhcpsniff_SOURCES) --- 203,208 ---- DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in THANKS \ ! TODO acconfig.h acinclude.m4 aclocal.m4 config.h.in configure \ ! configure.in depcomp install-sh missing mkinstalldirs SOURCES = $(dhcpclient_SOURCES) $(dhcpsniff_SOURCES) *************** *** 239,243 **** cd $(top_builddir) && $(SHELL) ./config.status config.h ! $(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/config.h.in --- 239,243 ---- cd $(top_builddir) && $(SHELL) ./config.status config.h ! $(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/config.h.in Index: README =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/README,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** README 24 Jun 2002 14:32:24 -0000 1.7 --- README 11 Sep 2002 23:55:16 -0000 1.8 *************** *** 84,88 **** options will be added later. ! dhcpclient is still a pit finnicky about which interface it picks. Use the -i option to force it to choose an interface. Or down the ethernet interface you wish to use and it will --- 84,88 ---- options will be added later. ! dhcpclient is still a bit finnicky about which interface it picks. Use the -i option to force it to choose an interface. Or down the ethernet interface you wish to use and it will Index: TODO =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** TODO 3 Jul 2002 00:51:39 -0000 1.34 --- TODO 11 Sep 2002 23:55:16 -0000 1.35 *************** *** 68,78 **** --- 68,82 ---- -- other minor optimizations which would be nice are noted in FIXMEs all over the code. + -- the rawnet routines should be a shared library due to too many dependencies. the sniffer for example, only needs the packet parsing routines. + -- get stringbuffer used in places where strings are being manipulated heavily. + -- fix stringbuffer trimwhitespace to use last_occurance routine, and add first occurance for finding initial whitespace too. + -- we may need to change the dhcp_build_* routines to use the dhcp-convert driver to generate the network data. it's not an *************** *** 83,87 **** --- 87,93 ---- the applicable dhcp-convert and then build the option wirh create_dhcp_option(data, len, tag) + -- document output from dhcpsniff -- especially how brief mode is layed out. + -- dhcpclient startup needs a more clever way of detecting interfaces: *************** *** 89,92 **** -- accept a list from globconf -- apply only to a specific interface. - - more importantly though we need --- 95,96 ---- Index: config.h.in =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/config.h.in,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** config.h.in 23 Jun 2002 03:29:12 -0000 1.13 --- config.h.in 11 Sep 2002 23:55:16 -0000 1.14 *************** *** 1,76 **** ! /* config.h.in. Generated automatically from configure.in by autoheader. */ ! /* whether or not we generated ! * our own pri macros. */ ! ! /* have bpf IMMEDIATE ioctl */ ! #undef HAVE_BPF_IMMEDIATE ! /* have __progname var */ ! #undef HAVE_PROGNAME ! /* have PRI* marcos */ ! #undef HAVE_PRIMACROS_H /* have struct bpf_timeval */ #undef HAVE_BPF_TIMEVAL ! /* have sig_atomic_t */ ! #undef HAVE_SIG_ATOMIC_T ! ! /* kill(pid, 0) can be used to detect a process we can signal */ ! #undef KILL_SIGNAL_DETECT ! ! /* default client work directory */ ! #undef CLIENT_WORK_DIR ! ! /* Define if you have the `calloc' function. */ #undef HAVE_CALLOC ! /* Define if you have the `daemon' function. */ #undef HAVE_DAEMON ! /* Define if you have the <getopt.h> header file. */ #undef HAVE_GETOPT_H ! /* Define if you have the `getprogname' function. */ #undef HAVE_GETPROGNAME ! /* Define if you have the `getrusage' function. */ #undef HAVE_GETRUSAGE ! /* Define if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H ! /* Define if you have the `rename' function. */ #undef HAVE_RENAME ! /* Define if you have the <signal.h> header file. */ #undef HAVE_SIGNAL_H ! /* Define if you have the <stdarg.h> header file. */ #undef HAVE_STDARG_H ! /* Define if you have the `strdup' function. */ #undef HAVE_STRDUP ! /* Define if you have the `sysconf' function. */ #undef HAVE_SYSCONF ! /* Define if you have the <sys/utsname.h> header file. */ #undef HAVE_SYS_UTSNAME_H ! /* Define if you have the `uname' function. */ #undef HAVE_UNAME ! /* Define if you have the <varargs.h> header file. */ #undef HAVE_VARARGS_H /* Name of package */ #undef PACKAGE /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE ! /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS --- 1,113 ---- ! /* config.h.in. Generated from configure.in by autoheader. */ ! /* default client work directory */ ! #undef CLIENT_WORK_DIR ! /* have BPF_IMMEDIATE */ ! #undef HAVE_BPF_IMMEDIATE /* have struct bpf_timeval */ #undef HAVE_BPF_TIMEVAL ! /* Define to 1 if you have the `calloc' function. */ #undef HAVE_CALLOC ! /* Define to 1 if you have the `daemon' function. */ #undef HAVE_DAEMON ! /* Define to 1 if you have the <getopt.h> header file. */ #undef HAVE_GETOPT_H ! /* Define to 1 if you have the `getprogname' function. */ #undef HAVE_GETPROGNAME ! /* Define to 1 if you have the `getrusage' function. */ #undef HAVE_GETRUSAGE ! /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H ! /* Define to 1 if you have the <memory.h> header file. */ ! #undef HAVE_MEMORY_H ! ! /* generated our own primacros */ ! #undef HAVE_PRIMACROS_H ! ! /* have __progname var */ ! #undef HAVE_PROGNAME ! ! /* Define to 1 if you have the `rename' function. */ #undef HAVE_RENAME ! /* Define to 1 if you have the <signal.h> header file. */ #undef HAVE_SIGNAL_H ! /* have sigatomic_t */ ! #undef HAVE_SIG_ATOMIC_T ! ! /* Define to 1 if you have the <stdarg.h> header file. */ #undef HAVE_STDARG_H ! /* Define to 1 if you have the <stdint.h> header file. */ ! #undef HAVE_STDINT_H ! ! /* Define to 1 if you have the <stdlib.h> header file. */ ! #undef HAVE_STDLIB_H ! ! /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP ! /* Define to 1 if you have the <strings.h> header file. */ ! #undef HAVE_STRINGS_H ! ! /* Define to 1 if you have the <string.h> header file. */ ! #undef HAVE_STRING_H ! ! /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF ! /* Define to 1 if you have the <sys/stat.h> header file. */ ! #undef HAVE_SYS_STAT_H ! ! /* Define to 1 if you have the <sys/types.h> header file. */ ! #undef HAVE_SYS_TYPES_H ! ! /* Define to 1 if you have the <sys/utsname.h> header file. */ #undef HAVE_SYS_UTSNAME_H ! /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME ! /* Define to 1 if you have the <unistd.h> header file. */ ! #undef HAVE_UNISTD_H ! ! /* Define to 1 if you have the <varargs.h> header file. */ #undef HAVE_VARARGS_H + /* kill(pid, 0) can be used to detect a process we can signal */ + #undef KILL_SIGNAL_DETECT + /* Name of package */ #undef PACKAGE + /* Define to the address where bug reports for this package should be sent. */ + #undef PACKAGE_BUGREPORT + + /* Define to the full name of this package. */ + #undef PACKAGE_NAME + + /* Define to the full name and version of this package. */ + #undef PACKAGE_STRING + + /* Define to the one symbol short name of this package. */ + #undef PACKAGE_TARNAME + + /* Define to the version of this package. */ + #undef PACKAGE_VERSION + /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE ! /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS Index: dhcp-arp.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-arp.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dhcp-arp.c 17 Jun 2002 13:23:07 -0000 1.10 --- dhcp-arp.c 11 Sep 2002 23:55:16 -0000 1.11 *************** *** 178,180 **** return 0; } - --- 178,179 ---- Index: dhcp-packet-build.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-packet-build.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dhcp-packet-build.c 22 Jun 2002 01:47:57 -0000 1.6 --- dhcp-packet-build.c 11 Sep 2002 23:55:16 -0000 1.7 *************** *** 135,142 **** * * * * * * * * * * * */ ! static void build_eth(rawnet_t *net, ! eth_addr_t source_hw_addr, ! eth_addr_t dest_hw_addr, ! uint16_t type) { eth_set_dst_address(net->ether_p, dest_hw_addr); --- 135,142 ---- * * * * * * * * * * * */ ! static void build_eth_proc(rawnet_t *net, ! eth_addr_t source_hw_addr, ! eth_addr_t dest_hw_addr, ! uint16_t type) { eth_set_dst_address(net->ether_p, dest_hw_addr); *************** *** 151,155 **** { ! build_eth(net, source_hw_addr, eth_broadcast, type); return; } --- 151,161 ---- { ! build_eth_proc(net, source_hw_addr, eth_broadcast, type); ! return; ! } ! ! static void build_eth(rawnet_t *net, eth_addr_t source_hw_addr, eth_addr_t dest_hw_addr, uint16_t type) ! { ! build_eth_proc(net, source_hw_addr, eth_broadcast, type); return; } Index: dhcp-stringbuffer.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-stringbuffer.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dhcp-stringbuffer.c 3 Jul 2002 00:51:39 -0000 1.8 --- dhcp-stringbuffer.c 11 Sep 2002 23:55:16 -0000 1.9 *************** *** 21,24 **** --- 21,32 ---- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * + * Sringbuffer object: + * + * (*) allows printfing into a string, + * (*) fast string manipulation by keeping track of string length. + * (*) alignment of string against columns. + * + * Internally stringbuffer does not count the terminating null as the length. + * Therefore the raw string routines will always assume +1 when given length. */ *************** *** 42,49 **** static char *extend_string(char *str, int cur_len, int ex_len) { - int len = strlen(str); ! str = realloc(str, (sizeof(char) * (len + ex_len + 1))); ! str[len + ex_len] = 0; /* make sure it's null terminated. */ return str; --- 50,56 ---- static char *extend_string(char *str, int cur_len, int ex_len) { ! str = realloc(str, (cur_len * sizeof(char)) * (ex_len * sizeof(char)) + (1 * sizeof(char))); ! str[cur_len] = 0; /* make sure it's null terminated. */ return str; *************** *** 132,144 **** void stringbuffer_append_c(stringbuffer *sb, char c) { ! if(sb->capacity <= (1 + sb->len)) { ! sb->buf = extend_string(sb->buf, sb->len, 1); ! sb->len++; ! sb->capacity = sb->len; ! } else ! sb->len++; ! sb->buf[sb->len - 1] = c; ! sb->buf[sb->len] = 0; } --- 139,150 ---- void stringbuffer_append_c(stringbuffer *sb, char c) { ! if(sb->capacity <= (sb->len)) { ! sb->buf = extend_string(sb->buf, sb->len, STRINGBUFFER_CHUNKSIZE); ! sb->capacity += STRINGBUFFER_CHUNKSIZE; ! } ! sb->buf[sb->len] = c; ! sb->len++; ! sb->buf[sb->len] = 0; } *************** *** 146,163 **** void stringbuffer_append(stringbuffer *sb, const char *s) { ! int len = strlen(s); ! if(sb->capacity <= (len + sb->len)) { ! sb->buf = extend_string(sb->buf, sb->len, len); ! sb->len += len; ! sb->capacity = sb->len; ! } else ! sb->len += len; - strcat(sb->buf, s); - sb->buf[sb->len] = 0; } ! /* remove whitespace */ stringbuffer *stringbuffer_trim_whitespace(stringbuffer *sb) { --- 152,188 ---- void stringbuffer_append(stringbuffer *sb, const char *s) { ! int len = strlen(s); ! int i, j; ! /* increase capacity. */ ! if(sb->capacity <= (len + sb->len)) { ! ! /* if we're bigger than the chunksize then allocate len. */ ! if(len > STRINGBUFFER_CHUNKSIZE) { ! ! sb->buf = extend_string(sb->buf, sb->len, len); ! sb->capacity += len; ! ! } else { ! ! /* otherwise allocate chunksize. */ ! sb->buf = extend_string(sb->buf, sb->len, STRINGBUFFER_CHUNKSIZE); ! sb->capacity += STRINGBUFFER_CHUNKSIZE; ! } ! ! /* copy new string into place: keep in mind we know all ! * lengths so strcat() would be less effecient. */ ! ! memcpy(&sb->buf[sb->len], s, len); ! ! sb->len += len; ! sb->buf[sb->len] = 0; ! ! return; ! } } ! /* remove whitespace (including tabs) */ stringbuffer *stringbuffer_trim_whitespace(stringbuffer *sb) { *************** *** 166,175 **** char *newbuf; int len; if(sb->len == 0) /* empty string. */ return sb; ! for(begin = &sb->buf[0]; ! *begin != '\0' && (*begin == ' ' || *begin == '\t'); begin++); --- 191,203 ---- char *newbuf; int len; + int i; if(sb->len == 0) /* empty string. */ return sb; ! /* find beginning of string after tabs and whitespaces. */ ! begin = &sb->buf[0]; ! for(i = 0; ! i < sb->len && (*begin == ' ' || *begin == '\t'); begin++); Index: dhcp-stringbuffer.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-stringbuffer.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-stringbuffer.h 22 Jun 2002 18:11:25 -0000 1.5 --- dhcp-stringbuffer.h 11 Sep 2002 23:55:16 -0000 1.6 *************** *** 26,29 **** --- 26,31 ---- #define DHCP_STRINGBUFFER_H + #define STRINGBUFFER_CHUNKSIZE 16 + /* string buffer object. */ typedef struct { --- acconfig.h DELETED --- |