diff options
Diffstat (limited to 'sbin/ipf/ipsend')
-rw-r--r-- | sbin/ipf/ipsend/44arp.c | 6 | ||||
-rw-r--r-- | sbin/ipf/ipsend/arp.c | 3 | ||||
-rw-r--r-- | sbin/ipf/ipsend/dlcommon.c | 232 | ||||
-rw-r--r-- | sbin/ipf/ipsend/ip.c | 39 | ||||
-rw-r--r-- | sbin/ipf/ipsend/ipresend.c | 5 | ||||
-rw-r--r-- | sbin/ipf/ipsend/ipsend.c | 17 | ||||
-rw-r--r-- | sbin/ipf/ipsend/ipsopt.c | 10 | ||||
-rw-r--r-- | sbin/ipf/ipsend/iptest.c | 5 | ||||
-rw-r--r-- | sbin/ipf/ipsend/iptests.c | 48 | ||||
-rw-r--r-- | sbin/ipf/ipsend/resend.c | 13 | ||||
-rw-r--r-- | sbin/ipf/ipsend/sbpf.c | 10 | ||||
-rw-r--r-- | sbin/ipf/ipsend/sdlpi.c | 8 | ||||
-rw-r--r-- | sbin/ipf/ipsend/snit.c | 8 | ||||
-rw-r--r-- | sbin/ipf/ipsend/sock.c | 21 | ||||
-rw-r--r-- | sbin/ipf/ipsend/sockraw.c | 3 |
15 files changed, 138 insertions, 290 deletions
diff --git a/sbin/ipf/ipsend/44arp.c b/sbin/ipf/ipsend/44arp.c index 80521ad15084..9f82ed6a741d 100644 --- a/sbin/ipf/ipsend/44arp.c +++ b/sbin/ipf/ipsend/44arp.c @@ -35,8 +35,7 @@ * its IP address in address * (4 bytes) */ -int resolve(host, address) - char *host, *address; +int resolve(char *host, char *address) { struct hostent *hp; u_long add; @@ -57,8 +56,7 @@ int resolve(host, address) } -int arp(addr, eaddr) - char *addr, *eaddr; +int arp(char *addr, char *eaddr) { int mib[6]; size_t needed; diff --git a/sbin/ipf/ipsend/arp.c b/sbin/ipf/ipsend/arp.c index 31b70d3e8987..e6bbedb9ec50 100644 --- a/sbin/ipf/ipsend/arp.c +++ b/sbin/ipf/ipsend/arp.c @@ -34,8 +34,7 @@ static const char rcsid[] = "@(#)$Id$"; * its IP address in address * (4 bytes) */ -int resolve(host, address) - char *host, *address; +int resolve(char *host, char *address) { struct hostent *hp; u_long add; diff --git a/sbin/ipf/ipsend/dlcommon.c b/sbin/ipf/ipsend/dlcommon.c index efb82df9ad32..86554660240d 100644 --- a/sbin/ipf/ipsend/dlcommon.c +++ b/sbin/ipf/ipsend/dlcommon.c @@ -38,8 +38,7 @@ typedef unsigned long ulong; void -dlinforeq(fd) - int fd; +dlinforeq(int fd) { dl_info_req_t info_req; struct strbuf ctl; @@ -58,9 +57,7 @@ dlinforeq(fd) } void -dlinfoack(fd, bufp) - int fd; - char *bufp; +dlinfoack(int fd, char *bufp) { union DL_primitives *dlp; struct strbuf ctl; @@ -87,9 +84,7 @@ dlinfoack(fd, bufp) } void -dlattachreq(fd, ppa) - int fd; - u_long ppa; +dlattachreq(int fd, u_long ppa) { dl_attach_req_t attach_req; struct strbuf ctl; @@ -109,10 +104,7 @@ dlattachreq(fd, ppa) } void -dlenabmultireq(fd, addr, length) - int fd; - char *addr; - int length; +dlenabmultireq(int fd, char *addr, int length) { long buf[MAXDLBUF]; union DL_primitives *dlp; @@ -138,10 +130,7 @@ dlenabmultireq(fd, addr, length) } void -dldisabmultireq(fd, addr, length) - int fd; - char *addr; - int length; +dldisabmultireq(int fd, char *addr, int length) { long buf[MAXDLBUF]; union DL_primitives *dlp; @@ -167,9 +156,7 @@ dldisabmultireq(fd, addr, length) } void -dlpromisconreq(fd, level) - int fd; - u_long level; +dlpromisconreq(int fd, u_long level) { dl_promiscon_req_t promiscon_req; struct strbuf ctl; @@ -190,9 +177,7 @@ dlpromisconreq(fd, level) } void -dlpromiscoff(fd, level) - int fd; - u_long level; +dlpromiscoff(int fd, u_long level) { dl_promiscoff_req_t promiscoff_req; struct strbuf ctl; @@ -212,9 +197,7 @@ dlpromiscoff(fd, level) } void -dlphysaddrreq(fd, addrtype) - int fd; - u_long addrtype; +dlphysaddrreq(int fd, u_long addrtype) { dl_phys_addr_req_t phys_addr_req; struct strbuf ctl; @@ -234,10 +217,7 @@ dlphysaddrreq(fd, addrtype) } void -dlsetphysaddrreq(fd, addr, length) - int fd; - char *addr; - int length; +dlsetphysaddrreq(int fd, char *addr, int length) { long buf[MAXDLBUF]; union DL_primitives *dlp; @@ -263,8 +243,7 @@ dlsetphysaddrreq(fd, addr, length) } void -dldetachreq(fd) - int fd; +dldetachreq(int fd) { dl_detach_req_t detach_req; struct strbuf ctl; @@ -283,13 +262,8 @@ dldetachreq(fd) } void -dlbindreq(fd, sap, max_conind, service_mode, conn_mgmt, xidtest) - int fd; - u_long sap; - u_long max_conind; - u_long service_mode; - u_long conn_mgmt; - u_long xidtest; +dlbindreq(int fd, u_long sap, u_long max_conind, u_long service_mode, + u_long conn_mgmt, u_long xidtest) { dl_bind_req_t bind_req; struct strbuf ctl; @@ -313,13 +287,8 @@ dlbindreq(fd, sap, max_conind, service_mode, conn_mgmt, xidtest) } void -dlunitdatareq(fd, addrp, addrlen, minpri, maxpri, datap, datalen) - int fd; - u_char *addrp; - int addrlen; - u_long minpri, maxpri; - u_char *datap; - int datalen; +dlunitdatareq(int fd, u_char *addrp, int addrlen, u_long minpri, + u_long maxpri, u_char *datap, int datalen) { long buf[MAXDLBUF]; union DL_primitives *dlp; @@ -348,8 +317,7 @@ dlunitdatareq(fd, addrp, addrlen, minpri, maxpri, datap, datalen) } void -dlunbindreq(fd) - int fd; +dlunbindreq(int fd) { dl_unbind_req_t unbind_req; struct strbuf ctl; @@ -368,9 +336,7 @@ dlunbindreq(fd) } void -dlokack(fd, bufp) - int fd; - char *bufp; +dlokack(int fd, char *bufp) { union DL_primitives *dlp; struct strbuf ctl; @@ -397,9 +363,7 @@ dlokack(fd, bufp) } void -dlerrorack(fd, bufp) - int fd; - char *bufp; +dlerrorack(int fd, char *bufp) { union DL_primitives *dlp; struct strbuf ctl; @@ -426,9 +390,7 @@ dlerrorack(fd, bufp) } void -dlbindack(fd, bufp) - int fd; - char *bufp; +dlbindack(int fd, char *bufp) { union DL_primitives *dlp; struct strbuf ctl; @@ -452,9 +414,7 @@ dlbindack(fd, bufp) } void -dlphysaddrack(fd, bufp) - int fd; - char *bufp; +dlphysaddrack(int fd, char *bufp) { union DL_primitives *dlp; struct strbuf ctl; @@ -478,16 +438,13 @@ dlphysaddrack(fd, bufp) } void -sigalrm() +sigalrm(void) { (void) err("sigalrm: TIMEOUT"); } -strgetmsg(fd, ctlp, datap, flagsp, caller) - int fd; - struct strbuf *ctlp, *datap; - int *flagsp; - char *caller; +strgetmsg(int fd, struct strbuf *ctlp, struct strbuf *datap, int *flagsp, + char *caller) { int rc; static char errmsg[80]; @@ -535,9 +492,7 @@ strgetmsg(fd, ctlp, datap, flagsp, caller) err("getmsg: control portion length < sizeof (long): %d", ctlp->len); } -expecting(prim, dlp) - int prim; - union DL_primitives *dlp; +expecting(int prim, union DL_primitives *dlp) { if (dlp->dl_primitive != (u_long)prim) { printdlprim(dlp); @@ -550,8 +505,7 @@ expecting(prim, dlp) /* * Print any DLPI msg in human readable format. */ -printdlprim(dlp) - union DL_primitives *dlp; +printdlprim(union DL_primitives *dlp) { switch (dlp->dl_primitive) { case DL_INFO_REQ: @@ -654,14 +608,12 @@ printdlprim(dlp) } /* ARGSUSED */ -printdlinforeq(dlp) - union DL_primitives *dlp; +printdlinforeq(union DL_primitives *dlp) { (void) printf("DL_INFO_REQ\n"); } -printdlinfoack(dlp) - union DL_primitives *dlp; +printdlinfoack(union DL_primitives *dlp) { u_char addr[MAXDLADDR]; u_char brdcst[MAXDLADDR]; @@ -697,22 +649,20 @@ printdlinfoack(dlp) (void) printf("brdcst_addr %s\n", brdcst); } -printdlattachreq(dlp) - union DL_primitives *dlp; +printdlattachreq(union DL_primitives *dlp) { (void) printf("DL_ATTACH_REQ: ppa %d\n", dlp->attach_req.dl_ppa); } -printdlokack(dlp) +printdlokack(union DL_primitives* dlp) union DL_primitives *dlp; { (void) printf("DL_OK_ACK: correct_primitive %s\n", dlprim(dlp->ok_ack.dl_correct_primitive)); } -printdlerrorack(dlp) - union DL_primitives *dlp; +printdlerrorack(union DL_primitives *dlp) { (void) printf("DL_ERROR_ACK: error_primitive %s errno %s unix_errno %d: %s\n", dlprim(dlp->error_ack.dl_error_primitive), @@ -721,8 +671,7 @@ printdlerrorack(dlp) strerror(dlp->error_ack.dl_unix_errno)); } -printdlenabmultireq(dlp) - union DL_primitives *dlp; +printdlenabmultireq(union DL_primitives *dlp) { u_char addr[MAXDLADDR]; @@ -735,8 +684,7 @@ printdlenabmultireq(dlp) (void) printf("addr %s\n", addr); } -printdldisabmultireq(dlp) - union DL_primitives *dlp; +printdldisabmultireq(union DL_primitives *dlp) { u_char addr[MAXDLADDR]; @@ -749,29 +697,25 @@ printdldisabmultireq(dlp) (void) printf("addr %s\n", addr); } -printdlpromisconreq(dlp) - union DL_primitives *dlp; +printdlpromisconreq(union DL_primitives *dlp) { (void) printf("DL_PROMISCON_REQ: level %s\n", dlpromisclevel(dlp->promiscon_req.dl_level)); } -printdlpromiscoffreq(dlp) - union DL_primitives *dlp; +printdlpromiscoffreq(union DL_primitives *dlp) { (void) printf("DL_PROMISCOFF_REQ: level %s\n", dlpromisclevel(dlp->promiscoff_req.dl_level)); } -printdlphysaddrreq(dlp) - union DL_primitives *dlp; +printdlphysaddrreq(union DL_primitives *dlp) { (void) printf("DL_PHYS_ADDR_REQ: addr_type 0x%x\n", dlp->physaddr_req.dl_addr_type); } -printdlphysaddrack(dlp) - union DL_primitives *dlp; +printdlphysaddrack(union DL_primitives *dlp) { u_char addr[MAXDLADDR]; @@ -784,8 +728,7 @@ printdlphysaddrack(dlp) (void) printf("addr %s\n", addr); } -printdlsetphysaddrreq(dlp) - union DL_primitives *dlp; +printdlsetphysaddrreq(union DL_primitives *dlp) { u_char addr[MAXDLADDR]; @@ -799,14 +742,12 @@ printdlsetphysaddrreq(dlp) } /* ARGSUSED */ -printdldetachreq(dlp) - union DL_primitives *dlp; +printdldetachreq(union DL_primitives *dlp) { (void) printf("DL_DETACH_REQ\n"); } -printdlbindreq(dlp) - union DL_primitives *dlp; +printdlbindreq(union DL_primitives *dlp) { (void) printf("DL_BIND_REQ: sap %d max_conind %d\n", dlp->bind_req.dl_sap, @@ -817,8 +758,7 @@ printdlbindreq(dlp) dlp->bind_req.dl_xidtest_flg); } -printdlbindack(dlp) - union DL_primitives *dlp; +printdlbindack(union DL_primitives *dlp) { u_char addr[MAXDLADDR]; @@ -836,14 +776,12 @@ printdlbindack(dlp) } /* ARGSUSED */ -printdlunbindreq(dlp) - union DL_primitives *dlp; +printdlunbindreq(union DL_primitives *dlp) { (void) printf("DL_UNBIND_REQ\n"); } -printdlsubsbindreq(dlp) - union DL_primitives *dlp; +printdlsubsbindreq(union DL_primitives *dlp) { u_char sap[MAXDLADDR]; @@ -856,8 +794,7 @@ printdlsubsbindreq(dlp) (void) printf("sap %s\n", sap); } -printdlsubsbindack(dlp) - union DL_primitives *dlp; +printdlsubsbindack(union DL_primitives *dlp) { u_char sap[MAXDLADDR]; @@ -870,8 +807,7 @@ printdlsubsbindack(dlp) (void) printf("sap %s\n", sap); } -printdlsubsunbindreq(dlp) - union DL_primitives *dlp; +printdlsubsunbindreq(union DL_primitives *dlp) { u_char sap[MAXDLADDR]; @@ -884,8 +820,7 @@ printdlsubsunbindreq(dlp) (void) printf("sap %s\n", sap); } -printdlunitdatareq(dlp) - union DL_primitives *dlp; +printdlunitdatareq(union DL_primitives *dlp) { u_char addr[MAXDLADDR]; @@ -901,8 +836,7 @@ printdlunitdatareq(dlp) (void) printf("addr %s\n", addr); } -printdlunitdataind(dlp) - union DL_primitives *dlp; +printdlunitdataind(union DL_primitives *dlp) { u_char dest[MAXDLADDR]; u_char src[MAXDLADDR]; @@ -924,8 +858,7 @@ printdlunitdataind(dlp) (void) printf("src %s\n", src); } -printdluderrorind(dlp) - union DL_primitives *dlp; +printdluderrorind(union DL_primitives *dlp) { u_char addr[MAXDLADDR]; @@ -941,8 +874,7 @@ printdluderrorind(dlp) (void) printf("addr %s\n", addr); } -printdltestreq(dlp) - union DL_primitives *dlp; +printdltestreq(union DL_primitives *dlp) { u_char addr[MAXDLADDR]; @@ -956,8 +888,7 @@ printdltestreq(dlp) (void) printf("dest_addr %s\n", addr); } -printdltestind(dlp) - union DL_primitives *dlp; +printdltestind(union DL_primitives *dlp) { u_char dest[MAXDLADDR]; u_char src[MAXDLADDR]; @@ -978,8 +909,7 @@ printdltestind(dlp) (void) printf("src_addr %s\n", src); } -printdltestres(dlp) - union DL_primitives *dlp; +printdltestres(union DL_primitives *dlp) { u_char dest[MAXDLADDR]; @@ -993,8 +923,7 @@ printdltestres(dlp) (void) printf("dest_addr %s\n", dest); } -printdltestcon(dlp) - union DL_primitives *dlp; +printdltestcon(union DL_primitives *dlp) { u_char dest[MAXDLADDR]; u_char src[MAXDLADDR]; @@ -1015,8 +944,7 @@ printdltestcon(dlp) (void) printf("src_addr %s\n", src); } -printdlxidreq(dlp) - union DL_primitives *dlp; +printdlxidreq(union DL_primitives *dlp) { u_char dest[MAXDLADDR]; @@ -1030,8 +958,7 @@ printdlxidreq(dlp) (void) printf("dest_addr %s\n", dest); } -printdlxidind(dlp) - union DL_primitives *dlp; +printdlxidind(dlpunion DL_primitives *) { u_char dest[MAXDLADDR]; u_char src[MAXDLADDR]; @@ -1052,8 +979,7 @@ printdlxidind(dlp) (void) printf("src_addr %s\n", src); } -printdlxidres(dlp) - union DL_primitives *dlp; +printdlxidres(union DL_primitives *dlp) { u_char dest[MAXDLADDR]; @@ -1067,8 +993,7 @@ printdlxidres(dlp) (void) printf("dest_addr %s\n", dest); } -printdlxidcon(dlp) - union DL_primitives *dlp; +printdlxidcon(union DL_primitives *dlp) { u_char dest[MAXDLADDR]; u_char src[MAXDLADDR]; @@ -1089,8 +1014,7 @@ printdlxidcon(dlp) (void) printf("src_addr %s\n", src); } -printdludqosreq(dlp) - union DL_primitives *dlp; +printdludqosreq(union DL_primitives *dlp) { (void) printf("DL_UDQOS_REQ: qos_length %d qos_offset %d\n", dlp->udqos_req.dl_qos_length, @@ -1100,10 +1024,7 @@ printdludqosreq(dlp) /* * Return string. */ -addrtostring(addr, length, s) - u_char *addr; - u_long length; - u_char *s; +addrtostring(u_char *addr, u_long length, u_char *s) { int i; @@ -1118,9 +1039,7 @@ addrtostring(addr, length, s) /* * Return length */ -stringtoaddr(sp, addr) - char *sp; - char *addr; +stringtoaddr(char *sp, char *addr) { int n = 0; char *p; @@ -1142,8 +1061,7 @@ stringtoaddr(sp, addr) static char -hexnibble(c) - char c; +hexnibble(char c) { static char hextab[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', @@ -1154,8 +1072,7 @@ hexnibble(c) } char* -dlprim(prim) - u_long prim; +dlprim(u_long prim) { static char primbuf[80]; @@ -1195,8 +1112,7 @@ dlprim(prim) char* -dlstate(state) - u_long state; +dlstate(u_long state) { static char statebuf[80]; @@ -1229,8 +1145,7 @@ dlstate(state) } char* -dlerrno(errno) - u_long errno; +dlerrno(u_long errno) { static char errnobuf[80]; @@ -1271,8 +1186,7 @@ dlerrno(errno) } char* -dlpromisclevel(level) - u_long level; +dlpromisclevel(u_long level) { static char levelbuf[80]; @@ -1287,8 +1201,7 @@ dlpromisclevel(level) } char* -dlservicemode(servicemode) - u_long servicemode; +dlservicemode(u_long servicemode) { static char servicemodebuf[80]; @@ -1304,8 +1217,7 @@ dlservicemode(servicemode) } char* -dlstyle(style) - long style; +dlstyle(long style) { static char stylebuf[80]; @@ -1319,8 +1231,7 @@ dlstyle(style) } char* -dlmactype(media) - u_long media; +dlmactype(u_long media) { static char mediabuf[80]; @@ -1340,28 +1251,21 @@ dlmactype(media) } /*VARARGS1*/ -err(fmt, a1, a2, a3, a4) - char *fmt; - char *a1, *a2, *a3, *a4; +err(char *fmt, char *a1, char *a2, char *a3, char *a4) { (void) fprintf(stderr, fmt, a1, a2, a3, a4); (void) fprintf(stderr, "\n"); (void) exit(1); } -syserr(s) +syserr(char *s) char *s; { (void) perror(s); exit(1); } -strioctl(fd, cmd, timout, len, dp) - int fd; - int cmd; - int timout; - int len; - char *dp; +strioctl(int fd, int cmd, int timout, int len, char *dp) { struct strioctl sioc; int rc; diff --git a/sbin/ipf/ipsend/ip.c b/sbin/ipf/ipsend/ip.c index c1bb73f0b169..8a474704e3ab 100644 --- a/sbin/ipf/ipsend/ip.c +++ b/sbin/ipf/ipsend/ip.c @@ -31,9 +31,8 @@ static const char rcsid[] = "@(#)$Id$"; static char *ipbuf = NULL, *ethbuf = NULL; -u_short chksum(buf,len) - u_short *buf; - int len; +u_short +chksum(u_short *buf, int len) { u_long sum = 0; int nwords = len >> 1; @@ -46,10 +45,8 @@ u_short chksum(buf,len) } -int send_ether(nfd, buf, len, gwip) - int nfd, len; - char *buf; - struct in_addr gwip; +int +send_ether(int nfd, char *buf, int len, struct in_addr gwip) { static struct in_addr last_gw; static char last_arp[6] = { 0, 0, 0, 0, 0, 0}; @@ -81,11 +78,8 @@ int send_ether(nfd, buf, len, gwip) /* */ -int send_ip(nfd, mtu, ip, gwip, frag) - int nfd, mtu; - ip_t *ip; - struct in_addr gwip; - int frag; +int +send_ip(int nfd, int mtu, ip_t *ip, struct in_addr gwip, int frag) { static struct in_addr last_gw, local_ip; static char local_arp[6] = { 0, 0, 0, 0, 0, 0}; @@ -242,10 +236,8 @@ int send_ip(nfd, mtu, ip, gwip, frag) /* * send a tcp packet. */ -int send_tcp(nfd, mtu, ip, gwip) - int nfd, mtu; - ip_t *ip; - struct in_addr gwip; +int +send_tcp(int nfd, int mtu, ip_t *ip, struct in_addr gwip) { static tcp_seq iss = 2; tcphdr_t *t, *t2; @@ -295,10 +287,8 @@ int send_tcp(nfd, mtu, ip, gwip) /* * send a udp packet. */ -int send_udp(nfd, mtu, ip, gwip) - int nfd, mtu; - ip_t *ip; - struct in_addr gwip; +int +send_udp(int nfd, int mtu, ip_t *ip, struct in_addr gwip) { struct tcpiphdr *ti; int thlen; @@ -327,10 +317,8 @@ int send_udp(nfd, mtu, ip, gwip) /* * send an icmp packet. */ -int send_icmp(nfd, mtu, ip, gwip) - int nfd, mtu; - ip_t *ip; - struct in_addr gwip; +int +send_icmp(int nfd, int mtu, ip_t *ip, in_addr gwip) { struct icmp *ic; @@ -343,7 +331,8 @@ int send_icmp(nfd, mtu, ip, gwip) } -int send_packet(nfd, mtu, ip, gwip) +int +send_packet(int nfd, int mtu, ip_t *ip, struct in_addr gwip) int nfd, mtu; ip_t *ip; struct in_addr gwip; diff --git a/sbin/ipf/ipsend/ipresend.c b/sbin/ipf/ipsend/ipresend.c index d9a5f92cbe2c..2efb2eb4eeed 100644 --- a/sbin/ipf/ipsend/ipresend.c +++ b/sbin/ipf/ipsend/ipresend.c @@ -64,9 +64,8 @@ static void usage(prog) } -int main(argc, argv) - int argc; - char **argv; +int +main(int argc, char **argv) { struct in_addr gwip; struct ipread *ipr = NULL; diff --git a/sbin/ipf/ipsend/ipsend.c b/sbin/ipf/ipsend/ipsend.c index d77081bd8b71..b8111806397f 100644 --- a/sbin/ipf/ipsend/ipsend.c +++ b/sbin/ipf/ipsend/ipsend.c @@ -71,9 +71,8 @@ static void usage(prog) } -static void do_icmp(ip, args) - ip_t *ip; - char *args; +static +void do_icmp(ip_t *ip, char *args) { struct icmp *ic; char *s; @@ -122,11 +121,8 @@ static void do_icmp(ip, args) } -int send_packets(dev, mtu, ip, gwip) - char *dev; - int mtu; - ip_t *ip; - struct in_addr gwip; +int +send_packets(char *dev, int mtu, ip_t *ip, struct in_addr gwip) { int wfd; @@ -168,9 +164,8 @@ udpcksum(ip_t *ip, struct udphdr *udp, int len) udp->uh_sum = 0xffff; } -int main(argc, argv) - int argc; - char **argv; +int +main(int argc, char **argv) { FILE *langfile = NULL; struct in_addr gwip; diff --git a/sbin/ipf/ipsend/ipsopt.c b/sbin/ipf/ipsend/ipsopt.c index ce6616525ca1..e5585d906d7f 100644 --- a/sbin/ipf/ipsend/ipsopt.c +++ b/sbin/ipf/ipsend/ipsopt.c @@ -72,11 +72,8 @@ u_short ipseclevel(slevel) } -int addipopt(op, io, len, class) - char *op; - struct ipopt_names *io; - int len; - char *class; +int +addipopt(char *op, struct ipopt_names *io, int len, char *class) { struct in_addr ipadr; int olen = len, srr = 0; @@ -143,7 +140,8 @@ int addipopt(op, io, len, class) } -u_32_t buildopts(cp, op, len) +u_32_t +buildopts(char *cp, char *op, int len) char *cp, *op; int len; { diff --git a/sbin/ipf/ipsend/iptest.c b/sbin/ipf/ipsend/iptest.c index df2efb96a32a..e6c57c3cdbbd 100644 --- a/sbin/ipf/ipsend/iptest.c +++ b/sbin/ipf/ipsend/iptest.c @@ -63,9 +63,8 @@ static void usage(prog) } -int main(argc, argv) - int argc; - char **argv; +int +main(int argc, char **argv) { struct tcpiphdr *ti; struct in_addr gwip; diff --git a/sbin/ipf/ipsend/iptests.c b/sbin/ipf/ipsend/iptests.c index a4e1a99b2885..cbda02893162 100644 --- a/sbin/ipf/ipsend/iptests.c +++ b/sbin/ipf/ipsend/iptests.c @@ -95,12 +95,8 @@ typedef int boolean_t; #endif -void ip_test1(dev, mtu, ip, gwip, ptest) - char *dev; - int mtu; - ip_t *ip; - struct in_addr gwip; - int ptest; +void +ip_test1(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) { #ifdef USE_NANOSLEEP struct timespec ts; @@ -542,12 +538,8 @@ void ip_test2(dev, mtu, ip, gwip, ptest) /* * test 3 (ICMP) */ -void ip_test3(dev, mtu, ip, gwip, ptest) - char *dev; - int mtu; - ip_t *ip; - struct in_addr gwip; - int ptest; +void +ip_test3(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) { static int ict1[10] = { 8, 9, 10, 13, 14, 15, 16, 17, 18, 0 }; static int ict2[8] = { 3, 9, 10, 13, 14, 17, 18, 0 }; @@ -743,12 +735,8 @@ void ip_test3(dev, mtu, ip, gwip, ptest) /* Perform test 4 (UDP) */ -void ip_test4(dev, mtu, ip, gwip, ptest) - char *dev; - int mtu; - ip_t *ip; - struct in_addr gwip; - int ptest; +void +ip_test4(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) { #ifdef USE_NANOSLEEP struct timespec ts; @@ -908,12 +896,8 @@ void ip_test4(dev, mtu, ip, gwip, ptest) /* Perform test 5 (TCP) */ -void ip_test5(dev, mtu, ip, gwip, ptest) - char *dev; - int mtu; - ip_t *ip; - struct in_addr gwip; - int ptest; +void +ip_test5(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) { #ifdef USE_NANOSLEEP struct timespec ts; @@ -1256,12 +1240,8 @@ skip_five_and_six: /* Perform test 6 (exhaust mbuf test) */ -void ip_test6(dev, mtu, ip, gwip, ptest) - char *dev; - int mtu; - ip_t *ip; - struct in_addr gwip; - int ptest; +void +ip_test6(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) { #ifdef USE_NANOSLEEP struct timespec ts; @@ -1338,12 +1318,8 @@ void ip_test6(dev, mtu, ip, gwip, ptest) static u_long tbuf[64]; -void ip_test7(dev, mtu, ip, gwip, ptest) - char *dev; - int mtu; - ip_t *ip; - struct in_addr gwip; - int ptest; +void +ip_test7(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) { ip_t *pip; #ifdef USE_NANOSLEEP diff --git a/sbin/ipf/ipsend/resend.c b/sbin/ipf/ipsend/resend.c index 5d01bb78e5e5..537eb0a262b7 100644 --- a/sbin/ipf/ipsend/resend.c +++ b/sbin/ipf/ipsend/resend.c @@ -33,8 +33,8 @@ extern int opts; void dumppacket(ip_t *); -void dumppacket(ip) - ip_t *ip; +void +dumppacket(ip_t *ip) { tcphdr_t *t; int i, j; @@ -63,12 +63,9 @@ void dumppacket(ip) } -int ip_resend(dev, mtu, r, gwip, datain) - char *dev; - int mtu; - struct in_addr gwip; - struct ipread *r; - char *datain; +int +ip_resend(char *dev, int mtu, struct ipread *r, struct in_addr gwip, + char *datain) { ether_header_t *eh; char dhost[6]; diff --git a/sbin/ipf/ipsend/sbpf.c b/sbin/ipf/ipsend/sbpf.c index 27f239185d37..c1b8cc546961 100644 --- a/sbin/ipf/ipsend/sbpf.c +++ b/sbin/ipf/ipsend/sbpf.c @@ -52,9 +52,8 @@ static u_char *buf = NULL; static int bufsize = 0, timeout = 1; -int initdevice(device, tout) - char *device; - int tout; +int +initdevice(char *device, int tout) { struct bpf_version bv; struct timeval to; @@ -136,9 +135,8 @@ int initdevice(device, tout) /* * output an IP packet onto a fd opened for /dev/bpf */ -int sendip(fd, pkt, len) - int fd, len; - char *pkt; +int +sendip(int fd, char *pkt, int len) { if (write(fd, pkt, len) == -1) { diff --git a/sbin/ipf/ipsend/sdlpi.c b/sbin/ipf/ipsend/sdlpi.c index cd540337b2fa..10ef87ed509d 100644 --- a/sbin/ipf/ipsend/sdlpi.c +++ b/sbin/ipf/ipsend/sdlpi.c @@ -52,9 +52,8 @@ static const char rcsid[] = "@(#)$Id$"; * Be careful to only include those defined in the flags option for the * interface are included in the header size. */ -int initdevice(device, tout) - char *device; - int tout; +int +initdevice(char *device, int tout) { char devname[16], *s, buf[256]; int i, fd; @@ -127,7 +126,8 @@ int initdevice(device, tout) /* * output an IP packet onto a fd opened for /dev/nit */ -int sendip(fd, pkt, len) +int +sendip(int fd, char *pkt, int len) int fd, len; char *pkt; { diff --git a/sbin/ipf/ipsend/snit.c b/sbin/ipf/ipsend/snit.c index 0d75b4e616f5..ae7491fcf54d 100644 --- a/sbin/ipf/ipsend/snit.c +++ b/sbin/ipf/ipsend/snit.c @@ -57,9 +57,8 @@ static const char rcsid[] = "@(#)$Id$"; static int timeout; -int initdevice(device, tout) - char *device; - int tout; +int +initdevice(char *device, int tout) { struct strioctl si; struct timeval to; @@ -114,7 +113,8 @@ int initdevice(device, tout) /* * output an IP packet onto a fd opened for /dev/nit */ -int sendip(fd, pkt, len) +int +sendip(int fd, char *pkt, int len) int fd, len; char *pkt; { diff --git a/sbin/ipf/ipsend/sock.c b/sbin/ipf/ipsend/sock.c index 51418d64d1fe..4228b8f6b2d2 100644 --- a/sbin/ipf/ipsend/sock.c +++ b/sbin/ipf/ipsend/sock.c @@ -99,10 +99,8 @@ struct proc *proc; static struct kinfo_proc *getproc(void); -int kmemcpy(buf, pos, n) - char *buf; - void *pos; - int n; +int +kmemcpy(char *buf, void *pos, int n) { static int kfd = -1; off_t offset = (u_long)pos; @@ -130,7 +128,8 @@ struct nlist names[4] = { { NULL } }; -static struct kinfo_proc *getproc() +static struct +kinfo_proc *getproc(void) { static struct kinfo_proc kp; pid_t pid = getpid(); @@ -152,9 +151,8 @@ static struct kinfo_proc *getproc() } -struct tcpcb *find_tcp(tfd, ti) - int tfd; - struct tcpiphdr *ti; +struct tcpcb * +find_tcp(int tfd, struct tcpiphdr *ti) { struct tcpcb *t; struct inpcb *i; @@ -247,11 +245,8 @@ finderror: return NULL; } -int do_socket(dev, mtu, ti, gwip) - char *dev; - int mtu; - struct tcpiphdr *ti; - struct in_addr gwip; +int +do_socket(char *dev, int mtu, struct tcpiphdr *ti, struct in_addr gwip) { struct sockaddr_in rsin, lsin; struct tcpcb *t, tcb; diff --git a/sbin/ipf/ipsend/sockraw.c b/sbin/ipf/ipsend/sockraw.c index c9232273ee86..1fd04a91002b 100644 --- a/sbin/ipf/ipsend/sockraw.c +++ b/sbin/ipf/ipsend/sockraw.c @@ -34,7 +34,8 @@ static char sirix[] = "@(#)sirix.c 1.0 10/9/97 (C)1997 Marc Boucher"; #endif -int initdevice(char *device, int tout) +int +initdevice(char *device, int tout) { struct sockaddr s; struct ifreq ifr; |