mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
2004-03-29 Ralf Corsepius <ralf_corsepius@rtems.org>
* libnetworking/lib/ftpfs.c, libnetworking/lib/rtems_bsdnet_ntp.c, libnetworking/lib/tftpDriver.c, libnetworking/machine/endian.h, libnetworking/net/if_ppp.c, libnetworking/rtems/rtems_bsdnet.h, libnetworking/rtems/rtems_bsdnet_internal.h, libnetworking/rtems/rtems_glue.c, libnetworking/rtems/rtems_syscall.c: Convert to using c99 fixed size types.
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
2004-03-29 Ralf Corsepius <ralf_corsepius@rtems.org>
|
||||
|
||||
* libnetworking/lib/ftpfs.c, libnetworking/lib/rtems_bsdnet_ntp.c,
|
||||
libnetworking/lib/tftpDriver.c, libnetworking/machine/endian.h,
|
||||
libnetworking/net/if_ppp.c, libnetworking/rtems/rtems_bsdnet.h,
|
||||
libnetworking/rtems/rtems_bsdnet_internal.h,
|
||||
libnetworking/rtems/rtems_glue.c,
|
||||
libnetworking/rtems/rtems_syscall.c: Convert to using c99 fixed size
|
||||
types.
|
||||
|
||||
2004-03-29 Ralf Corsepius <ralf_corsepius@rtems.org>
|
||||
|
||||
* score/include/rtems/debug.h, score/include/rtems/score/bitfield.h,
|
||||
|
||||
@@ -520,8 +520,8 @@ int rtems_ftp_eval_path(
|
||||
int rtems_ftp_open(
|
||||
rtems_libio_t *iop,
|
||||
const char *new_name,
|
||||
unsigned32 flag,
|
||||
unsigned32 mode
|
||||
uint32_t flag,
|
||||
uint32_t mode
|
||||
)
|
||||
{
|
||||
int s = 0;
|
||||
@@ -530,8 +530,8 @@ int rtems_ftp_open(
|
||||
char *upass = NULL;
|
||||
char *hostname = NULL;
|
||||
char port_buffer[sizeof(FTP_PORT_CMD)+6*4+1+1];
|
||||
rtems_unsigned32 my_ip;
|
||||
rtems_unsigned16 my_port;
|
||||
uint32_t my_ip;
|
||||
uint16_t my_port;
|
||||
int eno = 0;
|
||||
rtems_status_code rc;
|
||||
rtems_boolean is_write = FALSE;
|
||||
@@ -962,7 +962,7 @@ int rtems_ftp_open(
|
||||
ssize_t rtems_ftp_read(
|
||||
rtems_libio_t *iop,
|
||||
void *buffer,
|
||||
unsigned32 count
|
||||
uint32_t count
|
||||
)
|
||||
{
|
||||
int eno = 0;
|
||||
@@ -1016,7 +1016,7 @@ ssize_t rtems_ftp_read(
|
||||
ssize_t rtems_ftp_write(
|
||||
rtems_libio_t *iop,
|
||||
const void *buffer,
|
||||
unsigned32 count
|
||||
uint32_t count
|
||||
)
|
||||
{
|
||||
int eno = EIO;
|
||||
|
||||
@@ -35,17 +35,17 @@
|
||||
#define UNIX_BASE_TO_NTP_BASE (((70UL*365UL)+17UL) * (24*60*60))
|
||||
|
||||
struct timestamp {
|
||||
rtems_unsigned32 integer;
|
||||
rtems_unsigned32 fraction;
|
||||
uint32_t integer;
|
||||
uint32_t fraction;
|
||||
};
|
||||
|
||||
struct ntpPacketSmall {
|
||||
rtems_unsigned8 li_vn_mode;
|
||||
rtems_unsigned8 stratum;
|
||||
rtems_signed8 poll_interval;
|
||||
rtems_signed8 precision;
|
||||
rtems_signed32 root_delay;
|
||||
rtems_signed32 root_dispersion;
|
||||
uint8_t li_vn_mode;
|
||||
uint8_t stratum;
|
||||
int8_t poll_interval;
|
||||
int8_t precision;
|
||||
int32_t root_delay;
|
||||
int32_t root_dispersion;
|
||||
char reference_identifier[4];
|
||||
struct timestamp reference_timestamp;
|
||||
struct timestamp originate_timestamp;
|
||||
|
||||
@@ -83,7 +83,7 @@ union tftpPacket {
|
||||
* RRQ/WRQ packet
|
||||
*/
|
||||
struct tftpRWRQ {
|
||||
rtems_unsigned16 opcode;
|
||||
uint16_t opcode;
|
||||
char filename_mode[TFTP_BUFSIZE];
|
||||
} tftpRWRQ;
|
||||
|
||||
@@ -91,25 +91,25 @@ union tftpPacket {
|
||||
* DATA packet
|
||||
*/
|
||||
struct tftpDATA {
|
||||
rtems_unsigned16 opcode;
|
||||
rtems_unsigned16 blocknum;
|
||||
rtems_unsigned8 data[TFTP_BUFSIZE];
|
||||
uint16_t opcode;
|
||||
uint16_t blocknum;
|
||||
uint8_t data[TFTP_BUFSIZE];
|
||||
} tftpDATA;
|
||||
|
||||
/*
|
||||
* ACK packet
|
||||
*/
|
||||
struct tftpACK {
|
||||
rtems_unsigned16 opcode;
|
||||
rtems_unsigned16 blocknum;
|
||||
uint16_t opcode;
|
||||
uint16_t blocknum;
|
||||
} tftpACK;
|
||||
|
||||
/*
|
||||
* ERROR packet
|
||||
*/
|
||||
struct tftpERROR {
|
||||
rtems_unsigned16 opcode;
|
||||
rtems_unsigned16 errorCode;
|
||||
uint16_t opcode;
|
||||
uint16_t errorCode;
|
||||
char errorMessage[TFTP_BUFSIZE];
|
||||
} tftpERROR;
|
||||
};
|
||||
@@ -126,7 +126,7 @@ struct tftpStream {
|
||||
/*
|
||||
* Last block number transferred
|
||||
*/
|
||||
rtems_unsigned16 blocknum;
|
||||
uint16_t blocknum;
|
||||
|
||||
/*
|
||||
* Data transfer socket
|
||||
@@ -289,8 +289,8 @@ sendStifle (struct tftpStream *tp, struct sockaddr_in *to)
|
||||
{
|
||||
int len;
|
||||
struct {
|
||||
rtems_unsigned16 opcode;
|
||||
rtems_unsigned16 errorCode;
|
||||
uint16_t opcode;
|
||||
uint16_t errorCode;
|
||||
char errorMessage[12];
|
||||
} msg;
|
||||
|
||||
@@ -539,8 +539,8 @@ static int rtems_tftp_eval_path(
|
||||
static int rtems_tftp_open_worker(
|
||||
rtems_libio_t *iop,
|
||||
char *full_path_name,
|
||||
unsigned32 flags,
|
||||
unsigned32 mode
|
||||
uint32_t flags,
|
||||
uint32_t mode
|
||||
)
|
||||
{
|
||||
struct tftpStream *tp;
|
||||
@@ -710,7 +710,7 @@ static int rtems_tftp_open_worker(
|
||||
&& (ntohs (tp->pkbuf.tftpDATA.blocknum) == 1)) {
|
||||
tp->nused = 0;
|
||||
tp->blocknum = 1;
|
||||
tp->nleft = len - 2 * sizeof (rtems_unsigned16);
|
||||
tp->nleft = len - 2 * sizeof (uint16_t );
|
||||
tp->eof = (tp->nleft < TFTP_BUFSIZE);
|
||||
if (sendAck (tp) != 0) {
|
||||
close (tp->socket);
|
||||
@@ -752,8 +752,8 @@ static int rtems_tftp_open_worker(
|
||||
static int rtems_tftp_open(
|
||||
rtems_libio_t *iop,
|
||||
const char *new_name,
|
||||
unsigned32 flags,
|
||||
unsigned32 mode
|
||||
uint32_t flags,
|
||||
uint32_t mode
|
||||
)
|
||||
{
|
||||
char *full_path_name;
|
||||
@@ -794,7 +794,7 @@ static int rtems_tftp_open(
|
||||
static ssize_t rtems_tftp_read(
|
||||
rtems_libio_t *iop,
|
||||
void *buffer,
|
||||
unsigned32 count
|
||||
uint32_t count
|
||||
)
|
||||
{
|
||||
char *bp;
|
||||
@@ -834,11 +834,11 @@ static ssize_t rtems_tftp_read(
|
||||
int len = getPacket (tp, retryCount);
|
||||
if (len >= (int)sizeof tp->pkbuf.tftpACK) {
|
||||
int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
|
||||
rtems_unsigned16 nextBlock = tp->blocknum + 1;
|
||||
uint16_t nextBlock = tp->blocknum + 1;
|
||||
if ((opcode == TFTP_OPCODE_DATA)
|
||||
&& (ntohs (tp->pkbuf.tftpDATA.blocknum) == nextBlock)) {
|
||||
tp->nused = 0;
|
||||
tp->nleft = len - 2 * sizeof (rtems_unsigned16);
|
||||
tp->nleft = len - 2 * sizeof (uint16_t );
|
||||
tp->eof = (tp->nleft < TFTP_BUFSIZE);
|
||||
tp->blocknum++;
|
||||
if (sendAck (tp) != 0)
|
||||
@@ -869,7 +869,7 @@ static int rtems_tftp_flush ( struct tftpStream *tp )
|
||||
int wlen, rlen;
|
||||
int retryCount = 0;
|
||||
|
||||
wlen = tp->nused + 2 * sizeof (rtems_unsigned16);
|
||||
wlen = tp->nused + 2 * sizeof (uint16_t );
|
||||
for (;;) {
|
||||
tp->pkbuf.tftpDATA.opcode = htons (TFTP_OPCODE_DATA);
|
||||
tp->pkbuf.tftpDATA.blocknum = htons (tp->blocknum);
|
||||
@@ -935,7 +935,7 @@ static int rtems_tftp_close(
|
||||
static ssize_t rtems_tftp_write(
|
||||
rtems_libio_t *iop,
|
||||
const void *buffer,
|
||||
unsigned32 count
|
||||
uint32_t count
|
||||
)
|
||||
{
|
||||
const char *bp;
|
||||
|
||||
@@ -45,10 +45,10 @@
|
||||
* A little more complicated on little endian CPUs
|
||||
*/
|
||||
|
||||
#define ntohl(_x) ((long) CPU_swap_u32((unsigned32)_x))
|
||||
#define ntohs(_x) ((short) CPU_swap_u16((unsigned16)_x))
|
||||
#define htonl(_x) ((long) CPU_swap_u32((unsigned32)_x))
|
||||
#define htons(_x) ((short) CPU_swap_u16((unsigned16)_x))
|
||||
#define ntohl(_x) ((long) CPU_swap_u32((uint32_t )_x))
|
||||
#define ntohs(_x) ((short) CPU_swap_u16((uint16_t )_x))
|
||||
#define htonl(_x) ((long) CPU_swap_u32((uint32_t )_x))
|
||||
#define htons(_x) ((short) CPU_swap_u16((uint16_t )_x))
|
||||
|
||||
#define NTOHS(x) (x) = ntohs(x)
|
||||
#define HTONS(x) (x) = htons(x)
|
||||
|
||||
@@ -388,7 +388,7 @@ static rtems_task ppp_txdaemon(rtems_task_argument arg)
|
||||
static void ppp_init(struct ppp_softc *sc)
|
||||
{
|
||||
rtems_status_code status;
|
||||
rtems_unsigned32 priority = 100;
|
||||
uint32_t priority = 100;
|
||||
|
||||
/* determine priority value */
|
||||
if ( rtems_bsdnet_config.network_task_priority ) {
|
||||
|
||||
@@ -175,7 +175,7 @@ void rtems_bsdnet_detach (struct rtems_bsdnet_ifconfig *ifconfig);
|
||||
/*
|
||||
* Interface configuration. The commands are listed in `sys/sockio.h'.
|
||||
*/
|
||||
int rtems_bsdnet_ifconfig (const char *ifname, unsigned32 cmd, void *param);
|
||||
int rtems_bsdnet_ifconfig (const char *ifname, uint32_t cmd, void *param);
|
||||
|
||||
void rtems_bsdnet_do_bootp (void);
|
||||
void rtems_bsdnet_do_bootp_and_rootfs (void);
|
||||
|
||||
@@ -19,7 +19,7 @@ typedef long long vm_ooffset_t;
|
||||
typedef unsigned int vm_pindex_t;
|
||||
typedef unsigned int vm_size_t;
|
||||
|
||||
#define _BSD_OFF_T_ rtems_signed32
|
||||
#define _BSD_OFF_T_ int32_t
|
||||
#define _BSD_PID_T_ rtems_id
|
||||
#define _BSD_VA_LIST_ char *
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ static rtems_id networkSemaphore;
|
||||
Semaphore_Control *the_networkSemaphore;
|
||||
#endif
|
||||
static rtems_id networkDaemonTid;
|
||||
static rtems_unsigned32 networkDaemonPriority;
|
||||
static uint32_t networkDaemonPriority;
|
||||
static void networkDaemon (void *task_argument);
|
||||
|
||||
/*
|
||||
@@ -507,7 +507,7 @@ networkDaemon (void *task_argument)
|
||||
rtems_event_set events;
|
||||
rtems_interval now;
|
||||
int ticksPassed;
|
||||
unsigned32 timeout;
|
||||
uint32_t timeout;
|
||||
struct callout *c;
|
||||
|
||||
for (;;) {
|
||||
@@ -759,12 +759,12 @@ rtems_bsdnet_log (int priority, const char *fmt, ...)
|
||||
u_int
|
||||
in_cksum_hdr (const void *ip)
|
||||
{
|
||||
rtems_unsigned32 sum;
|
||||
const rtems_unsigned16 *sp;
|
||||
uint32_t sum;
|
||||
const uint16_t *sp;
|
||||
int i;
|
||||
|
||||
sum = 0;
|
||||
sp = (rtems_unsigned16 *)ip;
|
||||
sp = (uint16_t *)ip;
|
||||
for (i = 0 ; i < 10 ; i++)
|
||||
sum += *sp++;
|
||||
while (sum > 0xFFFF)
|
||||
@@ -982,7 +982,7 @@ void rtems_bsdnet_detach (struct rtems_bsdnet_ifconfig *ifp)
|
||||
/*
|
||||
* Interface Configuration.
|
||||
*/
|
||||
int rtems_bsdnet_ifconfig (const char *ifname, unsigned32 cmd, void *param)
|
||||
int rtems_bsdnet_ifconfig (const char *ifname, uint32_t cmd, void *param)
|
||||
{
|
||||
int s, r = 0;
|
||||
struct ifreq ifreq;
|
||||
|
||||
@@ -684,19 +684,19 @@ rtems_bsdnet_close (rtems_libio_t *iop)
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
rtems_bsdnet_read (rtems_libio_t *iop, void *buffer, unsigned32 count)
|
||||
rtems_bsdnet_read (rtems_libio_t *iop, void *buffer, uint32_t count)
|
||||
{
|
||||
return recv (iop->data0, buffer, count, 0);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
rtems_bsdnet_write (rtems_libio_t *iop, const void *buffer, unsigned32 count)
|
||||
rtems_bsdnet_write (rtems_libio_t *iop, const void *buffer, uint32_t count)
|
||||
{
|
||||
return send (iop->data0, buffer, count, 0);
|
||||
}
|
||||
|
||||
static int
|
||||
so_ioctl (rtems_libio_t *iop, struct socket *so, unsigned32 command, void *buffer)
|
||||
so_ioctl (rtems_libio_t *iop, struct socket *so, uint32_t command, void *buffer)
|
||||
{
|
||||
switch (command) {
|
||||
case FIONBIO:
|
||||
@@ -723,7 +723,7 @@ so_ioctl (rtems_libio_t *iop, struct socket *so, unsigned32 command, void *buffe
|
||||
}
|
||||
|
||||
static int
|
||||
rtems_bsdnet_ioctl (rtems_libio_t *iop, unsigned32 command, void *buffer)
|
||||
rtems_bsdnet_ioctl (rtems_libio_t *iop, uint32_t command, void *buffer)
|
||||
{
|
||||
struct socket *so;
|
||||
int error;
|
||||
|
||||
Reference in New Issue
Block a user