*/
#ifndef lint
-static char rcsid[] = "$Id: ipcp.c,v 1.4 1994/04/11 07:19:06 paulus Exp $";
+static char rcsid[] = "$Id: ipcp.c,v 1.10 1994/09/01 00:22:38 paulus Exp $";
#endif
/*
*/
#include <stdio.h>
+#include <string.h>
#include <syslog.h>
-#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
-#include <sys/time.h>
-
-#include <net/if.h>
-#include <net/if_ppp.h>
-#include <net/route.h>
-#include <netinet/in.h>
-
-#include <string.h>
#include "pppd.h"
#include "ppp.h"
ipcp_options ipcp_allowoptions[NPPP]; /* Options we allow peer to request */
ipcp_options ipcp_hisoptions[NPPP]; /* Options that we ack'd */
-extern char ifname[];
-extern char devname[];
-extern int baud_rate;
-
/* local vars */
static int cis_received[NPPP]; /* # Conf-Reqs received */
*/
char *
ip_ntoa(ipaddr)
-u_long ipaddr;
+uint32 ipaddr;
{
static char b[64];
if (neg) { \
int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \
if (len >= addrlen) { \
- u_long l; \
+ uint32 l; \
PUTCHAR(opt, ucp); \
PUTCHAR(addrlen, ucp); \
l = ntohl(val1); \
{
ipcp_options *go = &ipcp_gotoptions[f->unit];
u_short cilen, citype, cishort;
- u_long cilong;
+ uint32 cilong;
u_char cimaxslotindex, cicflag;
/*
#define ACKCIADDR(opt, neg, old, val1, val2) \
if (neg) { \
int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \
- u_long l; \
+ uint32 l; \
if ((len -= addrlen) < 0) \
goto bad; \
GETCHAR(citype, p); \
u_char cimaxslotindex, cicflag;
u_char citype, cilen, *next;
u_short cishort;
- u_long ciaddr1, ciaddr2, l;
+ uint32 ciaddr1, ciaddr2, l;
ipcp_options no; /* options we've seen Naks for */
ipcp_options try; /* options to request next time */
len -= cilen; \
INCPTR(2, p); \
GETSHORT(cishort, p); \
- if (cilen == CILEN_VJ) { \
- GETCHAR(cimaxslotindex, p); \
- GETCHAR(cicflag, p); \
- } \
no.neg = 1; \
code \
}
*/
NAKCIVJ(CI_COMPRESSTYPE, neg_vj,
if (cilen == CILEN_VJ) {
+ GETCHAR(cimaxslotindex, p);
+ GETCHAR(cicflag, p);
if (cishort == IPCP_VJ_COMP) {
try.old_vj = 0;
if (cimaxslotindex < go->maxslotindex)
ipcp_options *go = &ipcp_gotoptions[f->unit];
u_char cimaxslotindex, ciflag, cilen;
u_short cishort;
- u_long cilong;
+ uint32 cilong;
ipcp_options try; /* options to request next time */
try = *go;
len >= (cilen = old? CILEN_ADDRS: CILEN_ADDR) && \
p[1] == cilen && \
p[0] == opt) { \
- u_long l; \
+ uint32 l; \
len -= cilen; \
INCPTR(2, p); \
GETLONG(l, p); \
u_char *cip, *next; /* Pointer to current and next CIs */
u_short cilen, citype; /* Parsed len, type */
u_short cishort; /* Parsed short value */
- u_long tl, ciaddr1, ciaddr2;/* Parsed address values */
+ uint32 tl, ciaddr1, ciaddr2;/* Parsed address values */
int rc = CONFACK; /* Final packet return code */
int orc; /* Individual option return code */
u_char *p; /* Pointer to next char to parse */
ipcp_up(f)
fsm *f;
{
- u_long mask;
+ uint32 mask;
ipcp_options *ho = &ipcp_hisoptions[f->unit];
ipcp_options *go = &ipcp_gotoptions[f->unit];
ipcp_down(f)
fsm *f;
{
- u_long ouraddr, hisaddr;
+ uint32 ouraddr, hisaddr;
IPCPDEBUG((LOG_INFO, "ipcp: down"));
argv[0] = script;
argv[1] = ifname;
- argv[2] = devname;
+ argv[2] = devnam;
argv[3] = strspeed;
argv[4] = strlocal;
argv[5] = strremote;
int code, id, len, olen;
u_char *pstart, *optend;
u_short cishort;
- u_long cilong;
+ uint32 cilong;
if (plen < HEADERLEN)
return 0;
if (olen == CILEN_ADDRS) {
p += 2;
GETLONG(cilong, p);
- printer(arg, "addrs %s", ip_ntoa(cilong));
+ printer(arg, "addrs %s", ip_ntoa(htonl(cilong)));
GETLONG(cilong, p);
- printer(arg, " %s", ip_ntoa(cilong));
+ printer(arg, " %s", ip_ntoa(htonl(cilong)));
}
break;
case CI_COMPRESSTYPE:
if (olen == CILEN_ADDR) {
p += 2;
GETLONG(cilong, p);
- printer(arg, "addr %s", ip_ntoa(cilong));
+ printer(arg, "addr %s", ip_ntoa(htonl(cilong)));
}
break;
}