summaryrefslogtreecommitdiffstats
path: root/cpukit/pppd
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2007-09-16 04:13:48 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2007-09-16 04:13:48 +0000
commit8a4f22e64ec09db4075cccb24dc290386ce16a95 (patch)
treeed36905d0a1fc10730f98c409906b4a1c110340b /cpukit/pppd
parent2007-09-14 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-8a4f22e64ec09db4075cccb24dc290386ce16a95.tar.bz2
Convert to using C99 fixed-size types instead of BSD fixed-size types.
Diffstat (limited to 'cpukit/pppd')
-rw-r--r--cpukit/pppd/auth.c20
-rw-r--r--cpukit/pppd/demand.c4
-rw-r--r--cpukit/pppd/ipcp.c62
-rw-r--r--cpukit/pppd/ipcp.h8
-rw-r--r--cpukit/pppd/lcp.c16
-rw-r--r--cpukit/pppd/lcp.h8
-rw-r--r--cpukit/pppd/magic.c4
-rw-r--r--cpukit/pppd/magic.h2
-rw-r--r--cpukit/pppd/options.c38
-rw-r--r--cpukit/pppd/pppd.h32
-rw-r--r--cpukit/pppd/sys-rtems.c44
-rw-r--r--cpukit/pppd/utils.c4
12 files changed, 121 insertions, 121 deletions
diff --git a/cpukit/pppd/auth.c b/cpukit/pppd/auth.c
index b92d692f16..ae0a039afe 100644
--- a/cpukit/pppd/auth.c
+++ b/cpukit/pppd/auth.c
@@ -169,7 +169,7 @@ static int get_pap_passwd(char *);
static int have_pap_secret(int *);
static int have_chap_secret(char *, char *, int, int *);
#if 0
-static int ip_addr_check(u_int32_t, struct permitted_ip *);
+static int ip_addr_check(uint32_t, struct permitted_ip *);
#endif
static void free_wordlist(struct wordlist *);
static void auth_script(enum script_state s);
@@ -895,9 +895,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;
+ uint32_t a, mask, ah, offset;
struct ipcp_options *wo = &ipcp_wantoptions[unit];
- u_int32_t suggested_ip = 0;
+ uint32_t suggested_ip = 0;
if (addresses[unit] != NULL)
free(addresses[unit]);
@@ -936,7 +936,7 @@ set_allowed_addrs(unit, addrs, opts)
++ptr_word;
}
- mask = ~ (u_int32_t) 0;
+ mask = ~ (uint32_t) 0;
offset = 0;
ptr_mask = strchr (ptr_word, '/');
if (ptr_mask != NULL) {
@@ -964,7 +964,7 @@ 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 = *(uint32_t *)hp->h_addr;
} else {
np = getnetbyname (ptr_word);
if (np != NULL && np->n_addrtype == AF_INET) {
@@ -987,7 +987,7 @@ set_allowed_addrs(unit, addrs, opts)
if (ptr_mask != NULL)
*ptr_mask = '/';
- if (a == (u_int32_t)-1L) {
+ if (a == (uint32_t)-1L) {
warn("unknown host %s in auth. address list", ap->word);
continue;
}
@@ -998,7 +998,7 @@ set_allowed_addrs(unit, addrs, opts)
continue;
}
a = htonl((ntohl(a) & mask) + offset);
- mask = ~(u_int32_t)0;
+ mask = ~(uint32_t)0;
}
ip[n].mask = htonl(mask);
ip[n].base = a & ip[n].mask;
@@ -1030,7 +1030,7 @@ set_allowed_addrs(unit, addrs, opts)
int
auth_ip_addr(unit, addr)
int unit;
- u_int32_t addr;
+ uint32_t addr;
{
#if 0
int ok;
@@ -1057,7 +1057,7 @@ auth_ip_addr(unit, addr)
#if 0
static int
ip_addr_check(addr, addrs)
- u_int32_t addr;
+ uint32_t addr;
struct permitted_ip *addrs;
{
for (; ; ++addrs)
@@ -1073,7 +1073,7 @@ ip_addr_check(addr, addrs)
*/
int
bad_ip_adrs(addr)
- u_int32_t addr;
+ uint32_t addr;
{
addr = ntohl(addr);
return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET
diff --git a/cpukit/pppd/demand.c b/cpukit/pppd/demand.c
index 4d1d19fef4..efcab0a2f5 100644
--- a/cpukit/pppd/demand.c
+++ b/cpukit/pppd/demand.c
@@ -85,8 +85,8 @@ demand_conf()
flush_flag = 0;
fcs = PPP_INITFCS;
- ppp_send_config(0, PPP_MRU, (u_int32_t) 0, 0, 0);
- ppp_recv_config(0, PPP_MRU, (u_int32_t) 0, 0, 0);
+ ppp_send_config(0, PPP_MRU, (uint32_t) 0, 0, 0);
+ ppp_recv_config(0, PPP_MRU, (uint32_t) 0, 0, 0);
#ifdef PPP_FILTER
set_filters(&pass_filter, &active_filter);
diff --git a/cpukit/pppd/ipcp.c b/cpukit/pppd/ipcp.c
index 39d9ccbd44..04926855d4 100644
--- a/cpukit/pppd/ipcp.c
+++ b/cpukit/pppd/ipcp.c
@@ -176,7 +176,7 @@ static int ipcp_printpkt(u_char *, int,
static void ip_check_options(void);
static int ip_demand_conf(int);
static int ip_active_pkt(u_char *, int);
-static void create_resolv(u_int32_t, u_int32_t);
+static void create_resolv(uint32_t, uint32_t);
struct protent ipcp_protent = {
PPP_IPCP,
@@ -198,7 +198,7 @@ struct protent ipcp_protent = {
ip_active_pkt
};
-static void ipcp_clear_addrs(int, u_int32_t, u_int32_t);
+static void ipcp_clear_addrs(int, uint32_t, uint32_t);
/*
* Lengths of configuration options.
@@ -218,7 +218,7 @@ static void ipcp_clear_addrs(int, u_int32_t, u_int32_t);
*/
char *
ip_ntoa(ipaddr)
-u_int32_t ipaddr;
+uint32_t ipaddr;
{
static char b[64];
@@ -257,17 +257,17 @@ static int
setdnsaddr(argv)
char **argv;
{
- u_int32_t dns;
+ uint32_t dns;
struct hostent *hp;
dns = inet_addr(*argv);
- if (dns == (u_int32_t) -1) {
+ if (dns == (uint32_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 = *(uint32_t *)hp->h_addr;
}
/* if there is no primary then update it. */
@@ -289,17 +289,17 @@ static int
setwinsaddr(argv)
char **argv;
{
- u_int32_t wins;
+ uint32_t wins;
struct hostent *hp;
wins = inet_addr(*argv);
- if (wins == (u_int32_t) -1) {
+ if (wins == (uint32_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 = *(uint32_t *)hp->h_addr;
}
/* if there is no primary then update it. */
@@ -526,7 +526,7 @@ ipcp_addci(f, ucp, lenp)
if (neg) { \
int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \
if (len >= addrlen) { \
- u_int32_t l; \
+ uint32_t l; \
PUTCHAR(opt, ucp); \
PUTCHAR(addrlen, ucp); \
l = ntohl(val1); \
@@ -543,7 +543,7 @@ ipcp_addci(f, ucp, lenp)
#define ADDCIDNS(opt, neg, addr) \
if (neg) { \
if (len >= CILEN_ADDR) { \
- u_int32_t l; \
+ uint32_t l; \
PUTCHAR(opt, ucp); \
PUTCHAR(CILEN_ADDR, ucp); \
l = ntohl(addr); \
@@ -583,7 +583,7 @@ ipcp_ackci(f, p, len)
{
ipcp_options *go = &ipcp_gotoptions[f->unit];
u_short cilen, citype, cishort;
- u_int32_t cilong;
+ uint32_t cilong;
u_char cimaxslotindex, cicflag;
/*
@@ -618,7 +618,7 @@ ipcp_ackci(f, p, len)
#define ACKCIADDR(opt, neg, old, val1, val2) \
if (neg) { \
int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \
- u_int32_t l; \
+ uint32_t l; \
if ((len -= addrlen) < 0) \
goto bad; \
GETCHAR(citype, p); \
@@ -640,7 +640,7 @@ ipcp_ackci(f, p, len)
#define ACKCIDNS(opt, neg, addr) \
if (neg) { \
- u_int32_t l; \
+ uint32_t l; \
if ((len -= CILEN_ADDR) < 0) \
goto bad; \
GETCHAR(citype, p); \
@@ -695,7 +695,7 @@ ipcp_nakci(f, p, len)
u_char cimaxslotindex, cicflag;
u_char citype, cilen, *next;
u_short cishort;
- u_int32_t ciaddr1, ciaddr2, l, cidnsaddr;
+ uint32_t ciaddr1, ciaddr2, l, cidnsaddr;
ipcp_options no; /* options we've seen Naks for */
ipcp_options try; /* options to request next time */
@@ -881,7 +881,7 @@ ipcp_rejci(f, p, len)
ipcp_options *go = &ipcp_gotoptions[f->unit];
u_char cimaxslotindex, ciflag, cilen;
u_short cishort;
- u_int32_t cilong;
+ uint32_t cilong;
ipcp_options try; /* options to request next time */
try = *go;
@@ -895,7 +895,7 @@ ipcp_rejci(f, p, len)
len >= (cilen = old? CILEN_ADDRS: CILEN_ADDR) && \
p[1] == cilen && \
p[0] == opt) { \
- u_int32_t l; \
+ uint32_t l; \
len -= cilen; \
INCPTR(2, p); \
GETLONG(l, p); \
@@ -940,7 +940,7 @@ ipcp_rejci(f, p, len)
((cilen = p[1]) == CILEN_ADDR) && \
len >= cilen && \
p[0] == opt) { \
- u_int32_t l; \
+ uint32_t l; \
len -= cilen; \
INCPTR(2, p); \
GETLONG(l, p); \
@@ -1002,7 +1002,7 @@ ipcp_reqci(f, inp, len, 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 */
+ uint32_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 */
@@ -1057,7 +1057,7 @@ ipcp_reqci(f, inp, len, reject_if_disagree)
&& (ciaddr1 == 0 || !wo->accept_remote)) {
orc = CONFNAK;
if (!reject_if_disagree) {
- DECPTR(sizeof(u_int32_t), p);
+ DECPTR(sizeof(uint32_t), p);
tl = ntohl(wo->hisaddr);
PUTLONG(tl, p);
}
@@ -1080,7 +1080,7 @@ ipcp_reqci(f, inp, len, reject_if_disagree)
if (ciaddr2 == 0 || !wo->accept_local) {
orc = CONFNAK;
if (!reject_if_disagree) {
- DECPTR(sizeof(u_int32_t), p);
+ DECPTR(sizeof(uint32_t), p);
tl = ntohl(wo->ouraddr);
PUTLONG(tl, p);
}
@@ -1114,7 +1114,7 @@ ipcp_reqci(f, inp, len, reject_if_disagree)
&& (ciaddr1 == 0 || !wo->accept_remote)) {
orc = CONFNAK;
if (!reject_if_disagree) {
- DECPTR(sizeof(u_int32_t), p);
+ DECPTR(sizeof(uint32_t), p);
tl = ntohl(wo->hisaddr);
PUTLONG(tl, p);
}
@@ -1144,7 +1144,7 @@ ipcp_reqci(f, inp, len, reject_if_disagree)
}
GETLONG(tl, p);
if (htonl(tl) != ao->dnsaddr[d]) {
- DECPTR(sizeof(u_int32_t), p);
+ DECPTR(sizeof(uint32_t), p);
tl = ntohl(ao->dnsaddr[d]);
PUTLONG(tl, p);
orc = CONFNAK;
@@ -1164,7 +1164,7 @@ ipcp_reqci(f, inp, len, reject_if_disagree)
}
GETLONG(tl, p);
if (htonl(tl) != ao->winsaddr[d]) {
- DECPTR(sizeof(u_int32_t), p);
+ DECPTR(sizeof(uint32_t), p);
tl = ntohl(ao->winsaddr[d]);
PUTLONG(tl, p);
orc = CONFNAK;
@@ -1283,7 +1283,7 @@ static void
ip_check_options()
{
struct hostent *hp;
- u_int32_t local;
+ uint32_t local;
ipcp_options *wo = &ipcp_wantoptions[0];
/*
@@ -1298,7 +1298,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 = *(uint32_t *)hp->h_addr;
if (local != 0 && !bad_ip_adrs(local))
wo->ouraddr = local;
}
@@ -1356,7 +1356,7 @@ static void
ipcp_up(f)
fsm *f;
{
- u_int32_t mask;
+ uint32_t mask;
ipcp_options *ho = &ipcp_hisoptions[f->unit];
ipcp_options *go = &ipcp_gotoptions[f->unit];
ipcp_options *wo = &ipcp_wantoptions[f->unit];
@@ -1541,8 +1541,8 @@ ipcp_down(f)
static void
ipcp_clear_addrs(unit, ouraddr, hisaddr)
int unit;
- u_int32_t ouraddr; /* local address */
- u_int32_t hisaddr; /* remote address */
+ uint32_t ouraddr; /* local address */
+ uint32_t hisaddr; /* remote address */
{
if (proxy_arp_set[unit]) {
cifproxyarp(unit, hisaddr);
@@ -1571,7 +1571,7 @@ ipcp_finished(f)
*/
static void
create_resolv(peerdns1, peerdns2)
- u_int32_t peerdns1, peerdns2;
+ uint32_t peerdns1, peerdns2;
{
/* initialize values */
rtems_bsdnet_nameserver_count = 0;
@@ -1610,7 +1610,7 @@ ipcp_printpkt(p, plen, printer, arg)
int code, id, len, olen;
u_char *pstart, *optend;
u_short cishort;
- u_int32_t cilong;
+ uint32_t cilong;
if (plen < HEADERLEN)
return 0;
diff --git a/cpukit/pppd/ipcp.h b/cpukit/pppd/ipcp.h
index 479a9679cd..d3b099bb18 100644
--- a/cpukit/pppd/ipcp.h
+++ b/cpukit/pppd/ipcp.h
@@ -57,9 +57,9 @@ typedef struct ipcp_options {
int vj_protocol; /* protocol value to use in VJ option */
int maxslotindex; /* values for RFC1332 VJ compression neg. */
bool cflag;
- 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 */
+ uint32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
+ uint32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
+ uint32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
} ipcp_options;
extern fsm ipcp_fsm[];
@@ -68,6 +68,6 @@ extern ipcp_options ipcp_gotoptions[];
extern ipcp_options ipcp_allowoptions[];
extern ipcp_options ipcp_hisoptions[];
-char *ip_ntoa(u_int32_t);
+char *ip_ntoa(uint32_t);
extern struct protent ipcp_protent;
diff --git a/cpukit/pppd/lcp.c b/cpukit/pppd/lcp.c
index 02da66e024..99f5986904 100644
--- a/cpukit/pppd/lcp.c
+++ b/cpukit/pppd/lcp.c
@@ -116,7 +116,7 @@ lcp_options lcp_wantoptions[NUM_PPP]; /* Options that we want to request */
lcp_options lcp_gotoptions[NUM_PPP]; /* Options that peer ack'd */
lcp_options lcp_allowoptions[NUM_PPP]; /* Options we allow peer to request */
lcp_options lcp_hisoptions[NUM_PPP]; /* Options that we ack'd */
-u_int32_t xmit_accm[NUM_PPP][8]; /* extended transmit ACCM */
+uint32_t xmit_accm[NUM_PPP][8]; /* extended transmit ACCM */
static int lcp_echos_pending = 0; /* Number of outstanding echo msgs */
static int lcp_echo_number = 0; /* ID number of next echo frame */
@@ -654,7 +654,7 @@ lcp_ackci(f, p, len)
lcp_options *go = &lcp_gotoptions[f->unit];
u_char cilen, citype, cichar;
u_short cishort;
- u_int32_t cilong;
+ uint32_t cilong;
/*
* CIs must be in exactly the same order that we sent.
@@ -785,7 +785,7 @@ lcp_nakci(f, p, len)
lcp_options *wo = &lcp_wantoptions[f->unit];
u_char citype, cichar, *next;
u_short cishort;
- u_int32_t cilong;
+ uint32_t cilong;
lcp_options no; /* options we've seen Naks for */
lcp_options try; /* options to request next time */
int looped_back = 0;
@@ -1096,7 +1096,7 @@ lcp_rejci(f, p, len)
lcp_options *go = &lcp_gotoptions[f->unit];
u_char cichar;
u_short cishort;
- u_int32_t cilong;
+ uint32_t cilong;
lcp_options try; /* options to request next time */
try = *go;
@@ -1234,7 +1234,7 @@ lcp_reqci(f, inp, lenp, 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 */
+ uint32_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 */
@@ -1637,7 +1637,7 @@ lcp_printpkt(p, plen, printer, arg)
int code, id, len, olen;
u_char *pstart, *optend;
u_short cishort;
- u_int32_t cilong;
+ uint32_t cilong;
if (plen < HEADERLEN)
return 0;
@@ -1865,7 +1865,7 @@ lcp_received_echo_reply (f, id, inp, len)
u_char *inp;
int len;
{
- u_int32_t magic;
+ uint32_t magic;
/* Check the magic number - don't count replies from ourselves. */
if (len < 4) {
@@ -1891,7 +1891,7 @@ static void
LcpSendEchoRequest (f)
fsm *f;
{
- u_int32_t lcp_magic;
+ uint32_t lcp_magic;
u_char pkt[4], *pktp;
/*
diff --git a/cpukit/pppd/lcp.h b/cpukit/pppd/lcp.h
index 5f399e5906..6231d270ae 100644
--- a/cpukit/pppd/lcp.h
+++ b/cpukit/pppd/lcp.h
@@ -58,10 +58,10 @@ typedef struct lcp_options {
bool neg_cbcp; /* Negotiate use of CBCP */
int mru; /* Value of MRU */
u_char chap_mdtype; /* which MD type (hashing algorithm) */
- u_int32_t asyncmap; /* Value of async map */
- u_int32_t magicnumber;
+ uint32_t asyncmap; /* Value of async map */
+ uint32_t magicnumber;
int numloops; /* Number of loops during magic number neg. */
- u_int32_t lqr_period; /* Reporting period for LQR 1/100ths second */
+ uint32_t lqr_period; /* Reporting period for LQR 1/100ths second */
} lcp_options;
extern fsm lcp_fsm[];
@@ -69,7 +69,7 @@ extern lcp_options lcp_wantoptions[];
extern lcp_options lcp_gotoptions[];
extern lcp_options lcp_allowoptions[];
extern lcp_options lcp_hisoptions[];
-extern u_int32_t xmit_accm[][8];
+extern uint32_t xmit_accm[][8];
#define DEFMRU 1500 /* Try for this */
#define MINMRU 128 /* No MRUs below this */
diff --git a/cpukit/pppd/magic.c b/cpukit/pppd/magic.c
index 3013e08f07..92cdbc8521 100644
--- a/cpukit/pppd/magic.c
+++ b/cpukit/pppd/magic.c
@@ -51,8 +51,8 @@ magic_init()
/*
* magic - Returns the next magic number.
*/
-u_int32_t
+uint32_t
magic()
{
- return (u_int32_t) mrand48();
+ return (uint32_t) mrand48();
}
diff --git a/cpukit/pppd/magic.h b/cpukit/pppd/magic.h
index 338fb2cbf4..572a550042 100644
--- a/cpukit/pppd/magic.h
+++ b/cpukit/pppd/magic.h
@@ -20,4 +20,4 @@
*/
void magic_init(void); /* Initialize the magic number generator */
-u_int32_t magic(void); /* Returns the next magic number */
+uint32_t magic(void); /* Returns the next magic number */
diff --git a/cpukit/pppd/options.c b/cpukit/pppd/options.c
index 78eff3ef57..b22ba2d1dd 100644
--- a/cpukit/pppd/options.c
+++ b/cpukit/pppd/options.c
@@ -68,7 +68,7 @@ char devnam[MAXPATHLEN]; /* Device name */
int crtscts = 0; /* Use hardware flow control */
bool modem = 1; /* Use modem control lines */
int inspeed = 0; /* Input/Output speed requested */
-u_int32_t netmask = 0; /* IP netmask to set on interface */
+uint32_t netmask = 0; /* IP netmask to set on interface */
bool lockflag = 0; /* Create lock file to lock the serial dev */
bool nodetach = 0; /* Don't detach from controlling tty */
bool updetach = 0; /* Detach once link is up */
@@ -145,7 +145,7 @@ static int setactivefilter(char **);
static option_t *find_option(char *name);
static int process_option(option_t *, char **);
static int n_arguments(option_t *);
-static int number_option(char *, u_int32_t *, int);
+static int number_option(char *, uint32_t *, int);
/*
* Structure to store extra lists of options.
@@ -612,7 +612,7 @@ process_option(opt, argv)
option_t *opt;
char **argv;
{
- u_int32_t v;
+ uint32_t v;
int iv, a;
char *sv;
int (*parser)(char **);
@@ -698,10 +698,10 @@ process_option(opt, argv)
} else if (!number_option(*argv, &v, 16))
return 0;
if (opt->flags & OPT_OR)
- v |= *(u_int32_t *)(opt->addr);
- *(u_int32_t *)(opt->addr) = v;
+ v |= *(uint32_t *)(opt->addr);
+ *(uint32_t *)(opt->addr) = v;
if (opt->addr2 && (opt->flags & OPT_A2COPY))
- *(u_int32_t *)(opt->addr2) = v;
+ *(uint32_t *)(opt->addr2) = v;
break;
case o_string:
@@ -1058,7 +1058,7 @@ getword(f, word, newlinep, filename)
static int
number_option(str, valp, base)
char *str;
- u_int32_t *valp;
+ uint32_t *valp;
int base;
{
char *ptr;
@@ -1083,7 +1083,7 @@ int_option(str, valp)
char *str;
int *valp;
{
- u_int32_t v;
+ uint32_t v;
if (!number_option(str, &v, 0))
return 0;
@@ -1237,15 +1237,15 @@ static int
setspeed(arg)
char *arg;
{
- int spd;
- uint32_t ret = (int)1;
- speed_t spdValue = (speed_t)0;
+ long spd;
+ uint32_t ret = 1;
+ speed_t spdValue = 0;
char *ptr;
if ( !prepass ) {
spd = strtol(arg, &ptr, 0);
if (ptr == arg || *ptr != 0 || spd == 0) {
- ret = (int)0;
+ ret = 0;
}
else {
switch ( spd ) {
@@ -1271,7 +1271,7 @@ setspeed(arg)
spdValue = B115200;
break;
default:
- ret = (int)0;
+ ret = 0;
break;
}
@@ -1350,7 +1350,7 @@ setipaddr(arg)
{
struct hostent *hp;
char *colon;
- u_int32_t local, remote;
+ uint32_t local, remote;
ipcp_options *wo = &ipcp_wantoptions[0];
/*
@@ -1366,12 +1366,12 @@ setipaddr(arg)
*/
if (colon != arg) {
*colon = '\0';
- if ((local = inet_addr(arg)) == (u_int32_t) -1) {
+ if ((local = inet_addr(arg)) == (uint32_t) -1) {
if ((hp = gethostbyname(arg)) == NULL) {
option_error("unknown host: %s", arg);
return -1;
} else {
- local = *(u_int32_t *)hp->h_addr;
+ local = *(uint32_t *)hp->h_addr;
}
}
if (bad_ip_adrs(local)) {
@@ -1387,12 +1387,12 @@ setipaddr(arg)
* If colon last character, then no remote addr.
*/
if (*++colon != '\0') {
- if ((remote = inet_addr(colon)) == (u_int32_t) -1) {
+ if ((remote = inet_addr(colon)) == (uint32_t) -1) {
if ((hp = gethostbyname(colon)) == NULL) {
option_error("unknown host: %s", colon);
return -1;
} else {
- remote = *(u_int32_t *)hp->h_addr;
+ remote = *(uint32_t *)hp->h_addr;
if (remote_name[0] == 0)
strlcpy(remote_name, colon, sizeof(remote_name));
}
@@ -1416,7 +1416,7 @@ static int
setnetmask(argv)
char **argv;
{
- u_int32_t mask, b;
+ uint32_t mask, b;
int n, ok;
char *p, *endp;
diff --git a/cpukit/pppd/pppd.h b/cpukit/pppd/pppd.h
index 9320348ffb..46e80f5585 100644
--- a/cpukit/pppd/pppd.h
+++ b/cpukit/pppd/pppd.h
@@ -25,7 +25,7 @@
#include <stdio.h> /* for FILE */
#include <limits.h> /* for NGROUPS_MAX */
#include <sys/param.h> /* for MAXPATHLEN and BSD4_4, if defined */
-#include <sys/types.h> /* for u_int32_t, if defined */
+#include <sys/types.h> /* for uint32_t, if defined */
#include <sys/time.h> /* for struct timeval */
#include <net/ppp_defs.h>
#include <rtems/rtemsdialer.h>
@@ -113,8 +113,8 @@ typedef struct {
/* Structure representing a list of permitted IP addresses. */
struct permitted_ip {
int permit; /* 1 = permit, 0 = forbid */
- u_int32_t base; /* match if (addr & mask) == base */
- u_int32_t mask; /* base and mask are in network byte order */
+ uint32_t base; /* match if (addr & mask) == base */
+ uint32_t mask; /* base and mask are in network byte order */
};
/*
@@ -181,7 +181,7 @@ extern char devnam[MAXPATHLEN]; /* Device name */
extern int crtscts; /* Use hardware flow control */
extern bool modem; /* Use modem control lines */
extern int inspeed; /* Input/Output speed requested */
-extern u_int32_t netmask; /* IP netmask to set on interface */
+extern uint32_t netmask; /* IP netmask to set on interface */
extern bool lockflag; /* Create lock file to lock the serial dev */
extern bool nodetach; /* Don't detach from controlling tty */
extern bool updetach; /* Detach from controlling tty when link up */
@@ -346,9 +346,9 @@ int check_passwd(int, char *, int, char *, int, char **);
/* Check peer-supplied username/password */
int get_secret(int, char *, char *, unsigned char *, int *, int);
/* get "secret" for chap */
-int auth_ip_addr(int, u_int32_t);
+int auth_ip_addr(int, uint32_t);
/* check if IP address is authorized */
-int bad_ip_adrs(u_int32_t);
+int bad_ip_adrs(uint32_t);
/* check if IP address is unreasonable */
/* Procedures exported from demand.c */
@@ -381,11 +381,11 @@ void wait_input(struct timeval *); /* Wait for input, with timeout */
void ppp_delay(void); /* delay task for a little while */
int read_packet(u_char *); /* Read PPP packet */
int get_loop_output(void); /* Read pkts from loopback */
-void ppp_send_config(int, int, u_int32_t, int, int);
+void ppp_send_config(int, int, uint32_t, int, int);
/* Configure i/f transmit parameters */
void ppp_set_xaccm(int, ext_accm);
/* Set extended transmit ACCM */
-void ppp_recv_config(int, int, u_int32_t, int, int);
+void ppp_recv_config(int, int, uint32_t, int, int);
/* Configure i/f receive parameters */
int ccp_test(int, u_char *, int, int);
/* Test support for compression scheme */
@@ -402,9 +402,9 @@ int sifup(int); /* Configure i/f up for one protocol */
int sifnpmode(int u, int proto, enum NPmode mode);
/* Set mode for handling packets for proto */
int sifdown(int); /* Configure i/f down for one protocol */
-int sifaddr(int, u_int32_t, u_int32_t, u_int32_t);
+int sifaddr(int, uint32_t, uint32_t, uint32_t);
/* Configure IPv4 addresses for i/f */
-int cifaddr(int, u_int32_t, u_int32_t);
+int cifaddr(int, uint32_t, uint32_t);
/* Reset i/f IP addresses */
#ifdef INET6
int sif6addr(int, eui64_t, eui64_t);
@@ -412,22 +412,22 @@ int sif6addr(int, eui64_t, eui64_t);
int cif6addr(int, eui64_t, eui64_t);
/* Remove an IPv6 address from i/f */
#endif
-int sifdefaultroute(int, u_int32_t, u_int32_t);
+int sifdefaultroute(int, uint32_t, uint32_t);
/* Create default route through i/f */
-int cifdefaultroute(int, u_int32_t, u_int32_t);
+int cifdefaultroute(int, uint32_t, uint32_t);
/* Delete default route through i/f */
-int sifproxyarp(int, u_int32_t);
+int sifproxyarp(int, uint32_t);
/* Add proxy ARP entry for peer */
-int cifproxyarp(int, u_int32_t);
+int cifproxyarp(int, uint32_t);
/* Delete proxy ARP entry for peer */
-u_int32_t GetMask(u_int32_t); /* Get appropriate netmask for address */
+uint32_t GetMask(uint32_t); /* Get appropriate netmask for address */
int lock(char *); /* Create lock file for device */
int relock(int); /* Rewrite lock file with new pid */
void unlock(void); /* Delete previously-created lock file */
void logwtmp(const char *, const char *, const char *);
/* Write entry to wtmp file */
int get_host_seed(void); /* Get host-dependent random number seed */
-int have_route_to(u_int32_t); /* Check if route to addr exists */
+int have_route_to(uint32_t); /* Check if route to addr exists */
#ifdef PPP_FILTER
int set_filters(struct bpf_program *pass, struct bpf_program *active);
/* Set filter programs in kernel */
diff --git a/cpukit/pppd/sys-rtems.c b/cpukit/pppd/sys-rtems.c
index a931be7d49..2bbe94f9b2 100644
--- a/cpukit/pppd/sys-rtems.c
+++ b/cpukit/pppd/sys-rtems.c
@@ -86,13 +86,13 @@ static unsigned char inbuf[512]; /* buffer for chars read from loopback */
static int sockfd; /* socket for doing interface ioctls */
static int if_is_up; /* the interface is currently up */
-static u_int32_t ifaddrs[2]; /* local and remote addresses we set */
-static u_int32_t default_route_gateway; /* gateway addr for default route */
-static u_int32_t proxy_arp_addr; /* remote addr for proxy arp */
+static uint32_t ifaddrs[2]; /* local and remote addresses we set */
+static uint32_t default_route_gateway; /* gateway addr for default route */
+static uint32_t proxy_arp_addr; /* remote addr for proxy arp */
/* Prototypes for procedures local to this file. */
-static int dodefaultroute(u_int32_t, int);
-static int get_ether_addr(u_int32_t, struct sockaddr_dl *);
+static int dodefaultroute(uint32_t, int);
+static int get_ether_addr(uint32_t, struct sockaddr_dl *);
/*
@@ -581,7 +581,7 @@ get_loop_output()
void
ppp_send_config(unit, mtu, asyncmap, pcomp, accomp)
int unit, mtu;
- u_int32_t asyncmap;
+ uint32_t asyncmap;
int pcomp, accomp;
{
u_int x;
@@ -625,7 +625,7 @@ ppp_set_xaccm(unit, accm)
void
ppp_recv_config(unit, mru, asyncmap, pcomp, accomp)
int unit, mru;
- u_int32_t asyncmap;
+ uint32_t asyncmap;
int pcomp, accomp;
{
int x;
@@ -874,7 +874,7 @@ sifdown(u)
int
sifaddr(u, o, h, m)
int u;
- u_int32_t o, h, m;
+ uint32_t o, h, m;
{
struct ifaliasreq ifra;
struct ifreq ifr;
@@ -914,7 +914,7 @@ sifaddr(u, o, h, m)
int
cifaddr(u, o, h)
int u;
- u_int32_t o, h;
+ uint32_t o, h;
{
struct ifaliasreq ifra;
@@ -939,7 +939,7 @@ cifaddr(u, o, h)
int
sifdefaultroute(u, l, g)
int u;
- u_int32_t l, g;
+ uint32_t l, g;
{
return dodefaultroute(g, 's');
}
@@ -950,7 +950,7 @@ sifdefaultroute(u, l, g)
int
cifdefaultroute(u, l, g)
int u;
- u_int32_t l, g;
+ uint32_t l, g;
{
return dodefaultroute(g, 'c');
}
@@ -960,7 +960,7 @@ cifdefaultroute(u, l, g)
*/
static int
dodefaultroute(g, cmd)
- u_int32_t g;
+ uint32_t g;
int cmd;
{
/* int status; */
@@ -1025,7 +1025,7 @@ static int arpmsg_valid;
int
sifproxyarp(unit, hisaddr)
int unit;
- u_int32_t hisaddr;
+ uint32_t hisaddr;
{
int routes;
@@ -1075,7 +1075,7 @@ sifproxyarp(unit, hisaddr)
int
cifproxyarp(unit, hisaddr)
int unit;
- u_int32_t hisaddr;
+ uint32_t hisaddr;
{
int routes;
@@ -1110,7 +1110,7 @@ cifproxyarp(unit, hisaddr)
int
sifproxyarp(unit, hisaddr)
int unit;
- u_int32_t hisaddr;
+ uint32_t hisaddr;
{
struct arpreq arpreq;
struct {
@@ -1150,7 +1150,7 @@ sifproxyarp(unit, hisaddr)
int
cifproxyarp(unit, hisaddr)
int unit;
- u_int32_t hisaddr;
+ uint32_t hisaddr;
{
struct arpreq arpreq;
@@ -1175,11 +1175,11 @@ cifproxyarp(unit, hisaddr)
static int
get_ether_addr(ipaddr, hwaddr)
- u_int32_t ipaddr;
+ uint32_t ipaddr;
struct sockaddr_dl *hwaddr;
{
struct ifreq *ifr, *ifend, *ifp;
- u_int32_t ina, mask;
+ uint32_t ina, mask;
struct sockaddr_dl *dla;
struct ifreq ifreq;
struct ifconf ifc;
@@ -1258,11 +1258,11 @@ get_ether_addr(ipaddr, hwaddr)
* network as `addr'. If we find any, we OR in their netmask to the
* user-specified netmask.
*/
-u_int32_t
+uint32_t
GetMask(addr)
- u_int32_t addr;
+ uint32_t addr;
{
- u_int32_t mask, nmask, ina;
+ uint32_t mask, nmask, ina;
struct ifreq *ifr, *ifend, ifreq;
struct ifconf ifc;
struct ifreq ifs[MAX_IFS];
@@ -1323,7 +1323,7 @@ GetMask(addr)
* For demand mode to work properly, we have to ignore routes
* through our own interface.
*/
-int have_route_to(u_int32_t addr)
+int have_route_to(uint32_t addr)
{
return -1;
}
diff --git a/cpukit/pppd/utils.c b/cpukit/pppd/utils.c
index 9a1932c867..5ee0fbe551 100644
--- a/cpukit/pppd/utils.c
+++ b/cpukit/pppd/utils.c
@@ -107,7 +107,7 @@ vslprintf(buf, buflen, fmt, args)
unsigned char *p;
char num[32];
time_t t;
- u_int32_t ip;
+ uint32_t ip;
static char hexchars[] = "0123456789abcdef";
struct buffer_info bufinfo;
@@ -197,7 +197,7 @@ vslprintf(buf, buflen, fmt, args)
str = strerror(errno);
break;
case 'I':
- ip = va_arg(args, u_int32_t);
+ ip = va_arg(args, uint32_t);
ip = ntohl(ip);
slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff,
(ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff);