| plan 9 kernel history: overview | file list | diff list |
1998/0306/ip/netlog.c (diff list | history)
| 1997/1104/sys/src/9/ip/netlog.c:7,13 – 1998/0306/sys/src/9/ip/netlog.c:7,14 (short | long | prev | next) | ||
| 1997/0327 | #include "../ip/ip.h" int logmask; /* mask of things to debug */ | |
| 1998/0306 | uchar iponly[IPaddrlen]; /* ip address to print debugging for */ int iponlyset; | |
| 1997/0327 | enum { Nlog = 4*1024, | |
| 1997/1104/sys/src/9/ip/netlog.c:62,72 – 1998/0306/sys/src/9/ip/netlog.c:63,70 | ||
| 1997/0327 | nexterror(); } if(alog.opens == 0){ | |
| 1997/1104 |
| |
| 1998/0306 | if(alog.buf == nil) | |
| 1997/0327 | alog.buf = malloc(Nlog); | |
| 1997/1104 |
| |
| 1997/0327 | alog.rptr = alog.buf; alog.end = alog.buf + Nlog; } | |
| 1997/1104/sys/src/9/ip/netlog.c:175,181 – 1998/0306/sys/src/9/ip/netlog.c:173,183 | ||
| 1997/0327 | else if(strcmp("clear", fields[0]) == 0) set = 0; else if(strcmp("only", fields[0]) == 0){ | |
| 1998/0306 | parseip(iponly, fields[1]); if(ipcmp(iponly, IPnoaddr) == 0) iponlyset = 0; else iponlyset = 1; | |
| 1997/0327 | return nil; } else return Ebadnetctl; | |
| 1997/1104/sys/src/9/ip/netlog.c:206,217 – 1998/0306/sys/src/9/ip/netlog.c:208,221 | ||
| 1997/0327 | int i, n; va_list arg; | |
| 1998/0306 | if(!(logmask & mask)) | |
| 1997/0327 | return; va_start(arg, fmt); n = doprint(buf, buf+sizeof(buf), fmt, arg) - buf; va_end(arg); | |
| 1998/0306 | print("%s", buf); | |
| 1997/0327 | if(alog.opens == 0) return; | |