mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-18 22:21:06 +00:00
replaced u_int{8,16,32}_t to lwIP u{8,16,32}_t types
added padding to compiler generated bitfield, this is seen as best practice, maybe it helps buggy compilers
This commit is contained in:
parent
2e069429c2
commit
90faecd86e
@ -189,7 +189,7 @@ int (*chap_passwd_hook) (char *user, char *passwd) = NULL;
|
||||
int (*null_auth_hook) (struct wordlist **paddrs,
|
||||
struct wordlist **popts) = NULL;
|
||||
|
||||
int (*allowed_address_hook) (u_int32_t addr) = NULL;
|
||||
int (*allowed_address_hook) (u32_t addr) = NULL;
|
||||
#endif /* UNUSED */
|
||||
|
||||
#ifdef HAVE_MULTILINK
|
||||
@ -250,7 +250,7 @@ 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 ip_addr_check (u32_t, struct permitted_ip *);
|
||||
static int scan_authfile (FILE *, char *, char *, char *,
|
||||
struct wordlist **, struct wordlist **,
|
||||
char *, int);
|
||||
@ -2078,9 +2078,9 @@ set_allowed_addrs(unit, addrs, opts)
|
||||
char *ptr_word, *ptr_mask;
|
||||
struct hostent *hp;
|
||||
struct netent *np;
|
||||
u_int32_t a, mask, ah, offset;
|
||||
u32_t a, mask, ah, offset;
|
||||
struct ipcp_options *wo = &ipcp_wantoptions[unit];
|
||||
u_int32_t suggested_ip = 0;
|
||||
u32_t suggested_ip = 0;
|
||||
|
||||
if (addresses[unit] != NULL)
|
||||
free(addresses[unit]);
|
||||
@ -2123,7 +2123,7 @@ set_allowed_addrs(unit, addrs, opts)
|
||||
++ptr_word;
|
||||
}
|
||||
|
||||
mask = ~ (u_int32_t) 0;
|
||||
mask = ~ (u32_t) 0;
|
||||
offset = 0;
|
||||
ptr_mask = strchr (ptr_word, '/');
|
||||
if (ptr_mask != NULL) {
|
||||
@ -2151,11 +2151,11 @@ set_allowed_addrs(unit, addrs, opts)
|
||||
|
||||
hp = gethostbyname(ptr_word);
|
||||
if (hp != NULL && hp->h_addrtype == AF_INET) {
|
||||
a = *(u_int32_t *)hp->h_addr;
|
||||
a = *(u32_t *)hp->h_addr;
|
||||
} else {
|
||||
np = getnetbyname (ptr_word);
|
||||
if (np != NULL && np->n_addrtype == AF_INET) {
|
||||
a = htonl ((u_int32_t)np->n_net);
|
||||
a = htonl ((u32_t)np->n_net);
|
||||
if (ptr_mask == NULL) {
|
||||
/* calculate appropriate mask for net */
|
||||
ah = ntohl(a);
|
||||
@ -2174,7 +2174,7 @@ set_allowed_addrs(unit, addrs, opts)
|
||||
if (ptr_mask != NULL)
|
||||
*ptr_mask = '/';
|
||||
|
||||
if (a == (u_int32_t)-1L) {
|
||||
if (a == (u32_t)-1L) {
|
||||
warn("unknown host %s in auth. address list", ap->word);
|
||||
continue;
|
||||
}
|
||||
@ -2185,7 +2185,7 @@ set_allowed_addrs(unit, addrs, opts)
|
||||
continue;
|
||||
}
|
||||
a = htonl((ntohl(a) & mask) + offset);
|
||||
mask = ~(u_int32_t)0;
|
||||
mask = ~(u32_t)0;
|
||||
}
|
||||
ip[n].mask = htonl(mask);
|
||||
ip[n].base = a & ip[n].mask;
|
||||
@ -2225,7 +2225,7 @@ set_allowed_addrs(unit, addrs, opts)
|
||||
int
|
||||
auth_ip_addr(unit, addr)
|
||||
int unit;
|
||||
u_int32_t addr;
|
||||
u32_t addr;
|
||||
{
|
||||
int ok;
|
||||
|
||||
@ -2251,7 +2251,7 @@ auth_ip_addr(unit, addr)
|
||||
|
||||
static int
|
||||
ip_addr_check(addr, addrs)
|
||||
u_int32_t addr;
|
||||
u32_t addr;
|
||||
struct permitted_ip *addrs;
|
||||
{
|
||||
for (; ; ++addrs)
|
||||
@ -2266,7 +2266,7 @@ ip_addr_check(addr, addrs)
|
||||
*/
|
||||
int
|
||||
bad_ip_adrs(addr)
|
||||
u_int32_t addr;
|
||||
u32_t addr;
|
||||
{
|
||||
addr = ntohl(addr);
|
||||
return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET
|
||||
|
@ -99,8 +99,8 @@ demand_conf()
|
||||
fcs = PPP_INITFCS;
|
||||
|
||||
netif_set_mtu(pcb, LWIP_MIN(lcp_allowoptions[0].mru, PPP_MRU));
|
||||
if (ppp_send_config(pcb, PPP_MRU, (u_int32_t) 0, 0, 0) < 0
|
||||
|| ppp_recv_config(pcb, PPP_MRU, (u_int32_t) 0, 0, 0) < 0)
|
||||
if (ppp_send_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0
|
||||
|| ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0)
|
||||
fatal("Couldn't set up demand-dialled PPP interface: %m");
|
||||
|
||||
#ifdef PPP_FILTER
|
||||
@ -317,7 +317,7 @@ loop_frame(frame, len)
|
||||
void
|
||||
demand_rexmit(proto, newip)
|
||||
int proto;
|
||||
u_int32_t newip;
|
||||
u32_t newip;
|
||||
{
|
||||
struct packet *pkt, *prev, *nextpkt;
|
||||
unsigned short checksum;
|
||||
@ -375,7 +375,7 @@ demand_rexmit(proto, newip)
|
||||
pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
|
||||
|
||||
/* Change Source-IP-Address */
|
||||
* ((u_int32_t *) (pkt->data + 16)) = newip;
|
||||
* ((u32_t *) (pkt->data + 16)) = newip;
|
||||
|
||||
/* Add new Source-IP-Address */
|
||||
checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
|
||||
|
@ -348,7 +348,7 @@ static char base64[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
struct b64state {
|
||||
u_int32_t bs_bits;
|
||||
u32_t bs_bits;
|
||||
int bs_offs;
|
||||
};
|
||||
|
||||
@ -1158,7 +1158,7 @@ static void
|
||||
eap_srpval_response(esp, id, flags, str)
|
||||
eap_state *esp;
|
||||
u_char id;
|
||||
u_int32_t flags;
|
||||
u32_t flags;
|
||||
u_char *str;
|
||||
{
|
||||
ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit];
|
||||
@ -1166,7 +1166,7 @@ u_char *str;
|
||||
u_char *outp;
|
||||
int msglen;
|
||||
|
||||
msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u_int32_t) +
|
||||
msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) +
|
||||
SHA_DIGESTSIZE;
|
||||
p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PBUF_RAM);
|
||||
if(NULL == p)
|
||||
@ -1659,9 +1659,9 @@ static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
||||
pcb->eap.es_client.ea_id, id);
|
||||
}
|
||||
} else {
|
||||
len -= sizeof (u_int32_t) + SHA_DIGESTSIZE;
|
||||
len -= sizeof (u32_t) + SHA_DIGESTSIZE;
|
||||
if (len < 0 || t_clientverify(tc, inp +
|
||||
sizeof (u_int32_t)) != 0) {
|
||||
sizeof (u32_t)) != 0) {
|
||||
error("EAP: SRP server verification "
|
||||
"failed");
|
||||
goto client_failure;
|
||||
@ -1939,9 +1939,9 @@ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
||||
eap_figure_next_state(esp, 1);
|
||||
break;
|
||||
}
|
||||
if (len < sizeof (u_int32_t) + SHA_DIGESTSIZE) {
|
||||
if (len < sizeof (u32_t) + SHA_DIGESTSIZE) {
|
||||
error("EAP: M1 length %d < %d", len,
|
||||
sizeof (u_int32_t) + SHA_DIGESTSIZE);
|
||||
sizeof (u32_t) + SHA_DIGESTSIZE);
|
||||
eap_figure_next_state(esp, 1);
|
||||
break;
|
||||
}
|
||||
@ -2144,7 +2144,7 @@ static char *eap_typenames[] = {
|
||||
static int eap_printpkt(u_char *inp, int inlen, void (*printer) (void *, char *, ...), void *arg) {
|
||||
int code, id, len, rtype, vallen;
|
||||
u_char *pstart;
|
||||
u_int32_t uval;
|
||||
u32_t uval;
|
||||
|
||||
if (inlen < EAP_HEADERLEN)
|
||||
return (0);
|
||||
@ -2265,10 +2265,10 @@ static int eap_printpkt(u_char *inp, int inlen, void (*printer) (void *, char *,
|
||||
break;
|
||||
|
||||
case EAPSRP_SVALIDATOR:
|
||||
if (len < sizeof (u_int32_t))
|
||||
if (len < sizeof (u32_t))
|
||||
break;
|
||||
GETLONG(uval, inp);
|
||||
len -= sizeof (u_int32_t);
|
||||
len -= sizeof (u32_t);
|
||||
if (uval & SRPVAL_EBIT) {
|
||||
printer(arg, " E");
|
||||
uval &= ~SRPVAL_EBIT;
|
||||
@ -2371,10 +2371,10 @@ static int eap_printpkt(u_char *inp, int inlen, void (*printer) (void *, char *,
|
||||
break;
|
||||
|
||||
case EAPSRP_CVALIDATOR:
|
||||
if (len < sizeof (u_int32_t))
|
||||
if (len < sizeof (u32_t))
|
||||
break;
|
||||
GETLONG(uval, inp);
|
||||
len -= sizeof (u_int32_t);
|
||||
len -= sizeof (u32_t);
|
||||
if (uval & SRPVAL_EBIT) {
|
||||
printer(arg, " E");
|
||||
uval &= ~SRPVAL_EBIT;
|
||||
|
@ -126,7 +126,7 @@ struct eap_auth {
|
||||
u_char ea_requests; /* Number of Requests sent/received */
|
||||
u_char ea_responses; /* Number of Responses */
|
||||
u_char ea_type; /* One of EAPT_* */
|
||||
u_int32_t ea_keyflags; /* SRP shared key usage flags */
|
||||
u32_t ea_keyflags; /* SRP shared key usage flags */
|
||||
};
|
||||
|
||||
#ifndef EAP_MAX_CHALLENGE_LENGTH
|
||||
|
@ -48,9 +48,9 @@
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
u_int8_t e8[8];
|
||||
u_int16_t e16[4];
|
||||
u_int32_t e32[2];
|
||||
u8_t e8[8];
|
||||
u16_t e16[4];
|
||||
u32_t e32[2];
|
||||
} eui64_t;
|
||||
|
||||
#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0)
|
||||
|
@ -66,7 +66,7 @@
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
/* global vars */
|
||||
u_int32_t netmask = 0; /* IP netmask to set on interface */
|
||||
u32_t netmask = 0; /* IP netmask to set on interface */
|
||||
#endif /* UNUSED */
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
@ -85,7 +85,7 @@ void (*ip_up_hook) (void) = NULL;
|
||||
void (*ip_down_hook) (void) = NULL;
|
||||
|
||||
/* Hook for a plugin to choose the remote IP address */
|
||||
void (*ip_choose_hook) (u_int32_t *) = NULL;
|
||||
void (*ip_choose_hook) (u32_t *) = NULL;
|
||||
#endif /* UNUSED */
|
||||
|
||||
#if PPP_NOTIFY
|
||||
@ -275,7 +275,7 @@ static int ip_demand_conf (int);
|
||||
static int ip_active_pkt (u_char *, int);
|
||||
#endif /* DEMAND_SUPPORT */
|
||||
#if 0 /* UNUSED */
|
||||
static void create_resolv (u_int32_t, u_int32_t);
|
||||
static void create_resolv (u32_t, u32_t);
|
||||
#endif /* UNUSED */
|
||||
|
||||
struct protent ipcp_protent = {
|
||||
@ -306,7 +306,7 @@ struct protent ipcp_protent = {
|
||||
#endif /* DEMAND_SUPPORT */
|
||||
};
|
||||
|
||||
static void ipcp_clear_addrs(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t hisaddr, u8_t replacedefaultroute);
|
||||
static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t replacedefaultroute);
|
||||
|
||||
/*
|
||||
* Lengths of configuration options.
|
||||
@ -327,7 +327,7 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t hisaddr,
|
||||
*/
|
||||
char *
|
||||
ip_ntoa(ipaddr)
|
||||
u_int32_t ipaddr;
|
||||
u32_t ipaddr;
|
||||
{
|
||||
static char b[64];
|
||||
|
||||
@ -372,17 +372,17 @@ static int
|
||||
setdnsaddr(argv)
|
||||
char **argv;
|
||||
{
|
||||
u_int32_t dns;
|
||||
u32_t dns;
|
||||
struct hostent *hp;
|
||||
|
||||
dns = inet_addr(*argv);
|
||||
if (dns == (u_int32_t) -1) {
|
||||
if (dns == (u32_t) -1) {
|
||||
if ((hp = gethostbyname(*argv)) == NULL) {
|
||||
option_error("invalid address parameter '%s' for ms-dns option",
|
||||
*argv);
|
||||
return 0;
|
||||
}
|
||||
dns = *(u_int32_t *)hp->h_addr;
|
||||
dns = *(u32_t *)hp->h_addr;
|
||||
}
|
||||
|
||||
/* We take the last 2 values given, the 2nd-last as the primary
|
||||
@ -408,17 +408,17 @@ static int
|
||||
setwinsaddr(argv)
|
||||
char **argv;
|
||||
{
|
||||
u_int32_t wins;
|
||||
u32_t wins;
|
||||
struct hostent *hp;
|
||||
|
||||
wins = inet_addr(*argv);
|
||||
if (wins == (u_int32_t) -1) {
|
||||
if (wins == (u32_t) -1) {
|
||||
if ((hp = gethostbyname(*argv)) == NULL) {
|
||||
option_error("invalid address parameter '%s' for ms-wins option",
|
||||
*argv);
|
||||
return 0;
|
||||
}
|
||||
wins = *(u_int32_t *)hp->h_addr;
|
||||
wins = *(u32_t *)hp->h_addr;
|
||||
}
|
||||
|
||||
/* We take the last 2 values given, the 2nd-last as the primary
|
||||
@ -449,7 +449,7 @@ setipaddr(arg, argv, doit)
|
||||
{
|
||||
struct hostent *hp;
|
||||
char *colon;
|
||||
u_int32_t local, remote;
|
||||
u32_t local, remote;
|
||||
ipcp_options *wo = &ipcp_wantoptions[0];
|
||||
static int prio_local = 0, prio_remote = 0;
|
||||
|
||||
@ -466,12 +466,12 @@ setipaddr(arg, argv, doit)
|
||||
*/
|
||||
if (colon != arg && option_priority >= prio_local) {
|
||||
*colon = '\0';
|
||||
if ((local = inet_addr(arg)) == (u_int32_t) -1) {
|
||||
if ((local = inet_addr(arg)) == (u32_t) -1) {
|
||||
if ((hp = gethostbyname(arg)) == NULL) {
|
||||
option_error("unknown host: %s", arg);
|
||||
return 0;
|
||||
}
|
||||
local = *(u_int32_t *)hp->h_addr;
|
||||
local = *(u32_t *)hp->h_addr;
|
||||
}
|
||||
if (bad_ip_adrs(local)) {
|
||||
option_error("bad local IP address %s", ip_ntoa(local));
|
||||
@ -487,12 +487,12 @@ setipaddr(arg, argv, doit)
|
||||
* If colon last character, then no remote addr.
|
||||
*/
|
||||
if (*++colon != '\0' && option_priority >= prio_remote) {
|
||||
if ((remote = inet_addr(colon)) == (u_int32_t) -1) {
|
||||
if ((remote = inet_addr(colon)) == (u32_t) -1) {
|
||||
if ((hp = gethostbyname(colon)) == NULL) {
|
||||
option_error("unknown host: %s", colon);
|
||||
return 0;
|
||||
}
|
||||
remote = *(u_int32_t *)hp->h_addr;
|
||||
remote = *(u32_t *)hp->h_addr;
|
||||
if (remote_name[0] == 0)
|
||||
strlcpy(remote_name, colon, sizeof(remote_name));
|
||||
}
|
||||
@ -530,7 +530,7 @@ static int
|
||||
setnetmask(argv)
|
||||
char **argv;
|
||||
{
|
||||
u_int32_t mask;
|
||||
u32_t mask;
|
||||
int n;
|
||||
char *p;
|
||||
|
||||
@ -557,10 +557,10 @@ setnetmask(argv)
|
||||
int
|
||||
parse_dotted_ip(p, vp)
|
||||
char *p;
|
||||
u_int32_t *vp;
|
||||
u32_t *vp;
|
||||
{
|
||||
int n;
|
||||
u_int32_t v, b;
|
||||
u32_t v, b;
|
||||
char *endp, *p0 = p;
|
||||
|
||||
v = 0;
|
||||
@ -785,7 +785,7 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) {
|
||||
#define ADDCIADDRS(opt, neg, val1, val2) \
|
||||
if (neg) { \
|
||||
if (len >= CILEN_ADDRS) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
PUTCHAR(opt, ucp); \
|
||||
PUTCHAR(CILEN_ADDRS, ucp); \
|
||||
l = ntohl(val1); \
|
||||
@ -816,7 +816,7 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) {
|
||||
#define ADDCIADDR(opt, neg, val) \
|
||||
if (neg) { \
|
||||
if (len >= CILEN_ADDR) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
PUTCHAR(opt, ucp); \
|
||||
PUTCHAR(CILEN_ADDR, ucp); \
|
||||
l = ntohl(val); \
|
||||
@ -829,7 +829,7 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) {
|
||||
#define ADDCIDNS(opt, neg, addr) \
|
||||
if (neg) { \
|
||||
if (len >= CILEN_ADDR) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
PUTCHAR(opt, ucp); \
|
||||
PUTCHAR(CILEN_ADDR, ucp); \
|
||||
l = ntohl(addr); \
|
||||
@ -842,7 +842,7 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) {
|
||||
#define ADDCIWINS(opt, addr) \
|
||||
if (addr) { \
|
||||
if (len >= CILEN_ADDR) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
PUTCHAR(opt, ucp); \
|
||||
PUTCHAR(CILEN_ADDR, ucp); \
|
||||
l = ntohl(addr); \
|
||||
@ -884,7 +884,7 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) {
|
||||
ppp_pcb *pcb = f->pcb;
|
||||
ipcp_options *go = &pcb->ipcp_gotoptions;
|
||||
u_short cilen, citype, cishort;
|
||||
u_int32_t cilong;
|
||||
u32_t cilong;
|
||||
u_char cimaxslotindex, cicflag;
|
||||
|
||||
/*
|
||||
@ -895,7 +895,7 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) {
|
||||
|
||||
#define ACKCIADDRS(opt, neg, val1, val2) \
|
||||
if (neg) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
if ((len -= CILEN_ADDRS) < 0) \
|
||||
goto bad; \
|
||||
GETCHAR(citype, p); \
|
||||
@ -938,7 +938,7 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) {
|
||||
|
||||
#define ACKCIADDR(opt, neg, val) \
|
||||
if (neg) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
if ((len -= CILEN_ADDR) < 0) \
|
||||
goto bad; \
|
||||
GETCHAR(citype, p); \
|
||||
@ -954,7 +954,7 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) {
|
||||
|
||||
#define ACKCIDNS(opt, neg, addr) \
|
||||
if (neg) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
if ((len -= CILEN_ADDR) < 0) \
|
||||
goto bad; \
|
||||
GETCHAR(citype, p); \
|
||||
@ -1007,7 +1007,7 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) {
|
||||
u_char cimaxslotindex, cicflag;
|
||||
u_char citype, cilen, *next;
|
||||
u_short cishort;
|
||||
u_int32_t ciaddr1, ciaddr2, l, cidnsaddr;
|
||||
u32_t ciaddr1, ciaddr2, l, cidnsaddr;
|
||||
ipcp_options no; /* options we've seen Naks for */
|
||||
ipcp_options try; /* options to request next time */
|
||||
|
||||
@ -1250,7 +1250,7 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) {
|
||||
ipcp_options *go = &pcb->ipcp_gotoptions;
|
||||
u_char cimaxslotindex, ciflag, cilen;
|
||||
u_short cishort;
|
||||
u_int32_t cilong;
|
||||
u32_t cilong;
|
||||
ipcp_options try; /* options to request next time */
|
||||
|
||||
try = *go;
|
||||
@ -1264,7 +1264,7 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) {
|
||||
(cilen = p[1]) == CILEN_ADDRS && \
|
||||
len >= cilen && \
|
||||
p[0] == opt) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
len -= cilen; \
|
||||
INCPTR(2, p); \
|
||||
GETLONG(l, p); \
|
||||
@ -1307,7 +1307,7 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) {
|
||||
(cilen = p[1]) == CILEN_ADDR && \
|
||||
len >= cilen && \
|
||||
p[0] == opt) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
len -= cilen; \
|
||||
INCPTR(2, p); \
|
||||
GETLONG(l, p); \
|
||||
@ -1323,7 +1323,7 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) {
|
||||
((cilen = p[1]) == CILEN_ADDR) && \
|
||||
len >= cilen && \
|
||||
p[0] == opt) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
len -= cilen; \
|
||||
INCPTR(2, p); \
|
||||
GETLONG(l, p); \
|
||||
@ -1339,7 +1339,7 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) {
|
||||
((cilen = p[1]) == CILEN_ADDR) && \
|
||||
len >= cilen && \
|
||||
p[0] == opt) { \
|
||||
u_int32_t l; \
|
||||
u32_t l; \
|
||||
len -= cilen; \
|
||||
INCPTR(2, p); \
|
||||
GETLONG(l, p); \
|
||||
@ -1403,7 +1403,7 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) {
|
||||
u_char *cip, *next; /* Pointer to current and next CIs */
|
||||
u_short cilen, citype; /* Parsed len, type */
|
||||
u_short cishort; /* Parsed short value */
|
||||
u_int32_t tl, ciaddr1, ciaddr2;/* Parsed address values */
|
||||
u32_t 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 */
|
||||
@ -1458,7 +1458,7 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) {
|
||||
&& (ciaddr1 == 0 || !wo->accept_remote)) {
|
||||
orc = CONFNAK;
|
||||
if (!reject_if_disagree) {
|
||||
DECPTR(sizeof(u_int32_t), p);
|
||||
DECPTR(sizeof(u32_t), p);
|
||||
tl = ntohl(wo->hisaddr);
|
||||
PUTLONG(tl, p);
|
||||
}
|
||||
@ -1481,7 +1481,7 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) {
|
||||
if (ciaddr2 == 0 || !wo->accept_local) {
|
||||
orc = CONFNAK;
|
||||
if (!reject_if_disagree) {
|
||||
DECPTR(sizeof(u_int32_t), p);
|
||||
DECPTR(sizeof(u32_t), p);
|
||||
tl = ntohl(wo->ouraddr);
|
||||
PUTLONG(tl, p);
|
||||
}
|
||||
@ -1514,7 +1514,7 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) {
|
||||
&& (ciaddr1 == 0 || !wo->accept_remote)) {
|
||||
orc = CONFNAK;
|
||||
if (!reject_if_disagree) {
|
||||
DECPTR(sizeof(u_int32_t), p);
|
||||
DECPTR(sizeof(u32_t), p);
|
||||
tl = ntohl(wo->hisaddr);
|
||||
PUTLONG(tl, p);
|
||||
}
|
||||
@ -1544,7 +1544,7 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) {
|
||||
}
|
||||
GETLONG(tl, p);
|
||||
if (htonl(tl) != ao->dnsaddr[d]) {
|
||||
DECPTR(sizeof(u_int32_t), p);
|
||||
DECPTR(sizeof(u32_t), p);
|
||||
tl = ntohl(ao->dnsaddr[d]);
|
||||
PUTLONG(tl, p);
|
||||
orc = CONFNAK;
|
||||
@ -1564,7 +1564,7 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) {
|
||||
}
|
||||
GETLONG(tl, p);
|
||||
if (htonl(tl) != ao->winsaddr[d]) {
|
||||
DECPTR(sizeof(u_int32_t), p);
|
||||
DECPTR(sizeof(u32_t), p);
|
||||
tl = ntohl(ao->winsaddr[d]);
|
||||
PUTLONG(tl, p);
|
||||
orc = CONFNAK;
|
||||
@ -1684,7 +1684,7 @@ static void
|
||||
ip_check_options()
|
||||
{
|
||||
struct hostent *hp;
|
||||
u_int32_t local;
|
||||
u32_t local;
|
||||
ipcp_options *wo = &ipcp_wantoptions[0];
|
||||
|
||||
/*
|
||||
@ -1699,7 +1699,7 @@ ip_check_options()
|
||||
*/
|
||||
wo->accept_local = 1; /* don't insist on this default value */
|
||||
if ((hp = gethostbyname(hostname)) != NULL) {
|
||||
local = *(u_int32_t *)hp->h_addr;
|
||||
local = *(u32_t *)hp->h_addr;
|
||||
if (local != 0 && !bad_ip_adrs(local))
|
||||
wo->ouraddr = local;
|
||||
}
|
||||
@ -1760,7 +1760,7 @@ ip_demand_conf(u)
|
||||
*/
|
||||
static void ipcp_up(fsm *f) {
|
||||
ppp_pcb *pcb = f->pcb;
|
||||
u_int32_t mask;
|
||||
u32_t mask;
|
||||
ipcp_options *ho = &pcb->ipcp_hisoptions;
|
||||
ipcp_options *go = &pcb->ipcp_gotoptions;
|
||||
ipcp_options *wo = &pcb->ipcp_wantoptions;
|
||||
@ -2014,7 +2014,7 @@ static void ipcp_down(fsm *f) {
|
||||
* ipcp_clear_addrs() - clear the interface addresses, routes,
|
||||
* proxy arp entries, etc.
|
||||
*/
|
||||
static void ipcp_clear_addrs(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t hisaddr, u8_t replacedefaultroute) {
|
||||
static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t replacedefaultroute) {
|
||||
|
||||
if (pcb->proxy_arp_set) {
|
||||
cifproxyarp(pcb, hisaddr);
|
||||
@ -2054,7 +2054,7 @@ static void ipcp_finished(fsm *f) {
|
||||
*/
|
||||
static void
|
||||
create_resolv(peerdns1, peerdns2)
|
||||
u_int32_t peerdns1, peerdns2;
|
||||
u32_t peerdns1, peerdns2;
|
||||
{
|
||||
|
||||
}
|
||||
@ -2074,7 +2074,7 @@ static int ipcp_printpkt(u_char *p, int plen,
|
||||
int code, id, len, olen;
|
||||
u_char *pstart, *optend;
|
||||
u_short cishort;
|
||||
u_int32_t cilong;
|
||||
u32_t cilong;
|
||||
|
||||
if (plen < HEADERLEN)
|
||||
return 0;
|
||||
|
@ -72,30 +72,31 @@
|
||||
/* compression option*/
|
||||
|
||||
typedef struct ipcp_options {
|
||||
u_int neg_addr :1; /* Negotiate IP Address? */
|
||||
u_int old_addrs :1; /* Use old (IP-Addresses) option? */
|
||||
u_int req_addr :1; /* Ask peer to send IP address? */
|
||||
u_int default_route :1; /* Assign default route through interface? */
|
||||
u_int replace_default_route :1; /* Replace default route through interface? */
|
||||
u_int proxy_arp :1; /* Make proxy ARP entry for peer? */
|
||||
u_int neg_vj :1; /* Van Jacobson Compression? */
|
||||
u_int old_vj :1; /* use old (short) form of VJ option? */
|
||||
u_int accept_local :1; /* accept peer's value for ouraddr */
|
||||
u_int accept_remote :1; /* accept peer's value for hisaddr */
|
||||
u_int req_dns1 :1; /* Ask peer to send primary DNS address? */
|
||||
u_int req_dns2 :1; /* Ask peer to send secondary DNS address? */
|
||||
u_int cflag :1;
|
||||
unsigned int neg_addr :1; /* Negotiate IP Address? */
|
||||
unsigned int old_addrs :1; /* Use old (IP-Addresses) option? */
|
||||
unsigned int req_addr :1; /* Ask peer to send IP address? */
|
||||
unsigned int default_route :1; /* Assign default route through interface? */
|
||||
unsigned int replace_default_route :1; /* Replace default route through interface? */
|
||||
unsigned int proxy_arp :1; /* Make proxy ARP entry for peer? */
|
||||
unsigned int neg_vj :1; /* Van Jacobson Compression? */
|
||||
unsigned int old_vj :1; /* use old (short) form of VJ option? */
|
||||
unsigned int accept_local :1; /* accept peer's value for ouraddr */
|
||||
unsigned int accept_remote :1; /* accept peer's value for hisaddr */
|
||||
unsigned int req_dns1 :1; /* Ask peer to send primary DNS address? */
|
||||
unsigned int req_dns2 :1; /* Ask peer to send secondary DNS address? */
|
||||
unsigned int cflag :1;
|
||||
unsigned int :3; /* 3 bits of padding to round out to 16 bits */
|
||||
|
||||
u_int32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
|
||||
u_int32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
|
||||
u_int32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
|
||||
u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
|
||||
u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
|
||||
u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
|
||||
|
||||
u16_t vj_protocol; /* protocol value to use in VJ option */
|
||||
u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */
|
||||
} ipcp_options;
|
||||
|
||||
#if 0 /* UNUSED, already defined by lwIP */
|
||||
char *ip_ntoa (u_int32_t);
|
||||
char *ip_ntoa (u32_t);
|
||||
#endif /* UNUSED, already defined by lwIP */
|
||||
|
||||
extern struct protent ipcp_protent;
|
||||
|
@ -156,16 +156,19 @@
|
||||
*#define IPV6CP_COMP 0x004f
|
||||
*/
|
||||
typedef struct ipv6cp_options {
|
||||
u_int neg_ifaceid :1; /* Negotiate interface identifier? */
|
||||
u_int req_ifaceid :1; /* Ask peer to send interface identifier? */
|
||||
u_int accept_local :1; /* accept peer's value for iface id? */
|
||||
u_int opt_local :1; /* ourtoken set by option */
|
||||
u_int opt_remote :1; /* histoken set by option */
|
||||
u_int use_ip :1; /* use IP as interface identifier */
|
||||
unsigned int neg_ifaceid :1; /* Negotiate interface identifier? */
|
||||
unsigned int req_ifaceid :1; /* Ask peer to send interface identifier? */
|
||||
unsigned int accept_local :1; /* accept peer's value for iface id? */
|
||||
unsigned int opt_local :1; /* ourtoken set by option */
|
||||
unsigned int opt_remote :1; /* histoken set by option */
|
||||
unsigned int use_ip :1; /* use IP as interface identifier */
|
||||
#if 0
|
||||
#if defined(SOL2) || defined(__linux__)
|
||||
u_int use_persistent :1; /* use uniquely persistent value for address */
|
||||
unsigned int use_persistent :1; /* use uniquely persistent value for address */
|
||||
#endif /* defined(SOL2) */
|
||||
u_int neg_vj :1; /* Van Jacobson Compression? */
|
||||
#endif
|
||||
unsigned int neg_vj :1; /* Van Jacobson Compression? */
|
||||
unsigned int :1; /* 1 bit of padding to round out to 8 bits */
|
||||
u_short vj_protocol; /* protocol value to use in VJ option */
|
||||
eui64_t ourid, hisid; /* Interface identifiers */
|
||||
} ipv6cp_options;
|
||||
|
@ -889,7 +889,7 @@ static int lcp_ackci(fsm *f, u_char *p, int len) {
|
||||
lcp_options *go = &pcb->lcp_gotoptions;
|
||||
u_char cilen, citype, cichar;
|
||||
u_short cishort;
|
||||
u_int32_t cilong;
|
||||
u32_t cilong;
|
||||
|
||||
/*
|
||||
* CIs must be in exactly the same order that we sent.
|
||||
@ -1070,7 +1070,7 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) {
|
||||
lcp_options *wo = &pcb->lcp_wantoptions;
|
||||
u_char citype, cichar, *next;
|
||||
u_short cishort;
|
||||
u_int32_t cilong;
|
||||
u32_t cilong;
|
||||
lcp_options no; /* options we've seen Naks for */
|
||||
lcp_options try; /* options to request next time */
|
||||
int looped_back = 0;
|
||||
@ -1527,7 +1527,7 @@ static int lcp_rejci(fsm *f, u_char *p, int len) {
|
||||
lcp_options *go = &pcb->lcp_gotoptions;
|
||||
u_char cichar;
|
||||
u_short cishort;
|
||||
u_int32_t cilong;
|
||||
u32_t cilong;
|
||||
lcp_options try; /* options to request next time */
|
||||
|
||||
try = *go;
|
||||
@ -1761,7 +1761,7 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) {
|
||||
u_char *cip, *next; /* Pointer to current and next CIs */
|
||||
int cilen, citype, cichar; /* Parsed len, type, char value */
|
||||
u_short cishort; /* Parsed short value */
|
||||
u_int32_t cilong; /* Parse long value */
|
||||
u32_t cilong; /* Parse long value */
|
||||
int rc = CONFACK; /* Final packet return code */
|
||||
int orc; /* Individual option return code */
|
||||
u_char *p; /* Pointer to next char to parse */
|
||||
@ -2315,7 +2315,7 @@ static int lcp_printpkt(u_char *p, int plen,
|
||||
int code, id, len, olen, i;
|
||||
u_char *pstart, *optend;
|
||||
u_short cishort;
|
||||
u_int32_t cilong;
|
||||
u32_t cilong;
|
||||
|
||||
if (plen < HEADERLEN)
|
||||
return 0;
|
||||
@ -2610,7 +2610,7 @@ static void LcpEchoTimeout(void *arg) {
|
||||
static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) {
|
||||
ppp_pcb *pcb = f->pcb;
|
||||
lcp_options *go = &pcb->lcp_gotoptions;
|
||||
u_int32_t magic;
|
||||
u32_t magic;
|
||||
|
||||
/* Check the magic number - don't count replies from ourselves. */
|
||||
if (len < 4) {
|
||||
@ -2635,7 +2635,7 @@ static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) {
|
||||
static void LcpSendEchoRequest(fsm *f) {
|
||||
ppp_pcb *pcb = f->pcb;
|
||||
lcp_options *go = &pcb->lcp_gotoptions;
|
||||
u_int32_t lcp_magic;
|
||||
u32_t lcp_magic;
|
||||
u_char pkt[4], *pktp;
|
||||
|
||||
/*
|
||||
|
@ -106,32 +106,42 @@ struct epdisc {
|
||||
* The state of options is described by an lcp_options structure.
|
||||
*/
|
||||
typedef struct lcp_options {
|
||||
u_int passive :1; /* Don't die if we don't get a response */
|
||||
u_int silent :1; /* Wait for the other end to start first */
|
||||
u_int restart :1; /* Restart vs. exit after close */
|
||||
u_int neg_mru :1; /* Negotiate the MRU? */
|
||||
u_int neg_asyncmap :1; /* Negotiate the async map? */
|
||||
unsigned int passive :1; /* Don't die if we don't get a response */
|
||||
unsigned int silent :1; /* Wait for the other end to start first */
|
||||
unsigned int restart :1; /* Restart vs. exit after close */
|
||||
unsigned int neg_mru :1; /* Negotiate the MRU? */
|
||||
unsigned int neg_asyncmap :1; /* Negotiate the async map? */
|
||||
#if PAP_SUPPORT
|
||||
u_int neg_upap :1; /* Ask for UPAP authentication? */
|
||||
unsigned int neg_upap :1; /* Ask for UPAP authentication? */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* PAP_SUPPORT */
|
||||
#if CHAP_SUPPORT
|
||||
u_int neg_chap :1; /* Ask for CHAP authentication? */
|
||||
unsigned int neg_chap :1; /* Ask for CHAP authentication? */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* CHAP_SUPPORT */
|
||||
#if EAP_SUPPORT
|
||||
u_int neg_eap :1; /* Ask for EAP authentication? */
|
||||
unsigned int neg_eap :1; /* Ask for EAP authentication? */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* EAP_SUPPORT */
|
||||
u_int neg_magicnumber :1; /* Ask for magic number? */
|
||||
u_int neg_pcompression :1; /* HDLC Protocol Field Compression? */
|
||||
u_int neg_accompression :1; /* HDLC Address/Control Field Compression? */
|
||||
unsigned int neg_magicnumber :1; /* Ask for magic number? */
|
||||
unsigned int neg_pcompression :1; /* HDLC Protocol Field Compression? */
|
||||
unsigned int neg_accompression :1; /* HDLC Address/Control Field Compression? */
|
||||
#if LQR_SUPPORT
|
||||
u_int neg_lqr :1; /* Negotiate use of Link Quality Reports */
|
||||
unsigned int neg_lqr :1; /* Negotiate use of Link Quality Reports */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* LQR_SUPPORT */
|
||||
u_int neg_cbcp :1; /* Negotiate use of CBCP */
|
||||
unsigned int neg_cbcp :1; /* Negotiate use of CBCP */
|
||||
#ifdef HAVE_MULTILINK
|
||||
u_int neg_mrru :1; /* negotiate multilink MRRU */
|
||||
unsigned int neg_mrru :1; /* negotiate multilink MRRU */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* HAVE_MULTILINK */
|
||||
u_int neg_ssnhf :1; /* negotiate short sequence numbers */
|
||||
u_int neg_endpoint :1; /* negotiate endpoint discriminator */
|
||||
unsigned int neg_ssnhf :1; /* negotiate short sequence numbers */
|
||||
unsigned int neg_endpoint :1; /* negotiate endpoint discriminator */
|
||||
u16_t mru; /* Value of MRU */
|
||||
#ifdef HAVE_MULTILINK
|
||||
u16_t mrru; /* Value of MRRU, and multilink enable */
|
||||
@ -139,11 +149,11 @@ typedef struct lcp_options {
|
||||
#if CHAP_SUPPORT
|
||||
u8_t chap_mdtype; /* which MD types (hashing algorithm) */
|
||||
#endif /* CHAP_SUPPORT */
|
||||
u_int32_t asyncmap; /* Value of async map */
|
||||
u_int32_t magicnumber;
|
||||
u32_t asyncmap; /* Value of async map */
|
||||
u32_t magicnumber;
|
||||
u8_t numloops; /* Number of loops during magic number neg. */
|
||||
#if LQR_SUPPORT
|
||||
u_int32_t lqr_period; /* Reporting period for LQR 1/100ths second */
|
||||
u32_t lqr_period; /* Reporting period for LQR 1/100ths second */
|
||||
#endif /* LQR_SUPPORT */
|
||||
struct epdisc endpoint; /* endpoint discriminator */
|
||||
} lcp_options;
|
||||
|
@ -454,7 +454,7 @@ get_default_epdisc(ep)
|
||||
{
|
||||
char *p;
|
||||
struct hostent *hp;
|
||||
u_int32_t addr;
|
||||
u32_t addr;
|
||||
|
||||
/* First try for an ethernet MAC address */
|
||||
p = get_first_ethernet();
|
||||
@ -467,7 +467,7 @@ get_default_epdisc(ep)
|
||||
/* see if our hostname corresponds to a reasonable IP address */
|
||||
hp = gethostbyname(hostname);
|
||||
if (hp != NULL) {
|
||||
addr = *(u_int32_t *)hp->h_addr;
|
||||
addr = *(u32_t *)hp->h_addr;
|
||||
if (!bad_ip_adrs(addr)) {
|
||||
addr = ntohl(addr);
|
||||
if (!LOCAL_IP_ADDR(addr)) {
|
||||
@ -501,7 +501,7 @@ epdisc_to_str(ep)
|
||||
if (ep->class == EPD_NULL && ep->length == 0)
|
||||
return "null";
|
||||
if (ep->class == EPD_IP && ep->length == 4) {
|
||||
u_int32_t addr;
|
||||
u32_t addr;
|
||||
|
||||
GETLONG(addr, p);
|
||||
slprintf(str, sizeof(str), "IP:%I", htonl(addr));
|
||||
@ -572,7 +572,7 @@ str_to_epdisc(ep, str)
|
||||
++str;
|
||||
|
||||
if (i == EPD_IP) {
|
||||
u_int32_t addr;
|
||||
u32_t addr;
|
||||
i = parse_dotted_ip(str, &addr);
|
||||
if (i == 0 || str[i] != 0)
|
||||
return 0;
|
||||
|
@ -1786,7 +1786,7 @@ void new_phase(ppp_pcb *pcb, int p) {
|
||||
* ppp_send_config - configure the transmit-side characteristics of
|
||||
* the ppp interface.
|
||||
*/
|
||||
int ppp_send_config(ppp_pcb *pcb, int mtu, u_int32_t accm, int pcomp, int accomp) {
|
||||
int ppp_send_config(ppp_pcb *pcb, int mtu, u32_t accm, int pcomp, int accomp) {
|
||||
#if PPPOS_SUPPORT
|
||||
int i;
|
||||
#endif /* PPPOS_SUPPORT */
|
||||
@ -1818,7 +1818,7 @@ int ppp_send_config(ppp_pcb *pcb, int mtu, u_int32_t accm, int pcomp, int accomp
|
||||
* ppp_recv_config - configure the receive-side characteristics of
|
||||
* the ppp interface.
|
||||
*/
|
||||
int ppp_recv_config(ppp_pcb *pcb, int mru, u_int32_t accm, int pcomp, int accomp) {
|
||||
int ppp_recv_config(ppp_pcb *pcb, int mru, u32_t accm, int pcomp, int accomp) {
|
||||
#if PPPOS_SUPPORT
|
||||
int i;
|
||||
SYS_ARCH_DECL_PROTECT(lev);
|
||||
@ -1854,8 +1854,8 @@ int ppp_recv_config(ppp_pcb *pcb, int mru, u_int32_t accm, int pcomp, int accomp
|
||||
/*
|
||||
* sifaddr - Config the interface IP addresses and netmask.
|
||||
*/
|
||||
int sifaddr(ppp_pcb *pcb, u_int32_t our_adr, u_int32_t his_adr,
|
||||
u_int32_t net_mask) {
|
||||
int sifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr,
|
||||
u32_t net_mask) {
|
||||
|
||||
SMEMCPY(&pcb->addrs.our_ipaddr, &our_adr, sizeof(our_adr));
|
||||
SMEMCPY(&pcb->addrs.his_ipaddr, &his_adr, sizeof(his_adr));
|
||||
@ -1869,7 +1869,7 @@ int sifaddr(ppp_pcb *pcb, u_int32_t our_adr, u_int32_t his_adr,
|
||||
* cifaddr - Clear the interface IP addresses, and delete routes
|
||||
* through the interface if possible.
|
||||
*/
|
||||
int cifaddr(ppp_pcb *pcb, u_int32_t our_adr, u_int32_t his_adr) {
|
||||
int cifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr) {
|
||||
|
||||
LWIP_UNUSED_ARG(our_adr);
|
||||
LWIP_UNUSED_ARG(his_adr);
|
||||
@ -1918,7 +1918,7 @@ int cif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64) {
|
||||
/*
|
||||
* sdns - Config the DNS servers
|
||||
*/
|
||||
int sdns(ppp_pcb *pcb, u_int32_t ns1, u_int32_t ns2) {
|
||||
int sdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2) {
|
||||
|
||||
SMEMCPY(&pcb->addrs.dns1, &ns1, sizeof(ns1));
|
||||
SMEMCPY(&pcb->addrs.dns2, &ns2, sizeof(ns2));
|
||||
@ -1930,7 +1930,7 @@ int sdns(ppp_pcb *pcb, u_int32_t ns1, u_int32_t ns2) {
|
||||
*
|
||||
* cdns - Clear the DNS servers
|
||||
*/
|
||||
int cdns(ppp_pcb *pcb, u_int32_t ns1, u_int32_t ns2) {
|
||||
int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2) {
|
||||
|
||||
LWIP_UNUSED_ARG(ns1);
|
||||
LWIP_UNUSED_ARG(ns2);
|
||||
@ -2032,7 +2032,7 @@ int netif_get_mtu(ppp_pcb *pcb) {
|
||||
* and then changes the temporary addresses to the addresses for the real
|
||||
* ppp connection when it has come up.
|
||||
*/
|
||||
int sifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway, u8_t replace) {
|
||||
int sifdefaultroute(ppp_pcb *pcb, u32_t ouraddr, u32_t gateway, u8_t replace) {
|
||||
|
||||
LWIP_UNUSED_ARG(ouraddr);
|
||||
LWIP_UNUSED_ARG(gateway);
|
||||
@ -2046,7 +2046,7 @@ int sifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway, u8_t rep
|
||||
*
|
||||
* cifdefaultroute - delete a default route through the address given.
|
||||
*/
|
||||
int cifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway) {
|
||||
int cifdefaultroute(ppp_pcb *pcb, u32_t ouraddr, u32_t gateway) {
|
||||
|
||||
LWIP_UNUSED_ARG(ouraddr);
|
||||
LWIP_UNUSED_ARG(gateway);
|
||||
@ -2060,7 +2060,7 @@ int cifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway) {
|
||||
* sifproxyarp - Make a proxy ARP entry for the peer.
|
||||
*/
|
||||
|
||||
int sifproxyarp(ppp_pcb *pcb, u_int32_t his_adr) {
|
||||
int sifproxyarp(ppp_pcb *pcb, u32_t his_adr) {
|
||||
LWIP_UNUSED_ARG(pcb);
|
||||
LWIP_UNUSED_ARG(his_adr);
|
||||
/* FIXME: do we really need that in IPCP ? */
|
||||
@ -2072,7 +2072,7 @@ int sifproxyarp(ppp_pcb *pcb, u_int32_t his_adr) {
|
||||
* cifproxyarp - Delete the proxy ARP entry for the peer.
|
||||
*/
|
||||
|
||||
int cifproxyarp(ppp_pcb *pcb, u_int32_t his_adr) {
|
||||
int cifproxyarp(ppp_pcb *pcb, u32_t his_adr) {
|
||||
LWIP_UNUSED_ARG(pcb);
|
||||
LWIP_UNUSED_ARG(his_adr);
|
||||
/* FIXME: do we really need that in IPCP ? */
|
||||
@ -2134,7 +2134,7 @@ int get_loop_output(void) {
|
||||
* network as `addr'. If we find any, we OR in their netmask to the
|
||||
* user-specified netmask.
|
||||
*/
|
||||
u_int32_t get_mask(u_int32_t addr) {
|
||||
u32_t get_mask(u32_t addr) {
|
||||
#if 0
|
||||
u32_t mask, nmask;
|
||||
|
||||
|
@ -150,36 +150,52 @@ typedef struct ppp_pcb_s ppp_pcb;
|
||||
typedef struct ppp_settings_s {
|
||||
|
||||
#if PPP_SERVER
|
||||
u_int auth_required : 1; /* Peer is required to authenticate */
|
||||
unsigned int auth_required : 1; /* Peer is required to authenticate */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* PPP_SERVER */
|
||||
#if PPP_REMOTENAME
|
||||
u_int explicit_remote : 1; /* remote_name specified with remotename opt */
|
||||
unsigned int explicit_remote : 1; /* remote_name specified with remotename opt */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* PPP_REMOTENAME */
|
||||
#if PAP_SUPPORT
|
||||
u_int refuse_pap : 1; /* Don't wanna auth. ourselves with PAP */
|
||||
unsigned int refuse_pap : 1; /* Don't wanna auth. ourselves with PAP */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* PAP_SUPPORT */
|
||||
#if CHAP_SUPPORT
|
||||
u_int refuse_chap : 1; /* Don't wanna auth. ourselves with CHAP */
|
||||
unsigned int refuse_chap : 1; /* Don't wanna auth. ourselves with CHAP */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* CHAP_SUPPORT */
|
||||
#if MSCHAP_SUPPORT
|
||||
u_int refuse_mschap : 1; /* Don't wanna auth. ourselves with MS-CHAP */
|
||||
u_int refuse_mschap_v2 : 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */
|
||||
unsigned int refuse_mschap : 1; /* Don't wanna auth. ourselves with MS-CHAP */
|
||||
unsigned int refuse_mschap_v2 : 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */
|
||||
#else
|
||||
unsigned int :2; /* 2 bits of padding */
|
||||
#endif /* MSCHAP_SUPPORT */
|
||||
#if EAP_SUPPORT
|
||||
u_int refuse_eap : 1; /* Don't wanna auth. ourselves with EAP */
|
||||
unsigned int refuse_eap : 1; /* Don't wanna auth. ourselves with EAP */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* EAP_SUPPORT */
|
||||
u_int usepeerdns : 1; /* Ask peer for DNS adds */
|
||||
u_int persist : 1; /* Persist mode, always try to reopen the connection */
|
||||
unsigned int usepeerdns : 1; /* Ask peer for DNS adds */
|
||||
unsigned int persist : 1; /* Persist mode, always try to reopen the connection */
|
||||
#if PRINTPKT_SUPPORT
|
||||
u_int hide_password : 1; /* Hide password in dumped packets */
|
||||
unsigned int hide_password : 1; /* Hide password in dumped packets */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* PRINTPKT_SUPPORT */
|
||||
u_int noremoteip : 1; /* Let him have no IP address */
|
||||
u_int lax_recv : 1; /* accept control chars in asyncmap */
|
||||
u_int noendpoint : 1; /* don't send/accept endpoint discriminator */
|
||||
unsigned int noremoteip : 1; /* Let him have no IP address */
|
||||
unsigned int lax_recv : 1; /* accept control chars in asyncmap */
|
||||
unsigned int noendpoint : 1; /* don't send/accept endpoint discriminator */
|
||||
#if PPP_LCP_ADAPTIVE
|
||||
u_int lcp_echo_adaptive : 1; /* request echo only if the link was idle */
|
||||
unsigned int lcp_echo_adaptive : 1; /* request echo only if the link was idle */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif
|
||||
|
||||
unsigned int :2; /* 2 bits of padding to round out to 16 bits */
|
||||
|
||||
u16_t listen_time; /* time to listen first (ms), waiting for peer to send LCP packet */
|
||||
|
||||
@ -266,21 +282,26 @@ typedef struct ppp_pcb_rx_s {
|
||||
* PPP interface control block.
|
||||
*/
|
||||
struct ppp_pcb_s {
|
||||
u_int if_up :1; /* True when the interface is up. */
|
||||
u_int pcomp :1; /* Does peer accept protocol compression? */
|
||||
u_int accomp :1; /* Does peer accept addr/ctl compression? */
|
||||
u_int default_route_set :1; /* Have set up a default route */
|
||||
u_int proxy_arp_set :1; /* Have created proxy arp entry */
|
||||
u_int ipcp_is_open :1; /* haven't called np_finished() */
|
||||
u_int ipcp_is_up :1; /* have called ipcp_up() */
|
||||
unsigned int if_up :1; /* True when the interface is up. */
|
||||
unsigned int pcomp :1; /* Does peer accept protocol compression? */
|
||||
unsigned int accomp :1; /* Does peer accept addr/ctl compression? */
|
||||
unsigned int default_route_set :1; /* Have set up a default route */
|
||||
unsigned int proxy_arp_set :1; /* Have created proxy arp entry */
|
||||
unsigned int ipcp_is_open :1; /* haven't called np_finished() */
|
||||
unsigned int ipcp_is_up :1; /* have called ipcp_up() */
|
||||
#if PPP_IPV6_SUPPORT
|
||||
u_int ipv6cp_is_up :1; /* have called ip6cp_up() */
|
||||
unsigned int ipv6cp_is_up :1; /* have called ip6cp_up() */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* PPP_IPV6_SUPPORT */
|
||||
u_int ask_for_local :1; /* request our address from peer */
|
||||
u_int lcp_echo_timer_running :1; /* set if a timer is running */
|
||||
unsigned int ask_for_local :1; /* request our address from peer */
|
||||
unsigned int lcp_echo_timer_running :1; /* set if a timer is running */
|
||||
#if PPPOS_SUPPORT && VJ_SUPPORT
|
||||
u_int vj_enabled :1; /* Flag indicating VJ compression enabled. */
|
||||
unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */
|
||||
#else
|
||||
unsigned int :1; /* 1 bit of padding */
|
||||
#endif /* PPPOS_SUPPORT && VJ_SUPPORT */
|
||||
unsigned int :5; /* 5 bits of padding to round out to 16 bits */
|
||||
|
||||
ppp_settings settings;
|
||||
|
||||
|
@ -394,19 +394,19 @@ void new_phase(ppp_pcb *pcb, int p);
|
||||
#if PPPOS_SUPPORT
|
||||
void ppp_set_xaccm(ppp_pcb *pcb, ext_accm *accm);
|
||||
#endif /* PPPOS_SUPPORT */
|
||||
int ppp_send_config(ppp_pcb *pcb, int mtu, u_int32_t accm, int pcomp, int accomp);
|
||||
int ppp_recv_config(ppp_pcb *pcb, int mru, u_int32_t accm, int pcomp, int accomp);
|
||||
int ppp_send_config(ppp_pcb *pcb, int mtu, u32_t accm, int pcomp, int accomp);
|
||||
int ppp_recv_config(ppp_pcb *pcb, int mru, u32_t accm, int pcomp, int accomp);
|
||||
|
||||
int sifaddr(ppp_pcb *pcb, u_int32_t our_adr, u_int32_t his_adr, u_int32_t net_mask);
|
||||
int cifaddr(ppp_pcb *pcb, u_int32_t our_adr, u_int32_t his_adr);
|
||||
int sifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr, u32_t net_mask);
|
||||
int cifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr);
|
||||
|
||||
#if PPP_IPV6_SUPPORT
|
||||
int sif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64);
|
||||
int cif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64);
|
||||
#endif /* PPP_IPV6_SUPPORT */
|
||||
|
||||
int sdns(ppp_pcb *pcb, u_int32_t ns1, u_int32_t ns2);
|
||||
int cdns(ppp_pcb *pcb, u_int32_t ns1, u_int32_t ns2);
|
||||
int sdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2);
|
||||
int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2);
|
||||
|
||||
int sifup(ppp_pcb *pcb);
|
||||
int sifdown (ppp_pcb *pcb);
|
||||
@ -416,11 +416,11 @@ int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode);
|
||||
void netif_set_mtu(ppp_pcb *pcb, int mtu);
|
||||
int netif_get_mtu(ppp_pcb *pcb);
|
||||
|
||||
int sifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway, u8_t replace);
|
||||
int cifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway);
|
||||
int sifdefaultroute(ppp_pcb *pcb, u32_t ouraddr, u32_t gateway, u8_t replace);
|
||||
int cifdefaultroute(ppp_pcb *pcb, u32_t ouraddr, u32_t gateway);
|
||||
|
||||
int sifproxyarp(ppp_pcb *pcb, u_int32_t his_adr);
|
||||
int cifproxyarp(ppp_pcb *pcb, u_int32_t his_adr);
|
||||
int sifproxyarp(ppp_pcb *pcb, u32_t his_adr);
|
||||
int cifproxyarp(ppp_pcb *pcb, u32_t his_adr);
|
||||
|
||||
int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid);
|
||||
|
||||
@ -430,7 +430,7 @@ int get_idle_time(ppp_pcb *pcb, struct ppp_idle *ip);
|
||||
|
||||
int get_loop_output(void);
|
||||
|
||||
u_int32_t get_mask (u_int32_t addr);
|
||||
u32_t get_mask (u32_t addr);
|
||||
|
||||
|
||||
/* Optional protocol names list, to make our messages a little more informative. */
|
||||
@ -533,7 +533,7 @@ int get_secret(ppp_pcb *pcb, char *client, char *server, char *secret, int *secr
|
||||
/* get "secret" for chap */
|
||||
|
||||
/* Procedures exported from ipcp.c */
|
||||
/* int parse_dotted_ip (char *, u_int32_t *); */
|
||||
/* int parse_dotted_ip (char *, u32_t *); */
|
||||
|
||||
/* Procedures exported from demand.c */
|
||||
#if DEMAND_SUPPORT
|
||||
@ -541,7 +541,7 @@ 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*/
|
||||
void demand_rexmit (int, u32_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 */
|
||||
|
@ -145,7 +145,7 @@ int vslprintf(char *buf, int buflen, char *fmt, va_list args) {
|
||||
#if 0 /* need port */
|
||||
time_t t;
|
||||
#endif /* need port */
|
||||
u_int32_t ip;
|
||||
u32_t ip;
|
||||
static char hexchars[] = "0123456789abcdef";
|
||||
#if PRINTPKT_SUPPORT
|
||||
struct buffer_info bufinfo;
|
||||
@ -265,7 +265,7 @@ int vslprintf(char *buf, int buflen, char *fmt, va_list args) {
|
||||
break;
|
||||
#endif /* do we always have strerror() in embedded ? */
|
||||
case 'I':
|
||||
ip = va_arg(args, u_int32_t);
|
||||
ip = va_arg(args, u32_t);
|
||||
ip = ntohl(ip);
|
||||
slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff,
|
||||
(ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff);
|
||||
|
Loading…
x
Reference in New Issue
Block a user