[Netadm-devel] gwc/gwclib Makefile,1.2,1.3 confio.c,1.6,1.7 confproc.c,1.20,1.21 conftab.c,1.9,1.10
Status: Beta
Brought to you by:
linuxpark
From: linuxpark <lin...@us...> - 2006-04-06 15:12:23
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10489 Modified Files: Makefile confio.c confproc.c conftab.c confutil.c linklist.c slog.c sysipc.c sysnio.c syssnmp.c systime.c sysutil.c Log Message: MOD: modify mail address. and add object about confilter Index: syssnmp.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/syssnmp.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** syssnmp.c 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- syssnmp.c 6 Apr 2006 15:12:05 -0000 1.2 *************** *** 2,6 **** Title : snmp.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc snmp lib --- 2,6 ---- Title : snmp.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc snmp lib Index: slog.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/slog.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** slog.c 28 Feb 2006 23:07:49 -0000 1.2 --- slog.c 6 Apr 2006 15:12:05 -0000 1.3 *************** *** 2,6 **** Title : slog.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc syslog wrapper fn --- 2,6 ---- Title : slog.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc syslog wrapper fn Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** confproc.c 14 Mar 2006 17:17:05 -0000 1.20 --- confproc.c 6 Apr 2006 15:12:05 -0000 1.21 *************** *** 2,6 **** Title : confproc.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : main proc source --- 2,6 ---- Title : confproc.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : main proc source Index: sysnio.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/sysnio.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sysnio.c 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- sysnio.c 6 Apr 2006 15:12:05 -0000 1.2 *************** *** 2,6 **** Title : sysnio.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc network lib --- 2,6 ---- Title : sysnio.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc network lib Index: conftab.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/conftab.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** conftab.c 13 Mar 2006 14:15:05 -0000 1.9 --- conftab.c 6 Apr 2006 15:12:05 -0000 1.10 *************** *** 2,6 **** Title : conftab.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : proc mapping object --- 2,6 ---- Title : conftab.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : proc mapping object Index: Makefile =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 28 Feb 2006 23:41:50 -0000 1.2 --- Makefile 6 Apr 2006 15:12:05 -0000 1.3 *************** *** 2,6 **** # # Title : Makefile ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for gwclib --- 2,6 ---- # # Title : Makefile ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for gwclib *************** *** 12,15 **** --- 12,16 ---- rely=`uname -r | cut -f 2 -d .` SYSOBJS = conftab.o \ + linklist.o \ confutil.o \ confproc.o \ *************** *** 21,25 **** syssnmp.o \ systime.o \ ! linklist.o all: libsys.a --- 22,28 ---- syssnmp.o \ systime.o \ ! naufilter.o \ ! regexp.o ! all: libsys.a Index: confutil.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confutil.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** confutil.c 13 Mar 2006 14:15:05 -0000 1.11 --- confutil.c 6 Apr 2006 15:12:05 -0000 1.12 *************** *** 2,6 **** Title : confutil.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : utils for confio --- 2,6 ---- Title : confutil.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : utils for confio *************** *** 532,536 **** } #endif ! char * loadfile(char *fn) --- 532,536 ---- } #endif ! #if 0 char * loadfile(char *fn) *************** *** 566,569 **** --- 566,570 ---- return cp; } + #endif void Index: systime.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/systime.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** systime.c 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- systime.c 6 Apr 2006 15:12:05 -0000 1.2 *************** *** 2,6 **** Title : systime.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc timing concern lib --- 2,6 ---- Title : systime.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc timing concern lib Index: linklist.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/linklist.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** linklist.c 6 Mar 2006 14:16:05 -0000 1.2 --- linklist.c 6 Apr 2006 15:12:05 -0000 1.3 *************** *** 2,6 **** Title : linklist.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 2,6 ---- Title : linklist.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : Index: confio.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confio.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** confio.c 8 Mar 2006 15:29:55 -0000 1.6 --- confio.c 6 Apr 2006 15:12:05 -0000 1.7 *************** *** 2,6 **** Title : confio.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : config io --- 2,6 ---- Title : confio.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : config io Index: sysutil.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/sysutil.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sysutil.c 6 Mar 2006 14:16:05 -0000 1.4 --- sysutil.c 6 Apr 2006 15:12:05 -0000 1.5 *************** *** 2,6 **** Title : sysutil.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc util lib --- 2,6 ---- Title : sysutil.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc util lib *************** *** 9,14 **** #ident "@(#) $Header$" - #include <stdlib.h> #include <stdio.h> #include <ctype.h> #define _GNU_SOURCE --- 9,14 ---- #ident "@(#) $Header$" #include <stdio.h> + #include <stdlib.h> #include <ctype.h> #define _GNU_SOURCE *************** *** 820,821 **** --- 820,888 ---- } + + char * loadfile(char *fn, int *len) + { + struct stat st; + char fname[256]; + char *cp; + int ret; + int fd; + + sprintf(fname, "%s", fn); + if ((fd = open(fname, O_RDONLY)) == -1) { + return NULL; + } + + if (fstat(fd, &st) == -1) { + close(fd); + return NULL; + } + + if (st.st_size <= 0) + return NULL; + + if ((cp = (char *) malloc(st.st_size + 1)) == NULL) { + close(fd); + return NULL; + } + + ret = read(fd, cp, st.st_size); + cp[st.st_size] = '\0'; + + close(fd); + + if (ret == -1) + return NULL; + else { + *len = ret; + return cp; + } + } + + char *subString(char *buf, int start, int l) { + char *p = buf; + + if ((start + l) > strlen (p)) { + return NULL; + } + + *(p + start + l ) = '\0'; + return (p + start); + } + + int strindexof (char *p, const char *s) { + char *pos; + int sl; + + if (!(sl = strlen (p))) + return -1; + + if ((signed)strlen (s) > sl ) + return -1; + + pos = strstr (p, s); + if (!pos) + return -1; + + return (int) (pos -p); + } Index: sysipc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/sysipc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sysipc.c 7 Mar 2006 17:04:51 -0000 1.3 --- sysipc.c 6 Apr 2006 15:12:05 -0000 1.4 *************** *** 2,6 **** Title : sysipc.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc ipc fn --- 2,6 ---- Title : sysipc.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc ipc fn |