diff options
Diffstat (limited to 'cpukit/libnetworking/libc')
23 files changed, 131 insertions, 139 deletions
diff --git a/cpukit/libnetworking/libc/addr2ascii.c b/cpukit/libnetworking/libc/addr2ascii.c index 01bbde6ec8..8edf802de0 100644 --- a/cpukit/libnetworking/libc/addr2ascii.c +++ b/cpukit/libnetworking/libc/addr2ascii.c @@ -62,11 +62,11 @@ * naming and the poor choice of arguments. */ char * -addr2ascii(af, addrp, len, buf) - int af; - const void *addrp; - int len; /* should be size_t XXX */ - char *buf; /* XXX should pass length of buffer */ +addr2ascii( + int af, + const void *addrp, + int len, /* should be size_t XXX */ + char *buf) /* XXX should pass length of buffer */ { static char staticbuf[64]; /* 64 for AF_LINK > 16 for AF_INET */ diff --git a/cpukit/libnetworking/libc/ascii2addr.c b/cpukit/libnetworking/libc/ascii2addr.c index 5dd8240a57..27978f4eb8 100644 --- a/cpukit/libnetworking/libc/ascii2addr.c +++ b/cpukit/libnetworking/libc/ascii2addr.c @@ -46,10 +46,10 @@ #include <arpa/inet.h> int -ascii2addr(af, ascii, result) - int af; - const char *ascii; - void *result; +ascii2addr( + int af, + const char *ascii, + void *result) { struct in_addr *ina; char strbuf[4*sizeof("123")]; /* long enough for V4 only */ diff --git a/cpukit/libnetworking/libc/base64.c b/cpukit/libnetworking/libc/base64.c index 27cfb3dc73..070cc52231 100644 --- a/cpukit/libnetworking/libc/base64.c +++ b/cpukit/libnetworking/libc/base64.c @@ -194,10 +194,10 @@ b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) { */ int -b64_pton(src, target, targsize) - char const *src; - u_char *target; - size_t targsize; +b64_pton( + char const *src, + u_char *target, + size_t targsize) { int tarindex, state, ch; char *pos; diff --git a/cpukit/libnetworking/libc/gethostbyht.c b/cpukit/libnetworking/libc/gethostbyht.c index c5c30f98b9..65979b7f8a 100644 --- a/cpukit/libnetworking/libc/gethostbyht.c +++ b/cpukit/libnetworking/libc/gethostbyht.c @@ -86,8 +86,7 @@ static char *cur; #endif void -_sethosthtent(f) - int f; +_sethosthtent(int f) { if (!hostf) hostf = fopen(_PATH_HOSTS, "r" ); @@ -97,7 +96,7 @@ _sethosthtent(f) } void -_endhosthtent() +_endhosthtent(void) { if (hostf && !stayopen) { (void) fclose(hostf); @@ -106,7 +105,7 @@ _endhosthtent() } struct hostent * -gethostent() +gethostent(void) { char *p; register char *cp, **q; @@ -171,9 +170,9 @@ gethostent() } struct hostent * -_gethostbyhtname(name, af) - const char *name; - int af; +_gethostbyhtname( + const char *name, + int af) { register struct hostent *p; register char **cp; @@ -194,9 +193,10 @@ found: } struct hostent * -_gethostbyhtaddr(addr, len, af) - const char *addr; - int len, af; +_gethostbyhtaddr( + const char *addr, + int len, + int af) { register struct hostent *p; diff --git a/cpukit/libnetworking/libc/gethostnamadr.c b/cpukit/libnetworking/libc/gethostnamadr.c index 7da9190cfd..d67890ada4 100644 --- a/cpukit/libnetworking/libc/gethostnamadr.c +++ b/cpukit/libnetworking/libc/gethostnamadr.c @@ -199,15 +199,14 @@ gethostbyaddr(const void *addr, socklen_t len, int type) } void -sethostent(stayopen) - int stayopen; +sethostent(int stayopen) { _sethosthtent(stayopen); _sethostdnsent(stayopen); } void -endhostent() +endhostent(void) { _endhosthtent(); _endhostdnsent(); diff --git a/cpukit/libnetworking/libc/getnetbyht.c b/cpukit/libnetworking/libc/getnetbyht.c index 713e186ccb..b44193045b 100644 --- a/cpukit/libnetworking/libc/getnetbyht.c +++ b/cpukit/libnetworking/libc/getnetbyht.c @@ -63,8 +63,7 @@ static char *net_aliases[MAXALIASES]; static int _net_stayopen; void -_setnethtent(f) - int f; +_setnethtent(int f) { if (netf == NULL) @@ -75,7 +74,7 @@ _setnethtent(f) } void -_endnethtent() +_endnethtent(void) { if (netf) { @@ -86,7 +85,7 @@ _endnethtent() } struct netent * -getnetent() +getnetent(void) { char *p; register char *cp, **q; @@ -134,8 +133,7 @@ again: } struct netent * -_getnetbyhtname(name) - register const char *name; +_getnetbyhtname(const char *name) { register struct netent *p; register char **cp; @@ -155,9 +153,9 @@ found: } struct netent * -_getnetbyhtaddr(net, type) - register unsigned long net; - register int type; +_getnetbyhtaddr( + unsigned long net, + int type) { register struct netent *p; diff --git a/cpukit/libnetworking/libc/getservbyport.c b/cpukit/libnetworking/libc/getservbyport.c index 884d600590..cd76c2de4d 100644 --- a/cpukit/libnetworking/libc/getservbyport.c +++ b/cpukit/libnetworking/libc/getservbyport.c @@ -61,9 +61,9 @@ int getservbyport_r( } struct servent * -getservbyport(port, proto) - int port; - const char *proto; +getservbyport( + int port, + const char *proto) { register struct servent *p; diff --git a/cpukit/libnetworking/libc/getservent.c b/cpukit/libnetworking/libc/getservent.c index 7133690d83..6ebe7e2761 100644 --- a/cpukit/libnetworking/libc/getservent.c +++ b/cpukit/libnetworking/libc/getservent.c @@ -189,8 +189,8 @@ _getservent_yp(line) #endif void -setservent(f) - int f; +setservent( + int f) { if (servf == NULL) servf = fopen(_PATH_SERVICES, "r" ); @@ -200,7 +200,7 @@ setservent(f) } void -endservent() +endservent(void) { if (servf) { fclose(servf); @@ -210,7 +210,7 @@ endservent() } struct servent * -getservent() +getservent(void) { char *p; register char *cp, **q; diff --git a/cpukit/libnetworking/libc/herror.c b/cpukit/libnetworking/libc/herror.c index 621da3ec1d..e7d6ba48cb 100644 --- a/cpukit/libnetworking/libc/herror.c +++ b/cpukit/libnetworking/libc/herror.c @@ -76,8 +76,7 @@ int h_errno; * print the error indicated by the h_errno value. */ void -herror(s) - const char *s; +herror(const char *s) { #if defined(HERROR_USE_WRITEV) struct iovec iov[4]; @@ -112,8 +111,7 @@ herror(s) } const char * -hstrerror(err) - int err; +hstrerror(int err) { if (err < 0) return ("Resolver internal error"); diff --git a/cpukit/libnetworking/libc/inet_addr.c b/cpukit/libnetworking/libc/inet_addr.c index cca2f040ec..1d86052c18 100644 --- a/cpukit/libnetworking/libc/inet_addr.c +++ b/cpukit/libnetworking/libc/inet_addr.c @@ -67,8 +67,8 @@ * The value returned is in network order. */ in_addr_t -inet_addr(cp) - const char *cp; +inet_addr( + const char *cp) { struct in_addr val; @@ -85,9 +85,9 @@ inet_addr(cp) * cannot distinguish between failure and a local broadcast address. */ int -inet_aton(cp, addr) - const char *cp; - struct in_addr *addr; +inet_aton( + const char *cp, + struct in_addr *addr) { in_addr_t val; register int base, n; diff --git a/cpukit/libnetworking/libc/inet_lnaof.c b/cpukit/libnetworking/libc/inet_lnaof.c index 94f3161f64..b97cf72439 100644 --- a/cpukit/libnetworking/libc/inet_lnaof.c +++ b/cpukit/libnetworking/libc/inet_lnaof.c @@ -47,8 +47,8 @@ * number formats. */ in_addr_t -inet_lnaof(in) - struct in_addr in; +inet_lnaof( + struct in_addr in) { register u_long i = ntohl(in.s_addr); diff --git a/cpukit/libnetworking/libc/inet_netof.c b/cpukit/libnetworking/libc/inet_netof.c index d7ed467fb5..e71f96f7f2 100644 --- a/cpukit/libnetworking/libc/inet_netof.c +++ b/cpukit/libnetworking/libc/inet_netof.c @@ -46,8 +46,8 @@ * address; handles class a/b/c network #'s. */ in_addr_t -inet_netof(in) - struct in_addr in; +inet_netof( + struct in_addr in) { register u_long i = ntohl(in.s_addr); diff --git a/cpukit/libnetworking/libc/inet_network.c b/cpukit/libnetworking/libc/inet_network.c index 8c20c1f4f7..8cd2761ce4 100644 --- a/cpukit/libnetworking/libc/inet_network.c +++ b/cpukit/libnetworking/libc/inet_network.c @@ -48,8 +48,8 @@ * network numbers. */ in_addr_t -inet_network(cp) - const char *cp; +inet_network( + const char *cp) { register u_long val, base, n, i; register char c; diff --git a/cpukit/libnetworking/libc/inet_ntoa.c b/cpukit/libnetworking/libc/inet_ntoa.c index d6a99a5cc9..cea3843776 100644 --- a/cpukit/libnetworking/libc/inet_ntoa.c +++ b/cpukit/libnetworking/libc/inet_ntoa.c @@ -49,8 +49,8 @@ * to base 256 d.d.d.d representation. */ char * -inet_ntoa(in) - struct in_addr in; +inet_ntoa( + struct in_addr in) { static char ret[18]; diff --git a/cpukit/libnetworking/libc/inet_ntop.c b/cpukit/libnetworking/libc/inet_ntop.c index 5f5055b194..2e28dbbcd0 100644 --- a/cpukit/libnetworking/libc/inet_ntop.c +++ b/cpukit/libnetworking/libc/inet_ntop.c @@ -47,11 +47,11 @@ static const char *inet_ntop6(const u_char *src, char *dst, socklen_t size); * Paul Vixie, 1996. */ const char * -inet_ntop(af, src, dst, size) - int af; - const void *src; - char *dst; - socklen_t size; +inet_ntop( + int af, + const void *src, + char *dst, + socklen_t size) { switch (af) { case AF_INET: @@ -77,10 +77,10 @@ inet_ntop(af, src, dst, size) * Paul Vixie, 1996. */ static const char * -inet_ntop4(src, dst, size) - const u_char *src; - char *dst; - socklen_t size; +inet_ntop4( + const u_char *src, + char *dst, + socklen_t size) { static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; @@ -100,10 +100,10 @@ inet_ntop4(src, dst, size) * Paul Vixie, 1996. */ static const char * -inet_ntop6(src, dst, size) - const u_char *src; - char *dst; - socklen_t size; +inet_ntop6( + const u_char *src, + char *dst, + socklen_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough diff --git a/cpukit/libnetworking/libc/inet_pton.c b/cpukit/libnetworking/libc/inet_pton.c index 77032ba6c2..963c071353 100644 --- a/cpukit/libnetworking/libc/inet_pton.c +++ b/cpukit/libnetworking/libc/inet_pton.c @@ -47,10 +47,10 @@ static int inet_pton6(const char *src, u_char *dst); * Paul Vixie, 1996. */ int -inet_pton(af, src, dst) - int af; - const char *src; - void *dst; +inet_pton( + int af, + const char *src, + void *dst) { switch (af) { case AF_INET: @@ -75,9 +75,9 @@ inet_pton(af, src, dst) * Paul Vixie, 1996. */ static int -inet_pton4(src, dst) - const char *src; - u_char *dst; +inet_pton4( + const char *src, + u_char *dst) { static const char digits[] = "0123456789"; int saw_digit, octets, ch; @@ -129,9 +129,9 @@ inet_pton4(src, dst) * Paul Vixie, 1996. */ static int -inet_pton6(src, dst) - const char *src; - u_char *dst; +inet_pton6( + const char *src, + u_char *dst) { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; diff --git a/cpukit/libnetworking/libc/linkaddr.c b/cpukit/libnetworking/libc/linkaddr.c index 5b76e641d4..1ec75bd376 100644 --- a/cpukit/libnetworking/libc/linkaddr.c +++ b/cpukit/libnetworking/libc/linkaddr.c @@ -54,9 +54,9 @@ #define LETTER (4*3) void -link_addr(addr, sdl) - const char *addr; - struct sockaddr_dl *sdl; +link_addr( + const char *addr, + struct sockaddr_dl *sdl) { char *cp = sdl->sdl_data; char *cplim = sdl->sdl_len + (char *)sdl; @@ -126,8 +126,8 @@ link_addr(addr, sdl) static char hexlist[] = "0123456789abcdef"; char * -link_ntoa(sdl) - const struct sockaddr_dl *sdl; +link_ntoa( + const struct sockaddr_dl *sdl) { static char obuf[64]; char *out = obuf; diff --git a/cpukit/libnetworking/libc/map_v4v6.c b/cpukit/libnetworking/libc/map_v4v6.c index 723b925d32..edf2a07905 100644 --- a/cpukit/libnetworking/libc/map_v4v6.c +++ b/cpukit/libnetworking/libc/map_v4v6.c @@ -96,10 +96,10 @@ _map_v4v6_address(const char *src, char *dst) } void -_map_v4v6_hostent(hp, bpp, lenp) - struct hostent *hp; - char **bpp; - int *lenp; +_map_v4v6_hostent( + struct hostent *hp, + char **bpp, + int *lenp) { char **ap; diff --git a/cpukit/libnetworking/libc/res_comp.c b/cpukit/libnetworking/libc/res_comp.c index 6b85e02004..7240e56081 100644 --- a/cpukit/libnetworking/libc/res_comp.c +++ b/cpukit/libnetworking/libc/res_comp.c @@ -148,8 +148,7 @@ dn_skipname(const u_char *ptr, const u_char *eom) { #define domainchar(c) ((c) > 0x20 && (c) < 0x7f) int -res_hnok(dn) - const char *dn; +res_hnok(const char *dn) { int ppch = '\0', pch = PERIOD, ch = *dn++; @@ -178,8 +177,7 @@ res_hnok(dn) * but must otherwise be as a host name. */ int -res_ownok(dn) - const char *dn; +res_ownok(const char *dn) { if (asterchar(dn[0])) { if (periodchar(dn[1])) @@ -195,8 +193,7 @@ res_ownok(dn) * label, but the rest of the name has to look like a host name. */ int -res_mailok(dn) - const char *dn; +res_mailok(const char *dn) { int ch, escaped = 0; @@ -225,8 +222,7 @@ res_mailok(dn) * recommendations. */ int -res_dnok(dn) - const char *dn; +res_dnok(const char *dn) { int ch; diff --git a/cpukit/libnetworking/libc/res_debug.c b/cpukit/libnetworking/libc/res_debug.c index a614e8437d..ce979baaf6 100644 --- a/cpukit/libnetworking/libc/res_debug.c +++ b/cpukit/libnetworking/libc/res_debug.c @@ -300,11 +300,12 @@ p_cdname(const u_char *cp, const u_char *msg, FILE *file) { length supplied). */ const u_char * -p_fqnname(cp, msg, msglen, name, namelen) - const u_char *cp, *msg; - int msglen; - char *name; - int namelen; +p_fqnname( + const u_char *cp, + const u_char *msg, + int msglen, + char *name, + int namelen) { int n, newlen; @@ -708,9 +709,9 @@ latlon2ul( /* converts a zone file representation in a string to an RDATA on-the-wire * representation. */ int -loc_aton(ascii, binary) - const char *ascii; - u_char *binary; +loc_aton( + const char *ascii, + u_char *binary) { const char *cp, *maxcp; u_char *bcp; diff --git a/cpukit/libnetworking/libc/res_init.c b/cpukit/libnetworking/libc/res_init.c index 6cc1fb58ef..564c230311 100644 --- a/cpukit/libnetworking/libc/res_init.c +++ b/cpukit/libnetworking/libc/res_init.c @@ -139,7 +139,7 @@ struct __res_state _res * Return 0 if completes successfully, -1 on error */ int -res_init() +res_init(void) { FILE *fp; char *cp, **pp; @@ -426,8 +426,9 @@ res_init() } static void -res_setoptions(options, source) - char *options, *source; +res_setoptions( + char *options, + char *source) { char *cp = options; int i; @@ -477,8 +478,8 @@ res_setoptions(options, source) #ifdef RESOLVSORT /* XXX - should really support CIDR which means explicit masks always. */ static u_int32_t -net_mask(in) /* XXX - should really use system's version of this */ - struct in_addr in; +net_mask( /* XXX - should really use system's version of this */ + struct in_addr in) { u_int32_t i = ntohl(in.s_addr); @@ -491,7 +492,7 @@ net_mask(in) /* XXX - should really use system's version of this */ #endif u_int -res_randomid() +res_randomid(void) { struct timeval now; diff --git a/cpukit/libnetworking/libc/res_mkquery.c b/cpukit/libnetworking/libc/res_mkquery.c index f97779c653..832e2df740 100644 --- a/cpukit/libnetworking/libc/res_mkquery.c +++ b/cpukit/libnetworking/libc/res_mkquery.c @@ -88,15 +88,15 @@ * Returns the size of the result or -1. */ int -res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) - int op; /* opcode of query */ - const char *dname; /* domain name */ - int class, type; /* class and type of query */ - const u_char *data; /* resource record data */ - int datalen; /* length of data */ - const u_char *newrr_in; /* new rr for modify or append */ - u_char *buf; /* buffer to put query */ - int buflen; /* size of buffer */ +res_mkquery( + int op, /* opcode of query */ + const char *dname, /* domain name */ + int class, int type, /* class and type of query */ + const u_char *data, /* resource record data */ + int datalen, /* length of data */ + const u_char *newrr_in, /* new rr for modify or append */ + u_char *buf, /* buffer to put query */ + int buflen) /* size of buffer */ { register HEADER *hp; register u_char *cp; diff --git a/cpukit/libnetworking/libc/res_query.c b/cpukit/libnetworking/libc/res_query.c index 8923248351..f53327511b 100644 --- a/cpukit/libnetworking/libc/res_query.c +++ b/cpukit/libnetworking/libc/res_query.c @@ -104,11 +104,11 @@ * Caller must parse answer and determine whether it answers the question. */ int -res_query(name, class, type, answer, anslen) - const char *name; /* domain name */ - int class, type; /* class and type of query */ - u_char *answer; /* buffer to put answer */ - int anslen; /* size of answer buffer */ +res_query( + const char *name, /* domain name */ + int class, int type, /* class and type of query */ + u_char *answer, /* buffer to put answer */ + int anslen) /* size of answer buffer */ { u_char buf[MAXPACKET]; HEADER *hp = (HEADER *) answer; @@ -180,11 +180,11 @@ res_query(name, class, type, answer, anslen) * is detected. Error code, if any, is left in h_errno. */ int -res_search(name, class, type, answer, anslen) - const char *name; /* domain name */ - int class, type; /* class and type of query */ - u_char *answer; /* buffer to put answer */ - int anslen; /* size of answer */ +res_search( + const char *name, /* domain name */ + int class, int type, /* class and type of query */ + u_char *answer, /* buffer to put answer */ + int anslen) /* size of answer */ { const char *cp, * const *domain; HEADER *hp = (HEADER *) answer; @@ -318,11 +318,11 @@ res_search(name, class, type, answer, anslen) * removing a trailing dot from name if domain is NULL. */ int -res_querydomain(name, domain, class, type, answer, anslen) - const char *name, *domain; - int class, type; /* class and type of query */ - u_char *answer; /* buffer to put answer */ - int anslen; /* size of answer */ +res_querydomain( + const char *name, const char *domain, + int class, int type, /* class and type of query */ + u_char *answer, /* buffer to put answer */ + int anslen) /* size of answer */ { char nbuf[MAXDNAME]; const char *longname = nbuf; @@ -366,8 +366,7 @@ res_querydomain(name, domain, class, type, answer, anslen) } const char * -hostalias(name) - const char *name; +hostalias(const char *name) { register char *cp1, *cp2; FILE *fp; |