2006-08-30 Joel Sherrill <joel@OARcorp.com>

* ftpd/ftpd.c, libcsupport/include/sys/ioccom.h,
	libcsupport/src/ioctl.c, libnetworking/kern/uipc_mbuf.c,
	libnetworking/libc/inet_addr.c, libnetworking/net/ethernet.h,
	libnetworking/net/if.c, libnetworking/net/if_ethersubr.c,
	libnetworking/net/if_ppp.c, libnetworking/net/if_pppvar.h,
	libnetworking/net/if_var.h, libnetworking/net/ppp_tty.c,
	libnetworking/netinet/in_cksum.c, libnetworking/nfs/bootp_subr.c,
	libnetworking/rtems/rtems_bsdnet_internal.h,
	libnetworking/sys/mbuf.h, pppd/md4.c, pppd/pppd.h: Remove warnings
	due to improper use of int which shows up on 16 bit targets. Added
	ioctl_command_t since IOCTL command argument does not reliably fit
	into 16 bits.
This commit is contained in:
Joel Sherrill
2006-08-31 01:10:02 +00:00
parent ae5a79c349
commit a009d94459
19 changed files with 76 additions and 49 deletions

View File

@@ -1,3 +1,18 @@
2006-08-30 Joel Sherrill <joel@OARcorp.com>
* ftpd/ftpd.c, libcsupport/include/sys/ioccom.h,
libcsupport/src/ioctl.c, libnetworking/kern/uipc_mbuf.c,
libnetworking/libc/inet_addr.c, libnetworking/net/ethernet.h,
libnetworking/net/if.c, libnetworking/net/if_ethersubr.c,
libnetworking/net/if_ppp.c, libnetworking/net/if_pppvar.h,
libnetworking/net/if_var.h, libnetworking/net/ppp_tty.c,
libnetworking/netinet/in_cksum.c, libnetworking/nfs/bootp_subr.c,
libnetworking/rtems/rtems_bsdnet_internal.h,
libnetworking/sys/mbuf.h, pppd/md4.c, pppd/pppd.h: Remove warnings
due to improper use of int which shows up on 16 bit targets. Added
ioctl_command_t since IOCTL command argument does not reliably fit
into 16 bits.
2006-08-30 Joel Sherrill <joel@OARcorp.com>
* libcsupport/include/sys/ioccom.h, libnetworking/kern/uipc_socket2.c,

View File

