From 093c7b438681f6b847567ae7d829ae365391f96a Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Mon, 4 Jun 2012 00:34:28 +0200 Subject: [PATCH] cleaned depreacted __P() and __V() macros, removed the legacy varargs.h header --- src/netif/ppp/auth.c | 70 +++++++++---------- src/netif/ppp/ccp.c | 54 +++++++-------- src/netif/ppp/chap-new.c | 4 +- src/netif/ppp/chap_ms.c | 22 +++--- src/netif/ppp/chap_ms.h | 10 +-- src/netif/ppp/demand.c | 2 +- src/netif/ppp/eap.c | 18 ++--- src/netif/ppp/eap.h | 4 +- src/netif/ppp/ecp.c | 24 +++---- src/netif/ppp/fsm.c | 16 ++--- src/netif/ppp/fsm.h | 44 ++++++------ src/netif/ppp/ipcp.c | 68 +++++++++---------- src/netif/ppp/ipcp.h | 2 +- src/netif/ppp/lcp.c | 64 +++++++++--------- src/netif/ppp/lcp.h | 10 +-- src/netif/ppp/multilink.c | 12 ++-- src/netif/ppp/options.c | 66 +++++++++--------- src/netif/ppp/ppp_impl.h | 137 +++++++++++++++++--------------------- src/netif/ppp/upap.c | 30 ++++----- src/netif/ppp/upap.h | 4 +- src/netif/ppp/utils.c | 32 ++++----- 21 files changed, 338 insertions(+), 355 deletions(-) diff --git a/src/netif/ppp/auth.c b/src/netif/ppp/auth.c index f8ba2668..a51007f2 100644 --- a/src/netif/ppp/auth.c +++ b/src/netif/ppp/auth.c @@ -177,39 +177,39 @@ static int num_np_up; static bool default_auth; /* Hook to enable a plugin to control the idle time limit */ -int (*idle_time_hook) __P((struct ppp_idle *)) = NULL; +int (*idle_time_hook) (struct ppp_idle *) = NULL; /* Hook for a plugin to say whether we can possibly authenticate any peer */ -int (*pap_check_hook) __P((void)) = NULL; +int (*pap_check_hook) (void) = NULL; /* Hook for a plugin to check the PAP user and password */ -int (*pap_auth_hook) __P((char *user, char *passwd, char **msgp, +int (*pap_auth_hook) (char *user, char *passwd, char **msgp, struct wordlist **paddrs, - struct wordlist **popts)) = NULL; + struct wordlist **popts) = NULL; /* Hook for a plugin to know about the PAP user logout */ -void (*pap_logout_hook) __P((void)) = NULL; +void (*pap_logout_hook) (void) = NULL; /* Hook for a plugin to get the PAP password for authenticating us */ -int (*pap_passwd_hook) __P((char *user, char *passwd)) = NULL; +int (*pap_passwd_hook) (char *user, char *passwd) = NULL; /* Hook for a plugin to say if we can possibly authenticate a peer using CHAP */ -int (*chap_check_hook) __P((void)) = NULL; +int (*chap_check_hook) (void) = NULL; /* Hook for a plugin to get the CHAP password for authenticating us */ -int (*chap_passwd_hook) __P((char *user, char *passwd)) = NULL; +int (*chap_passwd_hook) (char *user, char *passwd) = NULL; /* Hook for a plugin to say whether it is OK if the peer refuses to authenticate. */ -int (*null_auth_hook) __P((struct wordlist **paddrs, - struct wordlist **popts)) = NULL; +int (*null_auth_hook) (struct wordlist **paddrs, + struct wordlist **popts) = NULL; -int (*allowed_address_hook) __P((u_int32_t addr)) = NULL; +int (*allowed_address_hook) (u_int32_t addr) = NULL; #endif /* UNUSED */ #ifdef HAVE_MULTILINK /* Hook for plugin to hear when an interface joins a multilink bundle */ -void (*multilink_join_hook) __P((void)) = NULL; +void (*multilink_join_hook) (void) = NULL; #endif #if PPP_NOTIFY @@ -253,37 +253,37 @@ char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ #if 0 /* UNUSED */ static char *uafname; /* name of most recent +ua file */ -extern char *crypt __P((const char *, const char *)); +extern char *crypt (const char *, const char *); #endif /* UNUSED */ /* Prototypes for procedures local to this file. */ -static void network_phase __P((int)); -static void check_idle __P((void *)); -static void connect_time_expired __P((void *)); +static void network_phase (int); +static void check_idle (void *); +static void connect_time_expired (void *); #if 0 /* UNUSED */ -static int null_login __P((int)); -/* static int get_pap_passwd __P((char *)); */ -static int have_pap_secret __P((int *)); -static int have_chap_secret __P((char *, char *, int, int *)); -static int have_srp_secret __P((char *client, char *server, int need_ip, - int *lacks_ipp)); -static int ip_addr_check __P((u_int32_t, struct permitted_ip *)); -static int scan_authfile __P((FILE *, char *, char *, char *, +static int null_login (int); +/* static int get_pap_passwd (char *); */ +static int have_pap_secret (int *); +static int have_chap_secret (char *, char *, int, int *); +static int have_srp_secret (char *client, char *server, int need_ip, + int *lacks_ipp); +static int ip_addr_check (u_int32_t, struct permitted_ip *); +static int scan_authfile (FILE *, char *, char *, char *, struct wordlist **, struct wordlist **, - char *, int)); -static void free_wordlist __P((struct wordlist *)); -static void set_allowed_addrs __P((int, struct wordlist *, struct wordlist *)); -static int some_ip_ok __P((struct wordlist *)); -static int setupapfile __P((char **)); -static int privgroup __P((char **)); -static int set_noauth_addr __P((char **)); -static int set_permitted_number __P((char **)); -static void check_access __P((FILE *, char *)); -static int wordlist_count __P((struct wordlist *)); + char *, int); +static void free_wordlist (struct wordlist *); +static void set_allowed_addrs (int, struct wordlist *, struct wordlist *); +static int some_ip_ok (struct wordlist *); +static int setupapfile (char **); +static int privgroup (char **); +static int set_noauth_addr (char **); +static int set_permitted_number (char **); +static void check_access (FILE *, char *); +static int wordlist_count (struct wordlist *); #endif /* UNUSED */ #ifdef MAXOCTETS -static void check_maxoctets __P((void *)); +static void check_maxoctets (void *); #endif #if PPP_OPTIONS diff --git a/src/netif/ppp/ccp.c b/src/netif/ppp/ccp.c index 293c39e8..d2e04569 100644 --- a/src/netif/ppp/ccp.c +++ b/src/netif/ppp/ccp.c @@ -57,8 +57,8 @@ /* * Command-line options. */ -static int setbsdcomp __P((char **)); -static int setdeflate __P((char **)); +static int setbsdcomp (char **); +static int setdeflate (char **); static char bsd_value[8]; static char deflate_value[8]; @@ -166,19 +166,19 @@ static option_t ccp_option_list[] = { /* * Protocol entry points from main code. */ -static void ccp_init __P((int unit)); -static void ccp_open __P((int unit)); -static void ccp_close __P((int unit, char *)); -static void ccp_lowerup __P((int unit)); -static void ccp_lowerdown __P((int)); -static void ccp_input __P((int unit, u_char *pkt, int len)); -static void ccp_protrej __P((int unit)); +static void ccp_init (int unit); +static void ccp_open (int unit); +static void ccp_close (int unit, char *); +static void ccp_lowerup (int unit); +static void ccp_lowerdown (int); +static void ccp_input (int unit, u_char *pkt, int len); +static void ccp_protrej (int unit); #if PRINTPKT_SUPPORT -static int ccp_printpkt __P((u_char *pkt, int len, - void (*printer) __P((void *, char *, ...)), - void *arg)); +static int ccp_printpkt (u_char *pkt, int len, + void (*printer) (void *, char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ -static void ccp_datainput __P((int unit, u_char *pkt, int len)); +static void ccp_datainput (int unit, u_char *pkt, int len); struct protent ccp_protent = { PPP_CCP, @@ -217,18 +217,18 @@ ccp_options ccp_hisoptions[NUM_PPP]; /* what we agreed to do */ /* * Callbacks for fsm code. */ -static void ccp_resetci __P((fsm *)); -static int ccp_cilen __P((fsm *)); -static void ccp_addci __P((fsm *, u_char *, int *)); -static int ccp_ackci __P((fsm *, u_char *, int)); -static int ccp_nakci __P((fsm *, u_char *, int, int)); -static int ccp_rejci __P((fsm *, u_char *, int)); -static int ccp_reqci __P((fsm *, u_char *, int *, int)); -static void ccp_up __P((fsm *)); -static void ccp_down __P((fsm *)); -static int ccp_extcode __P((fsm *, int, int, u_char *, int)); -static void ccp_rack_timeout __P((void *)); -static char *method_name __P((ccp_options *, ccp_options *)); +static void ccp_resetci (fsm *); +static int ccp_cilen (fsm *); +static void ccp_addci (fsm *, u_char *, int *); +static int ccp_ackci (fsm *, u_char *, int); +static int ccp_nakci (fsm *, u_char *, int, int); +static int ccp_rejci (fsm *, u_char *, int); +static int ccp_reqci (fsm *, u_char *, int *, int); +static void ccp_up (fsm *); +static void ccp_down (fsm *); +static int ccp_extcode (fsm *, int, int, u_char *, int); +static void ccp_rack_timeout (void *); +static char *method_name (ccp_options *, ccp_options *); static fsm_callbacks ccp_callbacks = { ccp_resetci, @@ -267,7 +267,7 @@ static int ccp_localstate[NUM_PPP]; static int all_rejected[NUM_PPP]; /* we rejected all peer's options */ /* - * Option parsing. + * Option parsing */ static int setbsdcomp(argv) @@ -1502,7 +1502,7 @@ static int ccp_printpkt(p, plen, printer, arg) u_char *p; int plen; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { u_char *p0, *optend; diff --git a/src/netif/ppp/chap-new.c b/src/netif/ppp/chap-new.c index fbeacabf..6a7fc29e 100644 --- a/src/netif/ppp/chap-new.c +++ b/src/netif/ppp/chap-new.c @@ -140,7 +140,7 @@ static void chap_protrej(int unit); static void chap_input(int unit, unsigned char *pkt, int pktlen); #if PRINTPKT_SUPPORT static int chap_print_pkt(unsigned char *p, int plen, - void (*printer) __P((void *, char *, ...)), void *arg); + void (*printer) (void *, char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ /* List of digest types that we know about */ @@ -604,7 +604,7 @@ static char *chap_code_names[] = { static int chap_print_pkt(unsigned char *p, int plen, - void (*printer) __P((void *, char *, ...)), void *arg) + void (*printer) (void *, char *, ...), void *arg) { int code, id, len; int clen, nlen; diff --git a/src/netif/ppp/chap_ms.c b/src/netif/ppp/chap_ms.c index a5caa54b..11a8258f 100644 --- a/src/netif/ppp/chap_ms.c +++ b/src/netif/ppp/chap_ms.c @@ -99,22 +99,22 @@ #define SHA1_SIGNATURE_SIZE 20 -static void ascii2unicode __P((char[], int, u_char[])); -static void NTPasswordHash __P((u_char *, int, u_char[MD4_SIGNATURE_SIZE])); -static void ChallengeResponse __P((u_char *, u_char *, u_char[24])); -static void ChapMS_NT __P((u_char *, char *, int, u_char[24])); -static void ChapMS2_NT __P((u_char *, u_char[16], char *, char *, int, - u_char[24])); +static void ascii2unicode (char[], int, u_char[]); +static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); +static void ChallengeResponse (u_char *, u_char *, u_char[24]); +static void ChapMS_NT (u_char *, char *, int, u_char[24]); +static void ChapMS2_NT (u_char *, u_char[16], char *, char *, int, + u_char[24]); static void GenerateAuthenticatorResponsePlain - __P((char*, int, u_char[24], u_char[16], u_char *, - char *, u_char[41])); + (char*, int, u_char[24], u_char[16], u_char *, + char *, u_char[41]); #ifdef MSLANMAN -static void ChapMS_LANMan __P((u_char *, char *, int, u_char *)); +static void ChapMS_LANMan (u_char *, char *, int, u_char *); #endif #ifdef MPPE -static void Set_Start_Key __P((u_char *, char *, int)); -static void SetMasterKeys __P((char *, int, u_char[24], int)); +static void Set_Start_Key (u_char *, char *, int); +static void SetMasterKeys (char *, int, u_char[24], int); #endif #ifdef MSLANMAN diff --git a/src/netif/ppp/chap_ms.h b/src/netif/ppp/chap_ms.h index ffff9b66..70211d3d 100644 --- a/src/netif/ppp/chap_ms.h +++ b/src/netif/ppp/chap_ms.h @@ -90,16 +90,16 @@ extern void set_mppe_enc_types(int, int); #define MS_CHAP2_AUTHENTICATEE 0 #define MS_CHAP2_AUTHENTICATOR 1 -void ChapMS __P((u_char *, char *, int, u_char *)); -void ChapMS2 __P((u_char *, u_char *, char *, char *, int, - u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int)); +void ChapMS (u_char *, char *, int, u_char *); +void ChapMS2 (u_char *, u_char *, char *, char *, int, + u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); #ifdef MPPE -void mppe_set_keys __P((u_char *, u_char[MD4_SIGNATURE_SIZE])); +void mppe_set_keys (u_char *, u_char[MD4_SIGNATURE_SIZE]); void mppe_set_keys2(u_char PasswordHashHash[MD4_SIGNATURE_SIZE], u_char NTResponse[24], int IsServer); #endif -void ChallengeHash __P((u_char[16], u_char *, char *, u_char[8])); +void ChallengeHash (u_char[16], u_char *, char *, u_char[8]); void GenerateAuthenticatorResponse(u_char PasswordHashHash[MD4_SIGNATURE_SIZE], u_char NTResponse[24], u_char PeerChallenge[16], diff --git a/src/netif/ppp/demand.c b/src/netif/ppp/demand.c index 5ef93755..b7c33e0f 100644 --- a/src/netif/ppp/demand.c +++ b/src/netif/ppp/demand.c @@ -74,7 +74,7 @@ struct packet { struct packet *pend_q; struct packet *pend_qtail; -static int active_packet __P((unsigned char *, int)); +static int active_packet (unsigned char *, int); /* * demand_conf - configure the interface for doing dial-on-demand. diff --git a/src/netif/ppp/eap.c b/src/netif/ppp/eap.c index e1b4f103..305e795d 100644 --- a/src/netif/ppp/eap.c +++ b/src/netif/ppp/eap.c @@ -97,14 +97,14 @@ static option_t eap_option_list[] = { /* * Protocol entry points. */ -static void eap_init __P((int unit)); -static void eap_input __P((int unit, u_char *inp, int inlen)); -static void eap_protrej __P((int unit)); -static void eap_lowerup __P((int unit)); -static void eap_lowerdown __P((int unit)); +static void eap_init (int unit); +static void eap_input (int unit, u_char *inp, int inlen); +static void eap_protrej (int unit); +static void eap_lowerup (int unit); +static void eap_lowerdown (int unit); #if PRINTPKT_SUPPORT -static int eap_printpkt __P((u_char *inp, int inlen, - void (*)(void *arg, char *fmt, ...), void *arg)); +static int eap_printpkt (u_char *inp, int inlen, + void (*)(void *arg, char *fmt, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ struct protent eap_protent = { @@ -176,7 +176,7 @@ static const u_char wkmodulus[] = { #endif /* Local forward declarations. */ -static void eap_server_timeout __P((void *arg)); +static void eap_server_timeout (void *arg); /* * Convert EAP state code to printable string for debug. @@ -2149,7 +2149,7 @@ static int eap_printpkt(inp, inlen, printer, arg) u_char *inp; int inlen; -void (*printer) __P((void *, char *, ...)); +void (*printer) (void *, char *, ...); void *arg; { int code, id, len, rtype, vallen; diff --git a/src/netif/ppp/eap.h b/src/netif/ppp/eap.h index ea0147ec..632df5f9 100644 --- a/src/netif/ppp/eap.h +++ b/src/netif/ppp/eap.h @@ -148,8 +148,8 @@ typedef struct eap_state { extern eap_state eap_states[]; -void eap_authwithpeer __P((int unit, char *localname)); -void eap_authpeer __P((int unit, char *localname)); +void eap_authwithpeer (int unit, char *localname); +void eap_authpeer (int unit, char *localname); extern struct protent eap_protent; diff --git a/src/netif/ppp/ecp.c b/src/netif/ppp/ecp.c index 90f3ee20..4c469b9a 100644 --- a/src/netif/ppp/ecp.c +++ b/src/netif/ppp/ecp.c @@ -81,22 +81,22 @@ static option_t ecp_option_list[] = { /* * Protocol entry points from main code. */ -static void ecp_init __P((int unit)); +static void ecp_init (int unit); /* -static void ecp_open __P((int unit)); -static void ecp_close __P((int unit, char *)); -static void ecp_lowerup __P((int unit)); -static void ecp_lowerdown __P((int)); -static void ecp_input __P((int unit, u_char *pkt, int len)); -static void ecp_protrej __P((int unit)); +static void ecp_open (int unit); +static void ecp_close (int unit, char *); +static void ecp_lowerup (int unit); +static void ecp_lowerdown (int); +static void ecp_input (int unit, u_char *pkt, int len); +static void ecp_protrej (int unit); */ #if PRINTPKT_SUPPORT -static int ecp_printpkt __P((u_char *pkt, int len, - void (*printer) __P((void *, char *, ...)), - void *arg)); +static int ecp_printpkt (u_char *pkt, int len, + void (*printer) (void *, char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ /* -static void ecp_datainput __P((int unit, u_char *pkt, int len)); +static void ecp_datainput (int unit, u_char *pkt, int len); */ struct protent ecp_protent = { @@ -178,7 +178,7 @@ static int ecp_printpkt(p, plen, printer, arg) u_char *p; int plen; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { return 0; diff --git a/src/netif/ppp/fsm.c b/src/netif/ppp/fsm.c index 4a31a904..3edf8b2b 100644 --- a/src/netif/ppp/fsm.c +++ b/src/netif/ppp/fsm.c @@ -59,14 +59,14 @@ #include "fsm.h" -static void fsm_timeout __P((void *)); -static void fsm_rconfreq __P((fsm *, int, u_char *, int)); -static void fsm_rconfack __P((fsm *, int, u_char *, int)); -static void fsm_rconfnakrej __P((fsm *, int, int, u_char *, int)); -static void fsm_rtermreq __P((fsm *, int, u_char *, int)); -static void fsm_rtermack __P((fsm *)); -static void fsm_rcoderej __P((fsm *, u_char *, int)); -static void fsm_sconfreq __P((fsm *, int)); +static void fsm_timeout (void *); +static void fsm_rconfreq (fsm *, int, u_char *, int); +static void fsm_rconfack (fsm *, int, u_char *, int); +static void fsm_rconfnakrej (fsm *, int, int, u_char *, int); +static void fsm_rtermreq (fsm *, int, u_char *, int); +static void fsm_rtermack (fsm *); +static void fsm_rcoderej (fsm *, u_char *, int); +static void fsm_sconfreq (fsm *, int); #define PROTO_NAME(f) ((f)->callbacks->proto_name) diff --git a/src/netif/ppp/fsm.h b/src/netif/ppp/fsm.h index 4f202caa..679dc187 100644 --- a/src/netif/ppp/fsm.h +++ b/src/netif/ppp/fsm.h @@ -89,33 +89,33 @@ typedef struct fsm { typedef struct fsm_callbacks { void (*resetci) /* Reset our Configuration Information */ - __P((fsm *)); + (fsm *); int (*cilen) /* Length of our Configuration Information */ - __P((fsm *)); + (fsm *); void (*addci) /* Add our Configuration Information */ - __P((fsm *, u_char *, int *)); + (fsm *, u_char *, int *); int (*ackci) /* ACK our Configuration Information */ - __P((fsm *, u_char *, int)); + (fsm *, u_char *, int); int (*nakci) /* NAK our Configuration Information */ - __P((fsm *, u_char *, int, int)); + (fsm *, u_char *, int, int); int (*rejci) /* Reject our Configuration Information */ - __P((fsm *, u_char *, int)); + (fsm *, u_char *, int); int (*reqci) /* Request peer's Configuration Information */ - __P((fsm *, u_char *, int *, int)); + (fsm *, u_char *, int *, int); void (*up) /* Called when fsm reaches OPENED state */ - __P((fsm *)); + (fsm *); void (*down) /* Called when fsm leaves OPENED state */ - __P((fsm *)); + (fsm *); void (*starting) /* Called when we want the lower layer */ - __P((fsm *)); + (fsm *); void (*finished) /* Called when we don't want the lower layer */ - __P((fsm *)); + (fsm *); void (*protreject) /* Called when Protocol-Reject received */ - __P((int)); + (int); void (*retransmit) /* Retransmission is necessary */ - __P((fsm *)); + (fsm *); int (*extcode) /* Called when unknown code received */ - __P((fsm *, int, int, u_char *, int)); + (fsm *, int, int, u_char *, int); char *proto_name; /* String name for protocol (for messages) */ } fsm_callbacks; @@ -155,14 +155,14 @@ typedef struct fsm_callbacks { /* * Prototypes */ -void fsm_init __P((fsm *)); -void fsm_lowerup __P((fsm *)); -void fsm_lowerdown __P((fsm *)); -void fsm_open __P((fsm *)); -void fsm_close __P((fsm *, char *)); -void fsm_input __P((fsm *, u_char *, int)); -void fsm_protreject __P((fsm *)); -void fsm_sdata __P((fsm *, int, int, u_char *, int)); +void fsm_init (fsm *); +void fsm_lowerup (fsm *); +void fsm_lowerdown (fsm *); +void fsm_open (fsm *); +void fsm_close (fsm *, char *); +void fsm_input (fsm *, u_char *, int); +void fsm_protreject (fsm *); +void fsm_sdata (fsm *, int, int, u_char *, int); /* diff --git a/src/netif/ppp/ipcp.c b/src/netif/ppp/ipcp.c index 69427357..0c007b58 100644 --- a/src/netif/ppp/ipcp.c +++ b/src/netif/ppp/ipcp.c @@ -77,13 +77,13 @@ bool noremoteip = 0; /* Let him have no IP address */ #if 0 /* UNUSED */ /* Hook for a plugin to know when IP protocol has come up */ -void (*ip_up_hook) __P((void)) = NULL; +void (*ip_up_hook) (void) = NULL; /* Hook for a plugin to know when IP protocol has come down */ -void (*ip_down_hook) __P((void)) = NULL; +void (*ip_down_hook) (void) = NULL; /* Hook for a plugin to choose the remote IP address */ -void (*ip_choose_hook) __P((u_int32_t *)) = NULL; +void (*ip_choose_hook) (u_int32_t *) = NULL; #endif /* UNUSED */ #if PPP_NOTIFY @@ -107,16 +107,16 @@ static char netmask_str[20]; /* string form of netmask value */ /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void ipcp_resetci __P((fsm *)); /* Reset our CI */ -static int ipcp_cilen __P((fsm *)); /* Return length of our CI */ -static void ipcp_addci __P((fsm *, u_char *, int *)); /* Add our CI */ -static int ipcp_ackci __P((fsm *, u_char *, int)); /* Peer ack'd our CI */ -static int ipcp_nakci __P((fsm *, u_char *, int, int));/* Peer nak'd our CI */ -static int ipcp_rejci __P((fsm *, u_char *, int)); /* Peer rej'd our CI */ -static int ipcp_reqci __P((fsm *, u_char *, int *, int)); /* Rcv CI */ -static void ipcp_up __P((fsm *)); /* We're UP */ -static void ipcp_down __P((fsm *)); /* We're DOWN */ -static void ipcp_finished __P((fsm *)); /* Don't need lower layer */ +static void ipcp_resetci (fsm *); /* Reset our CI */ +static int ipcp_cilen (fsm *); /* Return length of our CI */ +static void ipcp_addci (fsm *, u_char *, int *); /* Add our CI */ +static int ipcp_ackci (fsm *, u_char *, int); /* Peer ack'd our CI */ +static int ipcp_nakci (fsm *, u_char *, int, int);/* Peer nak'd our CI */ +static int ipcp_rejci (fsm *, u_char *, int); /* Peer rej'd our CI */ +static int ipcp_reqci (fsm *, u_char *, int *, int); /* Rcv CI */ +static void ipcp_up (fsm *); /* We're UP */ +static void ipcp_down (fsm *); /* We're DOWN */ +static void ipcp_finished (fsm *); /* Don't need lower layer */ fsm ipcp_fsm[NUM_PPP]; /* IPCP fsm structure */ @@ -142,13 +142,13 @@ static fsm_callbacks ipcp_callbacks = { /* IPCP callback routines */ * Command-line options. */ #if PPP_OPTIONS -static int setvjslots __P((char **)); -static int setdnsaddr __P((char **)); -static int setwinsaddr __P((char **)); -static int setnetmask __P((char **)); -int setipaddr __P((char *, char **, int)); +static int setvjslots (char **); +static int setdnsaddr (char **); +static int setwinsaddr (char **); +static int setnetmask (char **); +int setipaddr (char *, char **, int); -static void printipaddr __P((option_t *, void (*)(void *, char *,...),void *)); +static void printipaddr (option_t *, void (*)(void *, char *,...),void *); static option_t ipcp_option_list[] = { { "noip", o_bool, &ipcp_protent.enabled_flag, @@ -255,26 +255,26 @@ static option_t ipcp_option_list[] = { /* * Protocol entry points from main code. */ -static void ipcp_init __P((int)); -static void ipcp_open __P((int)); -static void ipcp_close __P((int, char *)); -static void ipcp_lowerup __P((int)); -static void ipcp_lowerdown __P((int)); -static void ipcp_input __P((int, u_char *, int)); -static void ipcp_protrej __P((int)); +static void ipcp_init (int); +static void ipcp_open (int); +static void ipcp_close (int, char *); +static void ipcp_lowerup (int); +static void ipcp_lowerdown (int); +static void ipcp_input (int, u_char *, int); +static void ipcp_protrej (int); #if PRINTPKT_SUPPORT -static int ipcp_printpkt __P((u_char *, int, - void (*) __P((void *, char *, ...)), void *)); +static int ipcp_printpkt (u_char *, int, + void (*) (void *, char *, ...), void *); #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS -static void ip_check_options __P((void)); +static void ip_check_options (void); #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT -static int ip_demand_conf __P((int)); -static int ip_active_pkt __P((u_char *, int)); +static int ip_demand_conf (int); +static int ip_active_pkt (u_char *, int); #endif /* DEMAND_SUPPORT */ #if 0 /* UNUSED */ -static void create_resolv __P((u_int32_t, u_int32_t)); +static void create_resolv (u_int32_t, u_int32_t); #endif /* UNUSED */ struct protent ipcp_protent = { @@ -510,7 +510,7 @@ setipaddr(arg, argv, doit) static void printipaddr(opt, printer, arg) option_t *opt; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { ipcp_options *wo = &ipcp_wantoptions[0]; @@ -2106,7 +2106,7 @@ static int ipcp_printpkt(p, plen, printer, arg) u_char *p; int plen; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { int code, id, len, olen; diff --git a/src/netif/ppp/ipcp.h b/src/netif/ppp/ipcp.h index 582d167b..fbd0214c 100644 --- a/src/netif/ppp/ipcp.h +++ b/src/netif/ppp/ipcp.h @@ -96,7 +96,7 @@ extern ipcp_options ipcp_allowoptions[]; extern ipcp_options ipcp_hisoptions[]; #if 0 /* UNUSED, already defined by lwIP */ -char *ip_ntoa __P((u_int32_t)); +char *ip_ntoa (u_int32_t); #endif /* UNUSED, already defined by lwIP */ extern struct protent ipcp_protent; diff --git a/src/netif/ppp/lcp.c b/src/netif/ppp/lcp.c index 5212d934..8613559a 100644 --- a/src/netif/ppp/lcp.c +++ b/src/netif/ppp/lcp.c @@ -70,7 +70,7 @@ /* steal a bit in fsm flags word */ #define DELAYED_UP 0x100 -static void lcp_delayed_up __P((void *)); +static void lcp_delayed_up (void *); /* * LCP-related command-line options. @@ -84,13 +84,13 @@ bool lax_recv = 0; /* accept control chars in asyncmap */ bool noendpoint = 0; /* don't send/accept endpoint discriminator */ #if PPP_OPTIONS -static int noopt __P((char **)); +static int noopt (char **); #endif /* PPP_OPTIONS */ #ifdef HAVE_MULTILINK -static int setendpoint __P((char **)); -static void printendpoint __P((option_t *, void (*)(void *, char *, ...), - void *)); +static int setendpoint (char **); +static void printendpoint (option_t *, void (*)(void *, char *, ...), + void *); #endif /* HAVE_MULTILINK */ #if PPP_OPTIONS @@ -220,31 +220,31 @@ static u_char nak_buffer[PPP_MRU]; /* where we construct a nak packet */ /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void lcp_resetci __P((fsm *)); /* Reset our CI */ -static int lcp_cilen __P((fsm *)); /* Return length of our CI */ -static void lcp_addci __P((fsm *, u_char *, int *)); /* Add our CI to pkt */ -static int lcp_ackci __P((fsm *, u_char *, int)); /* Peer ack'd our CI */ -static int lcp_nakci __P((fsm *, u_char *, int, int)); /* Peer nak'd our CI */ -static int lcp_rejci __P((fsm *, u_char *, int)); /* Peer rej'd our CI */ -static int lcp_reqci __P((fsm *, u_char *, int *, int)); /* Rcv peer CI */ -static void lcp_up __P((fsm *)); /* We're UP */ -static void lcp_down __P((fsm *)); /* We're DOWN */ -static void lcp_starting __P((fsm *)); /* We need lower layer up */ -static void lcp_finished __P((fsm *)); /* We need lower layer down */ -static int lcp_extcode __P((fsm *, int, int, u_char *, int)); -static void lcp_rprotrej __P((fsm *, u_char *, int)); +static void lcp_resetci (fsm *); /* Reset our CI */ +static int lcp_cilen (fsm *); /* Return length of our CI */ +static void lcp_addci (fsm *, u_char *, int *); /* Add our CI to pkt */ +static int lcp_ackci (fsm *, u_char *, int); /* Peer ack'd our CI */ +static int lcp_nakci (fsm *, u_char *, int, int); /* Peer nak'd our CI */ +static int lcp_rejci (fsm *, u_char *, int); /* Peer rej'd our CI */ +static int lcp_reqci (fsm *, u_char *, int *, int); /* Rcv peer CI */ +static void lcp_up (fsm *); /* We're UP */ +static void lcp_down (fsm *); /* We're DOWN */ +static void lcp_starting (fsm *); /* We need lower layer up */ +static void lcp_finished (fsm *); /* We need lower layer down */ +static int lcp_extcode (fsm *, int, int, u_char *, int); +static void lcp_rprotrej (fsm *, u_char *, int); /* * routines to send LCP echos to peer */ -static void lcp_echo_lowerup __P((int)); -static void lcp_echo_lowerdown __P((int)); -static void LcpEchoTimeout __P((void *)); -static void lcp_received_echo_reply __P((fsm *, int, u_char *, int)); -static void LcpSendEchoRequest __P((fsm *)); -static void LcpLinkFailure __P((fsm *)); -static void LcpEchoCheck __P((fsm *)); +static void lcp_echo_lowerup (int); +static void lcp_echo_lowerdown (int); +static void LcpEchoTimeout (void *); +static void lcp_received_echo_reply (fsm *, int, u_char *, int); +static void LcpSendEchoRequest (fsm *); +static void LcpLinkFailure (fsm *); +static void LcpEchoCheck (fsm *); static fsm_callbacks lcp_callbacks = { /* LCP callback routines */ lcp_resetci, /* Reset our Configuration Information */ @@ -269,12 +269,12 @@ static fsm_callbacks lcp_callbacks = { /* LCP callback routines */ * Some of these are called directly. */ -static void lcp_init __P((int)); -static void lcp_input __P((int, u_char *, int)); -static void lcp_protrej __P((int)); +static void lcp_init (int); +static void lcp_input (int, u_char *, int); +static void lcp_protrej (int); #if PRINTPKT_SUPPORT -static int lcp_printpkt __P((u_char *, int, - void (*) __P((void *, char *, ...)), void *)); +static int lcp_printpkt (u_char *, int, + void (*) (void *, char *, ...), void *); #endif /* PRINTPKT_SUPPORT */ struct protent lcp_protent = { @@ -356,7 +356,7 @@ setendpoint(argv) static void printendpoint(opt, printer, arg) option_t *opt; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); @@ -2360,7 +2360,7 @@ static int lcp_printpkt(p, plen, printer, arg) u_char *p; int plen; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { int code, id, len, olen, i; diff --git a/src/netif/ppp/lcp.h b/src/netif/ppp/lcp.h index d701e9af..eb1e33f8 100644 --- a/src/netif/ppp/lcp.h +++ b/src/netif/ppp/lcp.h @@ -140,11 +140,11 @@ extern ext_accm xmit_accm[]; #define MINMRU 128 /* No MRUs below this */ #define MAXMRU 16384 /* Normally limit MRU to this */ -void lcp_open __P((int)); -void lcp_close __P((int, char *)); -void lcp_lowerup __P((int)); -void lcp_lowerdown __P((int)); -void lcp_sprotrej __P((int, u_char *, int)); /* send protocol reject */ +void lcp_open (int); +void lcp_close (int, char *); +void lcp_lowerup (int); +void lcp_lowerdown (int); +void lcp_sprotrej (int, u_char *, int); /* send protocol reject */ extern struct protent lcp_protent; diff --git a/src/netif/ppp/multilink.c b/src/netif/ppp/multilink.c index 0ca3309c..5648d26c 100644 --- a/src/netif/ppp/multilink.c +++ b/src/netif/ppp/multilink.c @@ -64,13 +64,13 @@ bool multilink_master; /* we own the multilink bundle */ extern TDB_CONTEXT *pppdb; extern char db_key[]; -static void make_bundle_links __P((int append)); -static void remove_bundle_link __P((void)); -static void iterate_bundle_links __P((void (*func) __P((char *)))); +static void make_bundle_links (int append); +static void remove_bundle_link (void); +static void iterate_bundle_links (void (*func) (char *)); -static int get_default_epdisc __P((struct epdisc *)); -static int parse_num __P((char *str, const char *key, int *valp)); -static int owns_unit __P((TDB_DATA pid, int unit)); +static int get_default_epdisc (struct epdisc *); +static int parse_num (char *str, const char *key, int *valp); +static int owns_unit (TDB_DATA pid, int unit); #define set_ip_epdisc(ep, addr) do { \ ep->length = 4; \ diff --git a/src/netif/ppp/options.c b/src/netif/ppp/options.c index b4d334f7..1c39c6a7 100644 --- a/src/netif/ppp/options.c +++ b/src/netif/ppp/options.c @@ -78,7 +78,7 @@ #include "ppp_impl.h" #if defined(ultrix) || defined(NeXT) -char *strdup __P((char *)); +char *strdup (char *); #endif struct option_value { @@ -165,32 +165,32 @@ static char logfile_name[MAXPATHLEN]; /* name of log file */ * Prototypes */ #if 0 /* UNUSED */ -static int setdomain __P((char **)); -static int readfile __P((char **)); -static int callfile __P((char **)); -static int showversion __P((char **)); -static int showhelp __P((char **)); -static void usage __P((void)); -static int setlogfile __P((char **)); +static int setdomain (char **); +static int readfile (char **); +static int callfile (char **); +static int showversion (char **); +static int showhelp (char **); +static void usage (void); +static int setlogfile (char **); #endif /* UNUSED */ #ifdef PLUGIN -static int loadplugin __P((char **)); +static int loadplugin (char **); #endif #ifdef PPP_FILTER -static int setpassfilter __P((char **)); -static int setactivefilter __P((char **)); +static int setpassfilter (char **); +static int setactivefilter (char **); #endif #ifdef MAXOCTETS -static int setmodir __P((char **)); +static int setmodir (char **); #endif #if 0 /* UNUSED */ -static option_t *find_option __P((const char *name)); -static int process_option __P((option_t *, char *, char **)); -static int n_arguments __P((option_t *)); -static int number_option __P((char *, u_int32_t *, int)); +static option_t *find_option (const char *name); +static int process_option (option_t *, char *, char **); +static int n_arguments (option_t *); +static int number_option (char *, u_int32_t *, int); /* * Structure to store extra lists of options. @@ -597,13 +597,13 @@ match_option(name, opt, dowild) option_t *opt; int dowild; { - int (*match) __P((char *, char **, int)); + int (*match) (char *, char **, int); if (dowild != (opt->type == o_wild)) return 0; if (!dowild) return strcmp(name, opt->name) == 0; - match = (int (*) __P((char *, char **, int))) opt->addr; + match = (int (*) (char *, char **, int)) opt->addr; return (*match)(name, NULL, 0); } @@ -655,8 +655,8 @@ process_option(opt, cmd, argv) u_int32_t v; int iv, a; char *sv; - int (*parser) __P((char **)); - int (*wildp) __P((char *, char **, int)); + int (*parser) (char **); + int (*wildp) (char *, char **, int); char *optopt = (opt->type == o_wild)? "": " option"; int prio = option_priority; option_t *mainopt = opt; @@ -787,7 +787,7 @@ process_option(opt, cmd, argv) case o_special_noarg: case o_special: - parser = (int (*) __P((char **))) opt->addr; + parser = (int (*) (char **)) opt->addr; if (!(*parser)(argv)) return 0; if (opt->flags & OPT_A2LIST) { @@ -810,7 +810,7 @@ process_option(opt, cmd, argv) break; case o_wild: - wildp = (int (*) __P((char *, char **, int))) opt->addr; + wildp = (int (*) (char *, char **, int)) opt->addr; if (!(*wildp)(cmd, argv, 1)) return 0; break; @@ -901,7 +901,7 @@ check_options() static void print_option(opt, mainopt, printer, arg) option_t *opt, *mainopt; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { int i, v; @@ -964,12 +964,12 @@ print_option(opt, mainopt, printer, arg) printer(arg, " "); } if (opt->flags & OPT_A2PRINTER) { - void (*oprt) __P((option_t *, - void ((*)__P((void *, char *, ...))), - void *)); - oprt = (void (*) __P((option_t *, - void ((*)__P((void *, char *, ...))), - void *)))opt->addr2; + void (*oprt) (option_t *, + void ((*)(void *, char *, ...)), + void *); + oprt = (void (*) (option_t *, + void ((*)(void *, char *, ...)), + void *))opt->addr2; (*oprt)(opt, printer, arg); } else if (opt->flags & OPT_A2STRVAL) { p = (char *) opt->addr2; @@ -1006,7 +1006,7 @@ print_option(opt, mainopt, printer, arg) static void print_option_list(opt, printer, arg) option_t *opt; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { while (opt->name != NULL) { @@ -1024,7 +1024,7 @@ print_option_list(opt, printer, arg) */ void print_options(printer, arg) - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { struct option_list *list; @@ -1084,7 +1084,7 @@ showversion(argv) * stderr if phase == PHASE_INITIALIZE. */ void -option_error __V((char *fmt, ...)) +option_error (char *fmt, ...) { va_list args; char buf[1024]; @@ -1596,7 +1596,7 @@ loadplugin(argv) char *arg = *argv; void *handle; const char *err; - void (*init) __P((void)); + void (*init) (void); char *path = arg; const char *vers; diff --git a/src/netif/ppp/ppp_impl.h b/src/netif/ppp/ppp_impl.h index 0b3c18e7..5f3c5a78 100644 --- a/src/netif/ppp/ppp_impl.h +++ b/src/netif/ppp/ppp_impl.h @@ -38,24 +38,7 @@ #define PPP_IMP_H_ #include /* formats */ - -#if defined(__STDC__) #include -#define __V(x) x -#else -#include -#define __V(x) (va_alist) va_dcl -#define const -#define volatile -#endif - -#ifndef __P -#ifdef __STDC__ -#define __P(x) x -#else -#define __P(x) () -#endif -#endif #ifndef bool typedef unsigned char bool; @@ -329,30 +312,30 @@ extern int maxoctets_timeout; /* Timeout for check of octets limit */ struct protent { u_short protocol; /* PPP protocol number */ /* Initialization procedure */ - void (*init) __P((int unit)); + void (*init) (int unit); /* Process a received packet */ - void (*input) __P((int unit, u_char *pkt, int len)); + void (*input) (int unit, u_char *pkt, int len); /* Process a received protocol-reject */ - void (*protrej) __P((int unit)); + void (*protrej) (int unit); /* Lower layer has come up */ - void (*lowerup) __P((int unit)); + void (*lowerup) (int unit); /* Lower layer has gone down */ - void (*lowerdown) __P((int unit)); + void (*lowerdown) (int unit); /* Open the protocol */ - void (*open) __P((int unit)); + void (*open) (int unit); /* Close the protocol */ - void (*close) __P((int unit, char *reason)); + void (*close) (int unit, char *reason); #if PRINTPKT_SUPPORT /* Print a packet in readable form */ - int (*printpkt) __P((u_char *pkt, int len, - void (*printer) __P((void *, char *, ...)), - void *arg)); + int (*printpkt) (u_char *pkt, int len, + void (*printer) (void *, char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ /* FIXME: data input is only used by CCP, which is not supported at this time, * should we remove this entry and save some flash ? */ /* Process a received data packet */ - void (*datainput) __P((int unit, u_char *pkt, int len)); + void (*datainput) (int unit, u_char *pkt, int len); bool enabled_flag; /* 0 iff protocol is disabled */ #if PRINTPKT_SUPPORT char *name; /* Text name of protocol */ @@ -361,13 +344,13 @@ struct protent { #if PPP_OPTIONS option_t *options; /* List of command-line options */ /* Check requested options, assign defaults */ - void (*check_options) __P((void)); + void (*check_options) (void); #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT /* Configure interface for demand-dial */ - int (*demand_conf) __P((int unit)); + int (*demand_conf) (int unit); /* Say whether to bring up link for this pkt */ - int (*active_pkt) __P((u_char *pkt, int len)); + int (*active_pkt) (u_char *pkt, int len); #endif /* DEMAND_SUPPORT */ }; @@ -627,51 +610,51 @@ void update_link_stats(int u); /* Get stats at link termination */ #define EXIT_CNID_AUTH_FAILED 21 /* Procedures exported from auth.c */ -void link_required __P((int)); /* we are starting to use the link */ -void link_terminated __P((int)); /* we are finished with the link */ -void link_down __P((int)); /* the LCP layer has left the Opened state */ -void upper_layers_down __P((int));/* take all NCPs down */ -void link_established __P((int)); /* the link is up; authenticate now */ -void start_networks __P((int)); /* start all the network control protos */ -void continue_networks __P((int)); /* start network [ip, etc] control protos */ +void link_required (int); /* we are starting to use the link */ +void link_terminated (int); /* we are finished with the link */ +void link_down (int); /* the LCP layer has left the Opened state */ +void upper_layers_down (int);/* take all NCPs down */ +void link_established (int); /* the link is up; authenticate now */ +void start_networks (int); /* start all the network control protos */ +void continue_networks (int); /* start network [ip, etc] control protos */ -void auth_peer_fail __P((int, int)); +void auth_peer_fail (int, int); /* peer failed to authenticate itself */ -void auth_peer_success __P((int, int, int, char *, int)); +void auth_peer_success (int, int, int, char *, int); /* peer successfully authenticated itself */ -void auth_withpeer_fail __P((int, int)); +void auth_withpeer_fail (int, int); /* we failed to authenticate ourselves */ -void auth_withpeer_success __P((int, int, int)); +void auth_withpeer_success (int, int, int); /* we successfully authenticated ourselves */ -void np_up __P((int, int)); /* a network protocol has come up */ -void np_down __P((int, int)); /* a network protocol has gone down */ -void np_finished __P((int, int)); /* a network protocol no longer needs link */ -void auth_reset __P((int)); /* check what secrets we have */ -int get_secret __P((int, char *, char *, char *, int *, int)); +void np_up (int, int); /* a network protocol has come up */ +void np_down (int, int); /* a network protocol has gone down */ +void np_finished (int, int); /* a network protocol no longer needs link */ +void auth_reset (int); /* check what secrets we have */ +int get_secret (int, char *, char *, char *, int *, int); /* get "secret" for chap */ /* Procedures exported from ipcp.c */ -/* int parse_dotted_ip __P((char *, u_int32_t *)); */ +/* int parse_dotted_ip (char *, u_int32_t *); */ /* Procedures exported from demand.c */ #if DEMAND_SUPPORT -void demand_conf __P((void)); /* config interface(s) for demand-dial */ -void demand_block __P((void)); /* set all NPs to queue up packets */ -void demand_unblock __P((void)); /* set all NPs to pass packets */ -void demand_discard __P((void)); /* set all NPs to discard packets */ -void demand_rexmit __P((int, u_int32_t)); /* retransmit saved frames for an NP*/ -int loop_chars __P((unsigned char *, int)); /* process chars from loopback */ -int loop_frame __P((unsigned char *, int)); /* should we bring link up? */ +void demand_conf (void); /* config interface(s) for demand-dial */ +void demand_block (void); /* set all NPs to queue up packets */ +void demand_unblock (void); /* set all NPs to pass packets */ +void demand_discard (void); /* set all NPs to discard packets */ +void demand_rexmit (int, u_int32_t); /* retransmit saved frames for an NP*/ +int loop_chars (unsigned char *, int); /* process chars from loopback */ +int loop_frame (unsigned char *, int); /* should we bring link up? */ #endif /* DEMAND_SUPPORT */ /* Procedures exported from multilink.c */ #ifdef HAVE_MULTILINK -void mp_check_options __P((void)); /* Check multilink-related options */ -int mp_join_bundle __P((void)); /* join our link to an appropriate bundle */ -void mp_exit_bundle __P((void)); /* have disconnected our link from bundle */ -void mp_bundle_terminated __P((void)); -char *epdisc_to_str __P((struct epdisc *)); /* string from endpoint discrim. */ -int str_to_epdisc __P((struct epdisc *, char *)); /* endpt disc. from str */ +void mp_check_options (void); /* Check multilink-related options */ +int mp_join_bundle (void); /* join our link to an appropriate bundle */ +void mp_exit_bundle (void); /* have disconnected our link from bundle */ +void mp_bundle_terminated (void); +char *epdisc_to_str (struct epdisc *); /* string from endpoint discrim. */ +int str_to_epdisc (struct epdisc *, char *); /* endpt disc. from str */ #else #define mp_bundle_terminated() /* nothing */ #define mp_exit_bundle() /* nothing */ @@ -680,23 +663,23 @@ int str_to_epdisc __P((struct epdisc *, char *)); /* endpt disc. from str */ #endif /* Procedures exported from utils.c. */ -void print_string __P((char *, int, void (*) (void *, char *, ...), - void *)); /* Format a string for output */ -int slprintf __P((char *, int, char *, ...)); /* sprintf++ */ -int vslprintf __P((char *, int, char *, va_list)); /* vsprintf++ */ -size_t strlcpy __P((char *, const char *, size_t)); /* safe strcpy */ -size_t strlcat __P((char *, const char *, size_t)); /* safe strncpy */ -void dbglog __P((char *, ...)); /* log a debug message */ -void info __P((char *, ...)); /* log an informational message */ -void notice __P((char *, ...)); /* log a notice-level message */ -void warn __P((char *, ...)); /* log a warning message */ -void error __P((char *, ...)); /* log an error message */ -void fatal __P((char *, ...)); /* log an error message and die(1) */ -void init_pr_log __P((const char *, int)); /* initialize for using pr_log */ -void pr_log __P((void *, char *, ...)); /* printer fn, output to syslog */ -void end_pr_log __P((void)); /* finish up after using pr_log */ +void print_string (char *, int, void (*) (void *, char *, ...), + void *); /* Format a string for output */ +int slprintf (char *, int, char *, ...); /* sprintf++ */ +int vslprintf (char *, int, char *, va_list); /* vsprintf++ */ +size_t strlcpy (char *, const char *, size_t); /* safe strcpy */ +size_t strlcat (char *, const char *, size_t); /* safe strncpy */ +void dbglog (char *, ...); /* log a debug message */ +void info (char *, ...); /* log an informational message */ +void notice (char *, ...); /* log a notice-level message */ +void warn (char *, ...); /* log a warning message */ +void error (char *, ...); /* log an error message */ +void fatal (char *, ...); /* log an error message and die(1) */ +void init_pr_log (const char *, int); /* initialize for using pr_log */ +void pr_log (void *, char *, ...); /* printer fn, output to syslog */ +void end_pr_log (void); /* finish up after using pr_log */ #if PRINTPKT_SUPPORT -void dump_packet __P((const char *, u_char *, int)); +void dump_packet (const char *, u_char *, int); /* dump packet to debug log if interesting */ #endif /* PRINTPKT_SUPPORT */ diff --git a/src/netif/ppp/upap.c b/src/netif/ppp/upap.c index 07ea3853..eddba238 100644 --- a/src/netif/ppp/upap.c +++ b/src/netif/ppp/upap.c @@ -84,14 +84,14 @@ static option_t pap_option_list[] = { /* * Protocol entry points. */ -static void upap_init __P((int)); -static void upap_lowerup __P((int)); -static void upap_lowerdown __P((int)); -static void upap_input __P((int, u_char *, int)); -static void upap_protrej __P((int)); +static void upap_init (int); +static void upap_lowerup (int); +static void upap_lowerdown (int); +static void upap_input (int, u_char *, int); +static void upap_protrej (int); #if PRINTPKT_SUPPORT -static int upap_printpkt __P((u_char *, int, - void (*) __P((void *, char *, ...)), void *)); +static int upap_printpkt (u_char *, int, + void (*) (void *, char *, ...), void *); #endif /* PRINTPKT_SUPPORT */ struct protent pap_protent = { @@ -124,16 +124,16 @@ struct protent pap_protent = { upap_state upap[NUM_PPP]; /* UPAP state; one for each unit */ -static void upap_timeout __P((void *)); -static void upap_reqtimeout __P((void *)); +static void upap_timeout (void *); +static void upap_reqtimeout (void *); #if 0 /* UNUSED */ -static void upap_rauthreq __P((upap_state *, u_char *, int, int)); +static void upap_rauthreq (upap_state *, u_char *, int, int); #endif /* UNUSED */ -static void upap_rauthack __P((upap_state *, u_char *, int, int)); -static void upap_rauthnak __P((upap_state *, u_char *, int, int)); -static void upap_sauthreq __P((upap_state *)); +static void upap_rauthack (upap_state *, u_char *, int, int); +static void upap_rauthnak (upap_state *, u_char *, int, int); +static void upap_sauthreq (upap_state *); #if 0 /* UNUSED */ -static void upap_sresp __P((upap_state *, int, int, char *, int)); +static void upap_sresp (upap_state *, int, int, char *, int); #endif /* UNUSED */ @@ -638,7 +638,7 @@ static int upap_printpkt(p, plen, printer, arg) u_char *p; int plen; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { int code, id, len; diff --git a/src/netif/ppp/upap.h b/src/netif/ppp/upap.h index 7e51b351..189e858e 100644 --- a/src/netif/ppp/upap.h +++ b/src/netif/ppp/upap.h @@ -109,8 +109,8 @@ typedef struct upap_state { extern upap_state upap[]; -void upap_authwithpeer __P((int, char *, char *)); -void upap_authpeer __P((int)); +void upap_authwithpeer (int, char *, char *); +void upap_authpeer (int); extern struct protent pap_protent; diff --git a/src/netif/ppp/utils.c b/src/netif/ppp/utils.c index e1340388..b2e2a8a3 100644 --- a/src/netif/ppp/utils.c +++ b/src/netif/ppp/utils.c @@ -69,12 +69,12 @@ extern char *strerror(); #endif -static void logit __P((int, char *, va_list)); -static void log_write __P((int, char *)); +static void logit (int, char *, va_list); +static void log_write (int, char *); #if PRINTPKT_SUPPORT -static void vslp_printer __P((void *, char *, ...)); -static void format_packet __P((u_char *, int, void (*) (void *, char *, ...), - void *)); +static void vslp_printer (void *, char *, ...); +static void format_packet (u_char *, int, void (*) (void *, char *, ...), + void *); #endif /* PRINTPKT_SUPPORT */ struct buffer_info { @@ -130,7 +130,7 @@ strlcat(dest, src, len) * Returns the number of chars put into buf. */ int -slprintf __V((char *buf, int buflen, char *fmt, ...)) +slprintf (char *buf, int buflen, char *fmt, ...) { va_list args; int n; @@ -440,7 +440,7 @@ vslprintf(buf, buflen, fmt, args) * vslp_printer - used in processing a %P format */ static void -vslp_printer __V((void *arg, char *fmt, ...)) +vslp_printer (void *arg, char *fmt, ...) { int n; va_list pvar; @@ -492,7 +492,7 @@ static void format_packet(p, len, printer, arg) u_char *p; int len; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { int i, n; @@ -569,7 +569,7 @@ end_pr_log() * pr_log - printer routine for outputting to log */ void -pr_log __V((void *arg, char *fmt, ...)) +pr_log (void *arg, char *fmt, ...) { int l, n; va_list pvar; @@ -631,7 +631,7 @@ void print_string(p, len, printer, arg) char *p; int len; - void (*printer) __P((void *, char *, ...)); + void (*printer) (void *, char *, ...); void *arg; { int c; @@ -702,7 +702,7 @@ log_write(level, buf) * fatal - log an error message and die horribly. */ void -fatal __V((char *fmt, ...)) +fatal (char *fmt, ...) { va_list pvar; @@ -727,7 +727,7 @@ fatal __V((char *fmt, ...)) * error - log an error message. */ void -error __V((char *fmt, ...)) +error (char *fmt, ...) { va_list pvar; @@ -748,7 +748,7 @@ error __V((char *fmt, ...)) * warn - log a warning message. */ void -warn __V((char *fmt, ...)) +warn (char *fmt, ...) { va_list pvar; @@ -768,7 +768,7 @@ warn __V((char *fmt, ...)) * notice - log a notice-level message. */ void -notice __V((char *fmt, ...)) +notice (char *fmt, ...) { va_list pvar; @@ -788,7 +788,7 @@ notice __V((char *fmt, ...)) * info - log an informational message. */ void -info __V((char *fmt, ...)) +info (char *fmt, ...) { va_list pvar; @@ -808,7 +808,7 @@ info __V((char *fmt, ...)) * dbglog - log a debug message. */ void -dbglog __V((char *fmt, ...)) +dbglog (char *fmt, ...) { va_list pvar;