From: Russell Coker Date: Fri, 11 Jan 2002 18:31:42 +0000 (+0000) Subject: Made setipaddr() non-static so it can be called from plugins (particularly X-Git-Tag: ppp-2.4.7~458 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=3371dbae2932c2f3035587d05962240d95b1f63b Made setipaddr() non-static so it can be called from plugins (particularly portslave). Also fix a trivial multiple-definition warning in ppp/pppd/ipcp.c and a comma-at-end-of-enum warning in ppp/pppd/pppd.h. --- diff --git a/pppd/ipcp.c b/pppd/ipcp.c index 64d67fe..5e8366b 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: ipcp.c,v 1.58 2001/04/27 23:13:06 paulus Exp $" +#define RCSID "$Id: ipcp.c,v 1.59 2002/01/11 18:31:42 etbe Exp $" /* * TODO: @@ -113,7 +113,7 @@ static int setvjslots __P((char **)); static int setdnsaddr __P((char **)); static int setwinsaddr __P((char **)); static int setnetmask __P((char **)); -static int setipaddr __P((char *, char **, int)); +int setipaddr __P((char *, char **, int)); static void printipaddr __P((option_t *, void (*)(void *, char *,...),void *)); static option_t ipcp_option_list[] = { @@ -371,8 +371,9 @@ setwinsaddr(argv) * setipaddr - Set the IP address * If doit is 0, the call is to check whether this option is * potentially an IP address specification. + * Not static so that plugins can call it to set the addresses */ -static int +int setipaddr(arg, argv, doit) char *arg; char **argv; @@ -2018,7 +2019,9 @@ ipcp_printpkt(p, plen, printer, arg) */ #define IP_HDRLEN 20 /* bytes */ #define IP_OFFMASK 0x1fff +#ifndef IPPROTO_TCP #define IPPROTO_TCP 6 +#endif #define TCP_HDRLEN 20 #define TH_FIN 0x01 diff --git a/pppd/pppd.h b/pppd/pppd.h index 9e03a12..f645eb4 100644 --- a/pppd/pppd.h +++ b/pppd/pppd.h @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: pppd.h,v 1.62 2001/05/23 03:39:13 paulus Exp $ + * $Id: pppd.h,v 1.63 2002/01/11 18:31:42 etbe Exp $ */ /* @@ -71,7 +71,7 @@ enum opt_type { o_int, o_uint32, o_string, - o_wild, + o_wild }; typedef struct { @@ -580,6 +580,7 @@ int get_if_hwaddr __P((u_char *addr, char *name)); char *get_first_ethernet __P((void)); /* Procedures exported from options.c */ +int setipaddr __P((char *, char **, int)); /* Set local/remote ip addresses */ int parse_args __P((int argc, char **argv)); /* Parse options from arguments given */ int options_from_file __P((char *filename, int must_exist, int check_prot,