X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fcbcp.c;h=394f9e40869508f302e0e39e126b12975e07b00d;hp=73cbcf02355110341840ee11c6ae35c9260f1b10;hb=f53a48eb9d74db3c71938e114b7f489c339bc003;hpb=875d9641d05b4fcb7e186f784c801962bb2670e5 diff --git a/pppd/cbcp.c b/pppd/cbcp.c index 73cbcf0..394f9e4 100644 --- a/pppd/cbcp.c +++ b/pppd/cbcp.c @@ -1,26 +1,39 @@ /* * cbcp - Call Back Configuration Protocol. * - * Copyright (c) 1995 Pedro Roque Marques - * All rights reserved. + * Copyright (c) 1995 Pedro Roque Marques. All rights reserved. * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Pedro Roque Marques. The name of the author may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The names of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Pedro Roque Marques + * " + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef lint -static const char rcsid[] = "$Id: cbcp.c,v 1.9 1999/08/12 04:25:19 paulus Exp $"; -#endif +#define RCSID "$Id: cbcp.c,v 1.14 2002/12/04 23:03:32 paulus Exp $" #include #include @@ -32,14 +45,16 @@ static const char rcsid[] = "$Id: cbcp.c,v 1.9 1999/08/12 04:25:19 paulus Exp $" #include "fsm.h" #include "lcp.h" +static const char rcsid[] = RCSID; + /* * Options. */ static int setcbcp __P((char **)); static option_t cbcp_option_list[] = { - { "callback", o_special, setcbcp, - "Ask for callback" }, + { "callback", o_special, (void *)setcbcp, + "Ask for callback", OPT_PRIO | OPT_A2STRVAL, &cbcp[0].us_number }, { NULL } }; @@ -79,11 +94,11 @@ cbcp_state cbcp[NUM_PPP]; /* internal prototypes */ -static void cbcp_recvreq __P((cbcp_state *us, char *pckt, int len)); +static void cbcp_recvreq __P((cbcp_state *us, u_char *pckt, int len)); static void cbcp_resp __P((cbcp_state *us)); static void cbcp_up __P((cbcp_state *us)); -static void cbcp_recvack __P((cbcp_state *us, char *pckt, int len)); -static void cbcp_send __P((cbcp_state *us, u_char code, u_char *buf, int len)); +static void cbcp_recvack __P((cbcp_state *us, u_char *pckt, int len)); +static void cbcp_send __P((cbcp_state *us, int code, u_char *buf, int len)); /* option processing */ static int @@ -269,8 +284,8 @@ cbcp_printpkt(p, plen, printer, arg) printer(arg, " number = %s", str); } printer(arg, ">"); - break; } + break; default: break; @@ -288,7 +303,7 @@ cbcp_printpkt(p, plen, printer, arg) static void cbcp_recvreq(us, pckt, pcktlen) cbcp_state *us; - char *pckt; + u_char *pckt; int pcktlen; { u_char type, opt_len, delay, addr_type; @@ -383,7 +398,7 @@ cbcp_resp(us) PUTCHAR(len , bufp); PUTCHAR(0, bufp); cbcp_send(us, CBCP_RESP, buf, len); - start_networks(); + start_networks(us->us_unit); return; } } @@ -391,7 +406,7 @@ cbcp_resp(us) static void cbcp_send(us, code, buf, len) cbcp_state *us; - u_char code; + int code; u_char *buf; int len; { @@ -417,7 +432,7 @@ cbcp_send(us, code, buf, len) static void cbcp_recvack(us, pckt, len) cbcp_state *us; - char *pckt; + u_char *pckt; int len; { u_char type, delay, addr_type;