@@ -1192,7 +1192,7 @@ send_dirline(int s, int wide, time_t curTime, char const* path,
struct tm bt;
time_t tf = stat_buf.st_mtime;
enum { SIZE = 80 };
enum { SIX_MONTHS = 365*24*60*60/2 };
uint32_t SIX_MONTHS = (365L*24L*60L*60L)/2L;
char timeBuf[SIZE];
gmtime_r(&tf, &bt);
if(curTime > tf + SIX_MONTHS || tf > curTime + SIX_MONTHS)

View File

@@ -90,8 +90,13 @@
#include <sys/cdefs.h>
#ifndef __ioctl_command_defined
typedef u_int32_t ioctl_command_t;
#define __ioctl_command_defined
#endif
__BEGIN_DECLS
int ioctl(int, int, ...);
int ioctl(int, ioctl_command_t, ...);
__END_DECLS
#endif /* !KERNEL */

View File

@@ -27,7 +27,7 @@
int ioctl(
int fd,
int command,
ioctl_command_t command,
...
)
{

View File

@@ -221,7 +221,7 @@ m_prepend(struct mbuf *m, int len, int how)
static int MCFail;
struct mbuf *
m_copym(struct mbuf *m, int off0, int len, int wait)
m_copym(struct mbuf *m, int off0, uint32_t len, int wait)
{
struct mbuf *n, **np;
int off = off0;

View File

@@ -93,8 +93,8 @@ inet_aton(cp, addr)
in_addr_t val;
register int base, n;
register char c;
u_int parts[4];
register u_int *pp = parts;
uint32_t parts[4];
register uint32_t *pp = parts;
c = *cp;
for (;;) {

View File

@@ -360,7 +360,7 @@ extern uint32_t ether_crc32_be(const uint8_t *, size_t);
extern void ether_demux(struct ifnet *, struct mbuf *);
extern void ether_ifattach(struct ifnet *);
extern void ether_ifdetach(struct ifnet *);
extern int ether_ioctl(struct ifnet *, int32_t, caddr_t);
extern int ether_ioctl(struct ifnet *, ioctl_command_t, caddr_t);
extern void ether_input (struct ifnet *, struct ether_header *, struct mbuf *);
extern int ether_output(struct ifnet *,
struct mbuf *, struct sockaddr *, struct rtentry *);

View File

@@ -559,7 +559,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
* 72 was chosen below because it is the size of a TCP/IP
* header (40) + the minimum mss (32).
*/
if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535)
if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535L)
return (EINVAL);
error = (*ifp->if_ioctl)(ifp, cmd, data);
if (error == 0)

View File

@@ -825,7 +825,7 @@ ether_crc32_be(const uint8_t *buf, size_t len)
}
int
ether_ioctl(struct ifnet *ifp, int32_t command, caddr_t data)
ether_ioctl(struct ifnet *ifp, ioctl_command_t command, caddr_t data)
{
struct ifaddr *ifa = (struct ifaddr *) data;
struct ifreq *ifr = (struct ifreq *) data;

View File

@@ -132,7 +132,7 @@
#include <net/ppp-comp.h>
#endif
static int pppsioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
static int pppsioctl(struct ifnet *ifp, ioctl_command_t cmd, caddr_t data);
static void ppp_requeue(struct ppp_softc *);
#ifdef PPP_COMPRESS
static void ppp_ccp(struct ppp_softc *, struct mbuf *m, int rcvd);
@@ -619,7 +619,7 @@ pppdealloc(sc)
int
pppioctl(sc, cmd, data, flag, p)
struct ppp_softc *sc;
int32_t cmd;
ioctl_command_t cmd;
caddr_t data;
int flag;
struct proc *p;
@@ -838,7 +838,7 @@ pppioctl(sc, cmd, data, flag, p)
* Process an ioctl request to the ppp network interface.
*/
static int
pppsioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
pppsioctl(struct ifnet *ifp, ioctl_command_t cmd, caddr_t data)
{
/*struct proc *p = curproc;*/ /* XXX */
register struct ppp_softc *sc = &ppp_softc[ifp->if_unit];

View File

@@ -118,7 +118,7 @@ struct ppp_softc *pppalloc(pid_t pid);
void pppdealloc(struct ppp_softc *sc);
int pppoutput(struct ifnet *, struct mbuf *,
struct sockaddr *, struct rtentry *);
int pppioctl(struct ppp_softc *sc, int32_t cmd, caddr_t data,
int pppioctl(struct ppp_softc *sc, ioctl_command_t cmd, caddr_t data,
int flag, struct proc *p);
struct mbuf *ppp_dequeue(struct ppp_softc *sc);
u_short pppfcs(u_short fcs, u_char *cp, int len);

View File

@@ -116,7 +116,7 @@ struct ifnet {
void (*if_start) /* initiate output routine */
(struct ifnet *);
int (*if_ioctl) /* ioctl routine */
(struct ifnet *, u_long, caddr_t);
(struct ifnet *, ioctl_command_t, caddr_t);
void (*if_watchdog) /* timer routine */
(struct ifnet *);
int (*if_poll_recv) /* polled receive routine */

View File

@@ -427,7 +427,7 @@ ppptioctl(struct rtems_termios_tty *tty, rtems_libio_ioctl_args_t *args)
{
/* int i; */
int error = RTEMS_SUCCESSFUL;
int32_t cmd = args->command;
ioctl_command_t cmd = args->command;
caddr_t data = args->buffer;
struct ppp_softc *sc = tty->t_sc;

View File

@@ -68,18 +68,18 @@
* code and should be modified for each CPU to be as fast as possible.
*/
#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
#define ADDCARRY(x) (x > 65535L ? x -= 65535L : x)
#define REDUCE \
{l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
int
in_cksum(m, len)
register struct mbuf *m;
register int len;
register uint32_t len;
{
register u_short *w;
register int sum = 0;
register int mlen = 0;
register uint32_t sum = 0;
register uint32_t mlen = 0;
int byte_swapped = 0;
union {

View File

@@ -71,6 +71,7 @@
#include <rtems/mkrootfs.h>
#include <rtems/rtems_bsdnet.h>
#include <rtems/bsdnet/servers.h>
#include <inttypes.h>
#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
@@ -706,12 +707,12 @@ substr(char *a, char *b)
static void printip(char *prefix,struct in_addr addr)
{
unsigned int ip;
uint32_t ip;
ip = ntohl(addr.s_addr);
printf("%s is %d.%d.%d.%d\n",prefix,
ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
printf("%s is %" PRId32" .%" PRId32" .%" PRId32" .%" PRId32" \n",prefix,
ip >> 24, (ip >> 16) & 0xff ,(ip >> 8) & 0xff ,ip & 0xff );
}
static int dhcpOptionOverload = 0;

View File

@@ -19,6 +19,12 @@ typedef long long vm_ooffset_t;
typedef unsigned int vm_pindex_t;
typedef unsigned int vm_size_t;
#ifndef __ioctl_command_defined
typedef u_int32_t ioctl_command_t;
#define __ioctl_command_defined
#endif
#define _BSD_OFF_T_ int32_t
#define _BSD_PID_T_ rtems_id
#define _BSD_VA_LIST_ char *
@@ -173,7 +179,7 @@ void ipintr (void);
void arpintr (void);
void bootpc_init(int );
int socket (int, int, int);
int ioctl (int, int, ...);
int ioctl (int, ioctl_command_t, ...);
/*
* Events used by networking routines.
@@ -183,8 +189,8 @@ int ioctl (int, int, ...);
*/
#define SBWAIT_EVENT RTEMS_EVENT_24
#define SOSLEEP_EVENT RTEMS_EVENT_25
#define NETISR_IP_EVENT (1 << NETISR_IP)
#define NETISR_ARP_EVENT (1 << NETISR_ARP)
#define NETISR_IP_EVENT (1L << NETISR_IP)
#define NETISR_ARP_EVENT (1L << NETISR_ARP)
#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT)
#if (SBWAIT_EVENT & SOSLEEP_EVENT & NETISR_EVENTS)
# error "Network event conflict"

View File

@@ -395,7 +395,7 @@ union mcluster {
}
/* Length to m_copy to copy all. */
#define M_COPYALL 1000000000
#define M_COPYALL (uint32_t)1000000000L
/* Compatibility with 4.3. */
#define m_copy(m, o, l) m_copym((m), (o), (l), M_DONTWAIT)
@@ -413,7 +413,7 @@ extern int max_protohdr; /* largest protocol header */
extern int max_hdr; /* largest link+protocol header */
extern int max_datalen; /* MHLEN - max_hdr */
struct mbuf *m_copym(struct mbuf *, int, int, int);
struct mbuf *m_copym(struct mbuf *, int, uint32_t, int);
struct mbuf *m_copypacket(struct mbuf *, int);
struct mbuf *m_devget(char *, int, int, struct ifnet *,
void (*copy)(char *, caddr_t, u_int));

View File

@@ -124,8 +124,8 @@ MDblock(MDp,Xb)
MD4_CTX *MDp;
unsigned char *Xb;
{
register unsigned int tmp, A, B, C, D;
unsigned int X[16];
register uint32_t tmp, A, B, C, D;
uint32_t X[16];
int i;
for (i = 0; i < 16; ++i) {

View File

@@ -74,33 +74,33 @@ typedef struct {
enum opt_type type;
void *addr;
char *description;
int flags;
uint32_t flags;
void *addr2;
int upper_limit;
int lower_limit;
} option_t;
/* Values for flags */
#define OPT_VALUE 0xff /* mask for presupplied value */
#define OPT_HEX 0x100 /* int option is in hex */
#define OPT_NOARG 0x200 /* option doesn't take argument */
#define OPT_OR 0x400 /* OR in argument to value */
#define OPT_INC 0x800 /* increment value */
#define OPT_PRIV 0x1000 /* privileged option */
#define OPT_STATIC 0x2000 /* string option goes into static array */
#define OPT_LLIMIT 0x4000 /* check value against lower limit */
#define OPT_ULIMIT 0x8000 /* check value against upper limit */
#define OPT_VALUE 0xffL /* mask for presupplied value */
#define OPT_HEX 0x100L /* int option is in hex */
#define OPT_NOARG 0x200L /* option doesn't take argument */
#define OPT_OR 0x400L /* OR in argument to value */
#define OPT_INC 0x800L /* increment value */
#define OPT_PRIV 0x1000L /* privileged option */
#define OPT_STATIC 0x2000L /* string option goes into static array */
#define OPT_LLIMIT 0x4000L /* check value against lower limit */
#define OPT_ULIMIT 0x8000L /* check value against upper limit */
#define OPT_LIMITS (OPT_LLIMIT|OPT_ULIMIT)
#define OPT_ZEROOK 0x10000 /* 0 value is OK even if not within limits */
#define OPT_NOINCR 0x20000 /* value mustn't be increased */
#define OPT_ZEROINF 0x40000 /* with OPT_NOINCR, 0 == infinity */
#define OPT_A2INFO 0x100000 /* addr2 -> option_info to update */
#define OPT_A2COPY 0x200000 /* addr2 -> second location to rcv value */
#define OPT_ENABLE 0x400000 /* use *addr2 as enable for option */
#define OPT_PRIVFIX 0x800000 /* can't be overridden if noauth */
#define OPT_PREPASS 0x1000000 /* do this opt in pre-pass to find device */
#define OPT_INITONLY 0x2000000 /* option can only be set in init phase */
#define OPT_DEVEQUIV 0x4000000 /* equiv to device name */
#define OPT_ZEROOK 0x10000L /* 0 value is OK even if not within limits */
#define OPT_NOINCR 0x20000L /* value mustn't be increased */
#define OPT_ZEROINF 0x40000L /* with OPT_NOINCR, 0 == infinity */
#define OPT_A2INFO 0x100000L /* addr2 -> option_info to update */
#define OPT_A2COPY 0x200000L /* addr2 -> second location to rcv value */
#define OPT_ENABLE 0x400000L /* use *addr2 as enable for option */
#define OPT_PRIVFIX 0x800000L /* can't be overridden if noauth */
#define OPT_PREPASS 0x1000000L /* do this opt in pre-pass to find device */
#define OPT_INITONLY 0x2000000L /* option can only be set in init phase */
#define OPT_DEVEQUIV 0x4000000L /* equiv to device name */
#define OPT_DEVNAM (OPT_PREPASS | OPT_INITONLY | OPT_DEVEQUIV)
#define OPT_VAL(x) ((x) & OPT_VALUE)