retire PUBLIC, PRIVATE and FORWARD
This commit is contained in:
@@ -125,36 +125,36 @@ typedef struct arp_cache
|
||||
#define ACS_VALID 2
|
||||
#define ACS_UNREACHABLE 3
|
||||
|
||||
PRIVATE struct arp_hash_ent
|
||||
static struct arp_hash_ent
|
||||
{
|
||||
arp_cache_t *ahe_row[ARP_HASH_WIDTH];
|
||||
} arp_hash[ARP_HASH_NR];
|
||||
|
||||
PRIVATE arp_port_t *arp_port_table;
|
||||
PRIVATE arp_cache_t *arp_cache;
|
||||
PRIVATE int arp_cache_nr;
|
||||
static arp_port_t *arp_port_table;
|
||||
static arp_cache_t *arp_cache;
|
||||
static int arp_cache_nr;
|
||||
|
||||
FORWARD acc_t *arp_getdata ARGS(( int fd, size_t offset,
|
||||
static acc_t *arp_getdata ARGS(( int fd, size_t offset,
|
||||
size_t count, int for_ioctl ));
|
||||
FORWARD int arp_putdata ARGS(( int fd, size_t offset,
|
||||
static int arp_putdata ARGS(( int fd, size_t offset,
|
||||
acc_t *data, int for_ioctl ));
|
||||
FORWARD void arp_main ARGS(( arp_port_t *arp_port ));
|
||||
FORWARD void arp_timeout ARGS(( int ref, timer_t *timer ));
|
||||
FORWARD void setup_write ARGS(( arp_port_t *arp_port ));
|
||||
FORWARD void setup_read ARGS(( arp_port_t *arp_port ));
|
||||
FORWARD void do_reclist ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
FORWARD void process_arp_pkt ARGS(( arp_port_t *arp_port, acc_t *data ));
|
||||
FORWARD void client_reply ARGS(( arp_port_t *arp_port,
|
||||
static void arp_main ARGS(( arp_port_t *arp_port ));
|
||||
static void arp_timeout ARGS(( int ref, timer_t *timer ));
|
||||
static void setup_write ARGS(( arp_port_t *arp_port ));
|
||||
static void setup_read ARGS(( arp_port_t *arp_port ));
|
||||
static void do_reclist ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
static void process_arp_pkt ARGS(( arp_port_t *arp_port, acc_t *data ));
|
||||
static void client_reply ARGS(( arp_port_t *arp_port,
|
||||
ipaddr_t ipaddr, ether_addr_t *ethaddr ));
|
||||
FORWARD arp_cache_t *find_cache_ent ARGS(( arp_port_t *arp_port,
|
||||
static arp_cache_t *find_cache_ent ARGS(( arp_port_t *arp_port,
|
||||
ipaddr_t ipaddr ));
|
||||
FORWARD arp_cache_t *alloc_cache_ent ARGS(( int flags ));
|
||||
FORWARD void arp_buffree ARGS(( int priority ));
|
||||
static arp_cache_t *alloc_cache_ent ARGS(( int flags ));
|
||||
static void arp_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void arp_bufcheck ARGS(( void ));
|
||||
static void arp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
|
||||
PUBLIC void arp_prep()
|
||||
void arp_prep()
|
||||
{
|
||||
arp_port_table= alloc(eth_conf_nr * sizeof(arp_port_table[0]));
|
||||
|
||||
@@ -168,7 +168,7 @@ PUBLIC void arp_prep()
|
||||
arp_cache= alloc(arp_cache_nr * sizeof(arp_cache[0]));
|
||||
}
|
||||
|
||||
PUBLIC void arp_init()
|
||||
void arp_init()
|
||||
{
|
||||
arp_port_t *arp_port;
|
||||
arp_cache_t *cache;
|
||||
@@ -200,7 +200,7 @@ PUBLIC void arp_init()
|
||||
#endif
|
||||
}
|
||||
|
||||
PRIVATE void arp_main(arp_port)
|
||||
static void arp_main(arp_port)
|
||||
arp_port_t *arp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -264,7 +264,7 @@ arp_port_t *arp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE acc_t *arp_getdata (fd, offset, count, for_ioctl)
|
||||
static acc_t *arp_getdata (fd, offset, count, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -345,7 +345,7 @@ int for_ioctl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int arp_putdata (fd, offset, data, for_ioctl)
|
||||
static int arp_putdata (fd, offset, data, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -445,7 +445,7 @@ int for_ioctl;
|
||||
return EGENERIC;
|
||||
}
|
||||
|
||||
PRIVATE void setup_read(arp_port)
|
||||
static void setup_read(arp_port)
|
||||
arp_port_t *arp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -465,7 +465,7 @@ arp_port_t *arp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void setup_write(arp_port)
|
||||
static void setup_write(arp_port)
|
||||
arp_port_t *arp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -510,7 +510,7 @@ arp_port_t *arp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void do_reclist(ev, ev_arg)
|
||||
static void do_reclist(ev, ev_arg)
|
||||
event_t *ev;
|
||||
ev_arg_t ev_arg;
|
||||
{
|
||||
@@ -528,7 +528,7 @@ ev_arg_t ev_arg;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void process_arp_pkt (arp_port, data)
|
||||
static void process_arp_pkt (arp_port, data)
|
||||
arp_port_t *arp_port;
|
||||
acc_t *data;
|
||||
{
|
||||
@@ -690,7 +690,7 @@ acc_t *data;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void client_reply (arp_port, ipaddr, ethaddr)
|
||||
static void client_reply (arp_port, ipaddr, ethaddr)
|
||||
arp_port_t *arp_port;
|
||||
ipaddr_t ipaddr;
|
||||
ether_addr_t *ethaddr;
|
||||
@@ -698,7 +698,7 @@ ether_addr_t *ethaddr;
|
||||
(*arp_port->ap_arp_func)(arp_port->ap_ip_port, ipaddr, ethaddr);
|
||||
}
|
||||
|
||||
PRIVATE arp_cache_t *find_cache_ent (arp_port, ipaddr)
|
||||
static arp_cache_t *find_cache_ent (arp_port, ipaddr)
|
||||
arp_port_t *arp_port;
|
||||
ipaddr_t ipaddr;
|
||||
{
|
||||
@@ -747,7 +747,7 @@ ipaddr_t ipaddr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE arp_cache_t *alloc_cache_ent(flags)
|
||||
static arp_cache_t *alloc_cache_ent(flags)
|
||||
int flags;
|
||||
{
|
||||
arp_cache_t *cache, *old;
|
||||
@@ -812,7 +812,7 @@ int flags;
|
||||
return old;
|
||||
}
|
||||
|
||||
PUBLIC void arp_set_ipaddr (eth_port, ipaddr)
|
||||
void arp_set_ipaddr (eth_port, ipaddr)
|
||||
int eth_port;
|
||||
ipaddr_t ipaddr;
|
||||
{
|
||||
@@ -829,7 +829,7 @@ ipaddr_t ipaddr;
|
||||
arp_main(arp_port);
|
||||
}
|
||||
|
||||
PUBLIC int arp_set_cb(eth_port, ip_port, arp_func)
|
||||
int arp_set_cb(eth_port, ip_port, arp_func)
|
||||
int eth_port;
|
||||
int ip_port;
|
||||
arp_func_t arp_func;
|
||||
@@ -862,7 +862,7 @@ arp_func_t arp_func;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int arp_ip_eth (eth_port, ipaddr, ethaddr)
|
||||
int arp_ip_eth (eth_port, ipaddr, ethaddr)
|
||||
int eth_port;
|
||||
ipaddr_t ipaddr;
|
||||
ether_addr_t *ethaddr;
|
||||
@@ -960,7 +960,7 @@ ether_addr_t *ethaddr;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PUBLIC int arp_ioctl (eth_port, fd, req, get_userdata, put_userdata)
|
||||
int arp_ioctl (eth_port, fd, req, get_userdata, put_userdata)
|
||||
int eth_port;
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
@@ -1191,7 +1191,7 @@ put_userdata_t put_userdata;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void arp_timeout (ref, timer)
|
||||
static void arp_timeout (ref, timer)
|
||||
int ref;
|
||||
timer_t *timer;
|
||||
{
|
||||
@@ -1273,7 +1273,7 @@ timer_t *timer;
|
||||
arp_timeout, ref);
|
||||
}
|
||||
|
||||
PRIVATE void arp_buffree(priority)
|
||||
static void arp_buffree(priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -1334,7 +1334,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void arp_bufcheck()
|
||||
static void arp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
arp_port_t *arp_port;
|
||||
|
||||
@@ -60,35 +60,35 @@ typedef struct
|
||||
u16_t vh_vlan;
|
||||
} vlan_hdr_t;
|
||||
|
||||
FORWARD int eth_checkopt ARGS(( eth_fd_t *eth_fd ));
|
||||
FORWARD void hash_fd ARGS(( eth_fd_t *eth_fd ));
|
||||
FORWARD void unhash_fd ARGS(( eth_fd_t *eth_fd ));
|
||||
FORWARD void eth_buffree ARGS(( int priority ));
|
||||
static int eth_checkopt ARGS(( eth_fd_t *eth_fd ));
|
||||
static void hash_fd ARGS(( eth_fd_t *eth_fd ));
|
||||
static void unhash_fd ARGS(( eth_fd_t *eth_fd ));
|
||||
static void eth_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void eth_bufcheck ARGS(( void ));
|
||||
static void eth_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD int eth_sel_read ARGS(( eth_fd_t * ));
|
||||
FORWARD void packet2user ARGS(( eth_fd_t *fd, acc_t *pack, time_t exp_time ));
|
||||
FORWARD void reply_thr_get ARGS(( eth_fd_t *eth_fd,
|
||||
static int eth_sel_read ARGS(( eth_fd_t * ));
|
||||
static void packet2user ARGS(( eth_fd_t *fd, acc_t *pack, time_t exp_time ));
|
||||
static void reply_thr_get ARGS(( eth_fd_t *eth_fd,
|
||||
size_t result, int for_ioctl ));
|
||||
FORWARD void reply_thr_put ARGS(( eth_fd_t *eth_fd,
|
||||
static void reply_thr_put ARGS(( eth_fd_t *eth_fd,
|
||||
size_t result, int for_ioctl ));
|
||||
FORWARD void do_rec_conf ARGS(( eth_port_t *eth_port ));
|
||||
FORWARD u32_t compute_rec_conf ARGS(( eth_port_t *eth_port ));
|
||||
FORWARD acc_t *insert_vlan_hdr ARGS(( eth_port_t *eth_port, acc_t *pack ));
|
||||
static void do_rec_conf ARGS(( eth_port_t *eth_port ));
|
||||
static u32_t compute_rec_conf ARGS(( eth_port_t *eth_port ));
|
||||
static acc_t *insert_vlan_hdr ARGS(( eth_port_t *eth_port, acc_t *pack ));
|
||||
|
||||
PUBLIC eth_port_t *eth_port_table;
|
||||
PUBLIC int no_ethWritePort= 0;
|
||||
eth_port_t *eth_port_table;
|
||||
int no_ethWritePort= 0;
|
||||
|
||||
PRIVATE eth_fd_t eth_fd_table[ETH_FD_NR];
|
||||
PRIVATE ether_addr_t broadcast= { { 255, 255, 255, 255, 255, 255 } };
|
||||
static eth_fd_t eth_fd_table[ETH_FD_NR];
|
||||
static ether_addr_t broadcast= { { 255, 255, 255, 255, 255, 255 } };
|
||||
|
||||
PUBLIC void eth_prep()
|
||||
void eth_prep()
|
||||
{
|
||||
eth_port_table= alloc(eth_conf_nr * sizeof(eth_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void eth_init()
|
||||
void eth_init()
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@@ -123,7 +123,7 @@ PUBLIC void eth_init()
|
||||
osdep_eth_init();
|
||||
}
|
||||
|
||||
PUBLIC int eth_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
int eth_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port, srfd;
|
||||
get_userdata_t get_userdata;
|
||||
@@ -165,7 +165,7 @@ select_res_t select_res;
|
||||
return i;
|
||||
}
|
||||
|
||||
PUBLIC int eth_ioctl(fd, req)
|
||||
int eth_ioctl(fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -416,7 +416,7 @@ printf("eth_ioctl: setting etp_getstat in port %d to %p\n",
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int eth_write(fd, count)
|
||||
int eth_write(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -479,7 +479,7 @@ size_t count;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int eth_send(fd, data, data_len)
|
||||
int eth_send(fd, data, data_len)
|
||||
int fd;
|
||||
acc_t *data;
|
||||
size_t data_len;
|
||||
@@ -564,7 +564,7 @@ size_t data_len;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int eth_read (fd, count)
|
||||
int eth_read (fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -602,7 +602,7 @@ size_t count;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PUBLIC int eth_cancel(fd, which_operation)
|
||||
int eth_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -654,7 +654,7 @@ int which_operation;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int eth_select(fd, operations)
|
||||
int eth_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -685,7 +685,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PUBLIC void eth_close(fd)
|
||||
void eth_close(fd)
|
||||
int fd;
|
||||
{
|
||||
eth_fd_t *eth_fd;
|
||||
@@ -711,7 +711,7 @@ int fd;
|
||||
do_rec_conf(eth_port);
|
||||
}
|
||||
|
||||
PUBLIC void eth_loop_ev(ev, ev_arg)
|
||||
void eth_loop_ev(ev, ev_arg)
|
||||
event_t *ev;
|
||||
ev_arg_t ev_arg;
|
||||
{
|
||||
@@ -733,7 +733,7 @@ ev_arg_t ev_arg;
|
||||
eth_restart_write(eth_port);
|
||||
}
|
||||
|
||||
PRIVATE int eth_checkopt (eth_fd)
|
||||
static int eth_checkopt (eth_fd)
|
||||
eth_fd_t *eth_fd;
|
||||
{
|
||||
/* bug: we don't check access modes yet */
|
||||
@@ -769,7 +769,7 @@ eth_fd_t *eth_fd;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void hash_fd(eth_fd)
|
||||
static void hash_fd(eth_fd)
|
||||
eth_fd_t *eth_fd;
|
||||
{
|
||||
eth_port_t *eth_port;
|
||||
@@ -792,7 +792,7 @@ eth_fd_t *eth_fd;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void unhash_fd(eth_fd)
|
||||
static void unhash_fd(eth_fd)
|
||||
eth_fd_t *eth_fd;
|
||||
{
|
||||
eth_port_t *eth_port;
|
||||
@@ -825,7 +825,7 @@ eth_fd_t *eth_fd;
|
||||
*eth_fd_p= curr->ef_type_next;
|
||||
}
|
||||
|
||||
PUBLIC void eth_restart_write(eth_port)
|
||||
void eth_restart_write(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
eth_fd_t *eth_fd;
|
||||
@@ -845,7 +845,7 @@ eth_port_t *eth_port;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void eth_arrive (eth_port, pack, pack_size)
|
||||
void eth_arrive (eth_port, pack, pack_size)
|
||||
eth_port_t *eth_port;
|
||||
acc_t *pack;
|
||||
size_t pack_size;
|
||||
@@ -1031,7 +1031,7 @@ size_t pack_size;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void eth_reg_vlan(eth_port, vlan_port)
|
||||
void eth_reg_vlan(eth_port, vlan_port)
|
||||
eth_port_t *eth_port;
|
||||
eth_port_t *vlan_port;
|
||||
{
|
||||
@@ -1044,7 +1044,7 @@ eth_port_t *vlan_port;
|
||||
eth_port->etp_vlan_tab[h]= vlan_port;
|
||||
}
|
||||
|
||||
PUBLIC void eth_restart_ioctl(eth_port)
|
||||
void eth_restart_ioctl(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
int i, r;
|
||||
@@ -1111,7 +1111,7 @@ printf("eth_restart_ioctl: clearing etp_getstat in port %d\n",
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int eth_sel_read (eth_fd)
|
||||
static int eth_sel_read (eth_fd)
|
||||
eth_fd_t *eth_fd;
|
||||
{
|
||||
acc_t *tmp_acc, *next_acc;
|
||||
@@ -1136,7 +1136,7 @@ eth_fd_t *eth_fd;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void packet2user (eth_fd, pack, exp_time)
|
||||
static void packet2user (eth_fd, pack, exp_time)
|
||||
eth_fd_t *eth_fd;
|
||||
acc_t *pack;
|
||||
time_t exp_time;
|
||||
@@ -1196,7 +1196,7 @@ time_t exp_time;
|
||||
reply_thr_put(eth_fd, result, FALSE);
|
||||
}
|
||||
|
||||
PRIVATE void eth_buffree (priority)
|
||||
static void eth_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -1231,7 +1231,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void eth_bufcheck()
|
||||
static void eth_bufcheck()
|
||||
{
|
||||
int i;
|
||||
eth_fd_t *eth_fd;
|
||||
@@ -1253,7 +1253,7 @@ PRIVATE void eth_bufcheck()
|
||||
}
|
||||
#endif
|
||||
|
||||
PRIVATE void do_rec_conf(eth_port)
|
||||
static void do_rec_conf(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
int i;
|
||||
@@ -1276,7 +1276,7 @@ eth_port_t *eth_port;
|
||||
eth_set_rec_conf(eth_port, flags);
|
||||
}
|
||||
|
||||
PRIVATE u32_t compute_rec_conf(eth_port)
|
||||
static u32_t compute_rec_conf(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
eth_fd_t *eth_fd;
|
||||
@@ -1298,7 +1298,7 @@ eth_port_t *eth_port;
|
||||
return flags;
|
||||
}
|
||||
|
||||
PRIVATE void reply_thr_get (eth_fd, result, for_ioctl)
|
||||
static void reply_thr_get (eth_fd, result, for_ioctl)
|
||||
eth_fd_t *eth_fd;
|
||||
size_t result;
|
||||
int for_ioctl;
|
||||
@@ -1309,7 +1309,7 @@ int for_ioctl;
|
||||
assert (!data);
|
||||
}
|
||||
|
||||
PRIVATE void reply_thr_put (eth_fd, result, for_ioctl)
|
||||
static void reply_thr_put (eth_fd, result, for_ioctl)
|
||||
eth_fd_t *eth_fd;
|
||||
size_t result;
|
||||
int for_ioctl;
|
||||
@@ -1321,7 +1321,7 @@ int for_ioctl;
|
||||
assert(error == NW_OK);
|
||||
}
|
||||
|
||||
PRIVATE acc_t *insert_vlan_hdr(eth_port, pack)
|
||||
static acc_t *insert_vlan_hdr(eth_port, pack)
|
||||
eth_port_t *eth_port;
|
||||
acc_t *pack;
|
||||
{
|
||||
|
||||
@@ -47,50 +47,50 @@ typedef struct icmp_port
|
||||
#define ICPS_MAIN 2
|
||||
#define ICPS_ERROR 3
|
||||
|
||||
PRIVATE icmp_port_t *icmp_port_table;
|
||||
static icmp_port_t *icmp_port_table;
|
||||
|
||||
FORWARD void icmp_main ARGS(( icmp_port_t *icmp_port ));
|
||||
FORWARD acc_t *icmp_getdata ARGS(( int port, size_t offset,
|
||||
static void icmp_main ARGS(( icmp_port_t *icmp_port ));
|
||||
static acc_t *icmp_getdata ARGS(( int port, size_t offset,
|
||||
size_t count, int for_ioctl ));
|
||||
FORWARD int icmp_putdata ARGS(( int port, size_t offset,
|
||||
static int icmp_putdata ARGS(( int port, size_t offset,
|
||||
acc_t *data, int for_ioctl ));
|
||||
FORWARD void icmp_read ARGS(( icmp_port_t *icmp_port ));
|
||||
FORWARD void process_data ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_read ARGS(( icmp_port_t *icmp_port ));
|
||||
static void process_data ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *data ));
|
||||
FORWARD u16_t icmp_pack_oneCsum ARGS(( acc_t *ip_pack ));
|
||||
FORWARD void icmp_echo_request ARGS(( icmp_port_t *icmp_port,
|
||||
static u16_t icmp_pack_oneCsum ARGS(( acc_t *ip_pack ));
|
||||
static void icmp_echo_request ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *ip_pack, int ip_hdr_len, ip_hdr_t *ip_hdr,
|
||||
acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD void icmp_dst_unreach ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_dst_unreach ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *ip_pack, int ip_hdr_len, ip_hdr_t *ip_hdr,
|
||||
acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD void icmp_time_exceeded ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_time_exceeded ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *ip_pack, int ip_hdr_len, ip_hdr_t *ip_hdr,
|
||||
acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD void icmp_router_advertisement ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_router_advertisement ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD void icmp_redirect ARGS(( icmp_port_t *icmp_port,
|
||||
static void icmp_redirect ARGS(( icmp_port_t *icmp_port,
|
||||
ip_hdr_t *ip_hdr, acc_t *icmp_pack, int icmp_len,
|
||||
icmp_hdr_t *icmp_hdr ));
|
||||
FORWARD acc_t *make_repl_ip ARGS(( ip_hdr_t *ip_hdr,
|
||||
static acc_t *make_repl_ip ARGS(( ip_hdr_t *ip_hdr,
|
||||
int ip_len ));
|
||||
FORWARD void enqueue_pack ARGS(( icmp_port_t *icmp_port,
|
||||
static void enqueue_pack ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *reply_ip_hdr ));
|
||||
FORWARD int icmp_rate_limit ARGS(( icmp_port_t *icmp_port,
|
||||
static int icmp_rate_limit ARGS(( icmp_port_t *icmp_port,
|
||||
acc_t *reply_ip_hdr ));
|
||||
FORWARD void icmp_write ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
FORWARD void icmp_buffree ARGS(( int priority ));
|
||||
FORWARD acc_t *icmp_err_pack ARGS(( acc_t *pack, icmp_hdr_t **icmp_hdr_pp ));
|
||||
static void icmp_write ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
static void icmp_buffree ARGS(( int priority ));
|
||||
static acc_t *icmp_err_pack ARGS(( acc_t *pack, icmp_hdr_t **icmp_hdr_pp ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void icmp_bufcheck ARGS(( void ));
|
||||
static void icmp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
|
||||
PUBLIC void icmp_prep()
|
||||
void icmp_prep()
|
||||
{
|
||||
icmp_port_table= alloc(ip_conf_nr * sizeof(icmp_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void icmp_init()
|
||||
void icmp_init()
|
||||
{
|
||||
int i;
|
||||
icmp_port_t *icmp_port;
|
||||
@@ -120,7 +120,7 @@ PUBLIC void icmp_init()
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void icmp_main(icmp_port)
|
||||
static void icmp_main(icmp_port)
|
||||
icmp_port_t *icmp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -160,7 +160,7 @@ icmp_port_t *icmp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE acc_t *icmp_getdata(port, offset, count, for_ioctl)
|
||||
static acc_t *icmp_getdata(port, offset, count, for_ioctl)
|
||||
int port;
|
||||
size_t offset, count;
|
||||
int for_ioctl;
|
||||
@@ -229,7 +229,7 @@ int for_ioctl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE int icmp_putdata(port, offset, data, for_ioctl)
|
||||
static int icmp_putdata(port, offset, data, for_ioctl)
|
||||
int port;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -270,7 +270,7 @@ int for_ioctl;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void icmp_read(icmp_port)
|
||||
static void icmp_read(icmp_port)
|
||||
icmp_port_t *icmp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -289,7 +289,7 @@ icmp_port_t *icmp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void icmp_snd_time_exceeded(port_nr, pack, code)
|
||||
void icmp_snd_time_exceeded(port_nr, pack, code)
|
||||
int port_nr;
|
||||
acc_t *pack;
|
||||
int code;
|
||||
@@ -315,7 +315,7 @@ int code;
|
||||
enqueue_pack(icmp_port, pack);
|
||||
}
|
||||
|
||||
PUBLIC void icmp_snd_redirect(port_nr, pack, code, gw)
|
||||
void icmp_snd_redirect(port_nr, pack, code, gw)
|
||||
int port_nr;
|
||||
acc_t *pack;
|
||||
int code;
|
||||
@@ -345,7 +345,7 @@ ipaddr_t gw;
|
||||
enqueue_pack(icmp_port, pack);
|
||||
}
|
||||
|
||||
PUBLIC void icmp_snd_unreachable(port_nr, pack, code)
|
||||
void icmp_snd_unreachable(port_nr, pack, code)
|
||||
int port_nr;
|
||||
acc_t *pack;
|
||||
int code;
|
||||
@@ -371,7 +371,7 @@ int code;
|
||||
enqueue_pack(icmp_port, pack);
|
||||
}
|
||||
|
||||
PUBLIC void icmp_snd_mtu(
|
||||
void icmp_snd_mtu(
|
||||
int port_nr,
|
||||
acc_t *pack,
|
||||
u16_t mtu
|
||||
@@ -402,7 +402,7 @@ PUBLIC void icmp_snd_mtu(
|
||||
enqueue_pack(icmp_port, pack);
|
||||
}
|
||||
|
||||
PRIVATE void process_data(icmp_port, data)
|
||||
static void process_data(icmp_port, data)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *data;
|
||||
{
|
||||
@@ -499,7 +499,7 @@ acc_t *data;
|
||||
bf_afree(icmp_data);
|
||||
}
|
||||
|
||||
PRIVATE void icmp_echo_request(icmp_port, ip_data, ip_len, ip_hdr,
|
||||
static void icmp_echo_request(icmp_port, ip_data, ip_len, ip_hdr,
|
||||
icmp_data, icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *ip_data, *icmp_data;
|
||||
@@ -586,7 +586,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
enqueue_pack(icmp_port, repl_ip_hdr);
|
||||
}
|
||||
|
||||
PRIVATE u16_t icmp_pack_oneCsum(icmp_pack)
|
||||
static u16_t icmp_pack_oneCsum(icmp_pack)
|
||||
acc_t *icmp_pack;
|
||||
{
|
||||
u16_t prev;
|
||||
@@ -628,7 +628,7 @@ acc_t *icmp_pack;
|
||||
return prev;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *make_repl_ip(ip_hdr, ip_len)
|
||||
static acc_t *make_repl_ip(ip_hdr, ip_len)
|
||||
ip_hdr_t *ip_hdr;
|
||||
int ip_len;
|
||||
{
|
||||
@@ -658,7 +658,7 @@ int ip_len;
|
||||
return repl;
|
||||
}
|
||||
|
||||
PRIVATE void enqueue_pack(icmp_port, reply_ip_hdr)
|
||||
static void enqueue_pack(icmp_port, reply_ip_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *reply_ip_hdr;
|
||||
{
|
||||
@@ -702,7 +702,7 @@ acc_t *reply_ip_hdr;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int icmp_rate_limit(icmp_port, reply_ip_hdr)
|
||||
static int icmp_rate_limit(icmp_port, reply_ip_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *reply_ip_hdr;
|
||||
{
|
||||
@@ -773,7 +773,7 @@ acc_t *reply_ip_hdr;
|
||||
return -1;
|
||||
}
|
||||
|
||||
PRIVATE void icmp_write(ev, ev_arg)
|
||||
static void icmp_write(ev, ev_arg)
|
||||
event_t *ev;
|
||||
ev_arg_t ev_arg;
|
||||
{
|
||||
@@ -816,7 +816,7 @@ ev_arg_t ev_arg;
|
||||
icmp_port->icp_flags &= ~ICPF_WRITE_IP;
|
||||
}
|
||||
|
||||
PRIVATE void icmp_buffree(priority)
|
||||
static void icmp_buffree(priority)
|
||||
int priority;
|
||||
{
|
||||
acc_t *tmp_acc;
|
||||
@@ -840,7 +840,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void icmp_bufcheck()
|
||||
static void icmp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
icmp_port_t *icmp_port;
|
||||
@@ -858,7 +858,7 @@ PRIVATE void icmp_bufcheck()
|
||||
}
|
||||
#endif
|
||||
|
||||
PRIVATE void icmp_dst_unreach(icmp_port, ip_pack, ip_hdr_len, ip_hdr, icmp_pack,
|
||||
static void icmp_dst_unreach(icmp_port, ip_pack, ip_hdr_len, ip_hdr, icmp_pack,
|
||||
icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *ip_pack;
|
||||
@@ -941,7 +941,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
bf_afree(old_ip_pack);
|
||||
}
|
||||
|
||||
PRIVATE void icmp_time_exceeded(icmp_port, ip_pack, ip_hdr_len, ip_hdr,
|
||||
static void icmp_time_exceeded(icmp_port, ip_pack, ip_hdr_len, ip_hdr,
|
||||
icmp_pack, icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *ip_pack;
|
||||
@@ -990,7 +990,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
bf_afree(old_ip_pack);
|
||||
}
|
||||
|
||||
PRIVATE void icmp_router_advertisement(icmp_port, icmp_pack, icmp_len, icmp_hdr)
|
||||
static void icmp_router_advertisement(icmp_port, icmp_pack, icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
acc_t *icmp_pack;
|
||||
int icmp_len;
|
||||
@@ -1063,7 +1063,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void icmp_redirect(icmp_port, ip_hdr, icmp_pack, icmp_len, icmp_hdr)
|
||||
static void icmp_redirect(icmp_port, ip_hdr, icmp_pack, icmp_len, icmp_hdr)
|
||||
icmp_port_t *icmp_port;
|
||||
ip_hdr_t *ip_hdr;
|
||||
acc_t *icmp_pack;
|
||||
@@ -1108,7 +1108,7 @@ icmp_hdr_t *icmp_hdr;
|
||||
bf_afree(old_ip_pack);
|
||||
}
|
||||
|
||||
PRIVATE acc_t *icmp_err_pack(pack, icmp_hdr_pp)
|
||||
static acc_t *icmp_err_pack(pack, icmp_hdr_pp)
|
||||
acc_t *pack;
|
||||
icmp_hdr_t **icmp_hdr_pp;
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ Copyright 1995 Philip Homburg
|
||||
#include "inet.h"
|
||||
#include "io.h"
|
||||
|
||||
PUBLIC void writeIpAddr(addr)
|
||||
void writeIpAddr(addr)
|
||||
ipaddr_t addr;
|
||||
{
|
||||
#define addrInBytes ((u8_t *)&addr)
|
||||
@@ -19,7 +19,7 @@ ipaddr_t addr;
|
||||
#undef addrInBytes
|
||||
}
|
||||
|
||||
PUBLIC void writeEtherAddr(addr)
|
||||
void writeEtherAddr(addr)
|
||||
ether_addr_t *addr;
|
||||
{
|
||||
#define addrInBytes ((u8_t *)addr->ea_addr)
|
||||
|
||||
@@ -23,27 +23,27 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void ip_close ARGS(( int fd ));
|
||||
FORWARD int ip_cancel ARGS(( int fd, int which_operation ));
|
||||
FORWARD int ip_select ARGS(( int fd, unsigned operations ));
|
||||
static void ip_close ARGS(( int fd ));
|
||||
static int ip_cancel ARGS(( int fd, int which_operation ));
|
||||
static int ip_select ARGS(( int fd, unsigned operations ));
|
||||
|
||||
FORWARD void ip_buffree ARGS(( int priority ));
|
||||
static void ip_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void ip_bufcheck ARGS(( void ));
|
||||
static void ip_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD void ip_bad_callback ARGS(( struct ip_port *ip_port ));
|
||||
static void ip_bad_callback ARGS(( struct ip_port *ip_port ));
|
||||
|
||||
PUBLIC ip_port_t *ip_port_table;
|
||||
PUBLIC ip_fd_t ip_fd_table[IP_FD_NR];
|
||||
PUBLIC ip_ass_t ip_ass_table[IP_ASS_NR];
|
||||
ip_port_t *ip_port_table;
|
||||
ip_fd_t ip_fd_table[IP_FD_NR];
|
||||
ip_ass_t ip_ass_table[IP_ASS_NR];
|
||||
|
||||
PUBLIC void ip_prep()
|
||||
void ip_prep()
|
||||
{
|
||||
ip_port_table= alloc(ip_conf_nr * sizeof(ip_port_table[0]));
|
||||
icmp_prep();
|
||||
}
|
||||
|
||||
PUBLIC void ip_init()
|
||||
void ip_init()
|
||||
{
|
||||
int i, j, result;
|
||||
ip_ass_t *ip_ass;
|
||||
@@ -137,7 +137,7 @@ PUBLIC void ip_init()
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int ip_cancel (fd, which_operation)
|
||||
static int ip_cancel (fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -180,7 +180,7 @@ int which_operation;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int ip_select(fd, operations)
|
||||
static int ip_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -211,7 +211,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PUBLIC int ip_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
int ip_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -258,7 +258,7 @@ select_res_t select_res;
|
||||
return i;
|
||||
}
|
||||
|
||||
PRIVATE void ip_close (fd)
|
||||
static void ip_close (fd)
|
||||
int fd;
|
||||
{
|
||||
ip_fd_t *ip_fd;
|
||||
@@ -280,7 +280,7 @@ int fd;
|
||||
ip_fd->if_flags= IFF_EMPTY;
|
||||
}
|
||||
|
||||
PRIVATE void ip_buffree(priority)
|
||||
static void ip_buffree(priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -423,7 +423,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void ip_bufcheck()
|
||||
static void ip_bufcheck()
|
||||
{
|
||||
int i;
|
||||
ip_port_t *ip_port;
|
||||
@@ -482,7 +482,7 @@ PRIVATE void ip_bufcheck()
|
||||
}
|
||||
#endif /* BUF_CONSISTENCY_CHECK */
|
||||
|
||||
PRIVATE void ip_bad_callback(ip_port)
|
||||
static void ip_bad_callback(ip_port)
|
||||
struct ip_port *ip_port;
|
||||
{
|
||||
ip_panic(( "no callback filled in for port %d", ip_port->ip_port ));
|
||||
|
||||
@@ -29,34 +29,34 @@ typedef struct xmit_hdr
|
||||
ipaddr_t xh_ipaddr;
|
||||
} xmit_hdr_t;
|
||||
|
||||
PRIVATE ether_addr_t broadcast_ethaddr=
|
||||
static ether_addr_t broadcast_ethaddr=
|
||||
{
|
||||
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
|
||||
};
|
||||
PRIVATE ether_addr_t ipmulticast_ethaddr=
|
||||
static ether_addr_t ipmulticast_ethaddr=
|
||||
{
|
||||
{ 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 }
|
||||
};
|
||||
|
||||
FORWARD void do_eth_read ARGS(( ip_port_t *port ));
|
||||
FORWARD acc_t *get_eth_data ARGS(( int fd, size_t offset,
|
||||
static void do_eth_read ARGS(( ip_port_t *port ));
|
||||
static acc_t *get_eth_data ARGS(( int fd, size_t offset,
|
||||
size_t count, int for_ioctl ));
|
||||
FORWARD int put_eth_data ARGS(( int fd, size_t offset,
|
||||
static int put_eth_data ARGS(( int fd, size_t offset,
|
||||
acc_t *data, int for_ioctl ));
|
||||
FORWARD void ipeth_main ARGS(( ip_port_t *port ));
|
||||
FORWARD void ipeth_set_ipaddr ARGS(( ip_port_t *port ));
|
||||
FORWARD void ipeth_restart_send ARGS(( ip_port_t *ip_port ));
|
||||
FORWARD int ipeth_send ARGS(( struct ip_port *ip_port, ipaddr_t dest,
|
||||
static void ipeth_main ARGS(( ip_port_t *port ));
|
||||
static void ipeth_set_ipaddr ARGS(( ip_port_t *port ));
|
||||
static void ipeth_restart_send ARGS(( ip_port_t *ip_port ));
|
||||
static int ipeth_send ARGS(( struct ip_port *ip_port, ipaddr_t dest,
|
||||
acc_t *pack, int type ));
|
||||
FORWARD void ipeth_arp_reply ARGS(( int ip_port_nr, ipaddr_t ipaddr,
|
||||
static void ipeth_arp_reply ARGS(( int ip_port_nr, ipaddr_t ipaddr,
|
||||
ether_addr_t *dst_ether_ptr ));
|
||||
FORWARD int ipeth_update_ttl ARGS(( time_t enq_time, time_t now,
|
||||
static int ipeth_update_ttl ARGS(( time_t enq_time, time_t now,
|
||||
acc_t *eth_pack ));
|
||||
FORWARD void ip_eth_arrived ARGS(( int port, acc_t *pack,
|
||||
static void ip_eth_arrived ARGS(( int port, acc_t *pack,
|
||||
size_t pack_size ));
|
||||
|
||||
|
||||
PUBLIC int ipeth_init(ip_port)
|
||||
int ipeth_init(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
assert(BUF_S >= sizeof(xmit_hdr_t));
|
||||
@@ -85,7 +85,7 @@ ip_port_t *ip_port;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void ipeth_main(ip_port)
|
||||
static void ipeth_main(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
int result;
|
||||
@@ -137,7 +137,7 @@ ip_port_t *ip_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE acc_t *get_eth_data (fd, offset, count, for_ioctl)
|
||||
static acc_t *get_eth_data (fd, offset, count, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -206,7 +206,7 @@ int for_ioctl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int put_eth_data (port, offset, data, for_ioctl)
|
||||
static int put_eth_data (port, offset, data, for_ioctl)
|
||||
int port;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -254,7 +254,7 @@ int for_ioctl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
PRIVATE void ipeth_set_ipaddr(ip_port)
|
||||
static void ipeth_set_ipaddr(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
arp_set_ipaddr (ip_port->ip_dl.dl_eth.de_port, ip_port->ip_ipaddr);
|
||||
@@ -262,7 +262,7 @@ ip_port_t *ip_port;
|
||||
ipeth_main(ip_port);
|
||||
}
|
||||
|
||||
PRIVATE int ipeth_send(ip_port, dest, pack, type)
|
||||
static int ipeth_send(ip_port, dest, pack, type)
|
||||
struct ip_port *ip_port;
|
||||
ipaddr_t dest;
|
||||
acc_t *pack;
|
||||
@@ -403,7 +403,7 @@ int type;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void ipeth_restart_send(ip_port)
|
||||
static void ipeth_restart_send(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
time_t now, enq_time;
|
||||
@@ -514,7 +514,7 @@ ip_port_t *ip_port;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void ipeth_arp_reply(ip_port_nr, ipaddr, eth_addr)
|
||||
static void ipeth_arp_reply(ip_port_nr, ipaddr, eth_addr)
|
||||
int ip_port_nr;
|
||||
ipaddr_t ipaddr;
|
||||
ether_addr_t *eth_addr;
|
||||
@@ -630,7 +630,7 @@ ether_addr_t *eth_addr;
|
||||
ipeth_restart_send(ip_port);
|
||||
}
|
||||
|
||||
PRIVATE int ipeth_update_ttl(enq_time, now, eth_pack)
|
||||
static int ipeth_update_ttl(enq_time, now, eth_pack)
|
||||
time_t enq_time;
|
||||
time_t now;
|
||||
acc_t *eth_pack;
|
||||
@@ -670,7 +670,7 @@ acc_t *eth_pack;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void do_eth_read(ip_port)
|
||||
static void do_eth_read(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
int result;
|
||||
@@ -698,7 +698,7 @@ ip_port_t *ip_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void ip_eth_arrived(port, pack, pack_size)
|
||||
static void ip_eth_arrived(port, pack, pack_size)
|
||||
int port;
|
||||
acc_t *pack;
|
||||
size_t pack_size;
|
||||
|
||||
@@ -19,12 +19,12 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD int ip_checkopt ARGS(( ip_fd_t *ip_fd ));
|
||||
FORWARD void reply_thr_get ARGS(( ip_fd_t *ip_fd, size_t
|
||||
static int ip_checkopt ARGS(( ip_fd_t *ip_fd ));
|
||||
static void reply_thr_get ARGS(( ip_fd_t *ip_fd, size_t
|
||||
reply, int for_ioctl ));
|
||||
FORWARD void report_addr ARGS(( ip_port_t *ip_port ));
|
||||
static void report_addr ARGS(( ip_port_t *ip_port ));
|
||||
|
||||
PUBLIC int ip_ioctl (fd, req)
|
||||
int ip_ioctl (fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -450,7 +450,7 @@ ioreq_t req;
|
||||
(acc_t *)0, TRUE);
|
||||
}
|
||||
|
||||
PUBLIC void ip_hash_proto(ip_fd)
|
||||
void ip_hash_proto(ip_fd)
|
||||
ip_fd_t *ip_fd;
|
||||
{
|
||||
ip_port_t *ip_port;
|
||||
@@ -470,7 +470,7 @@ ip_fd_t *ip_fd;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void ip_unhash_proto(ip_fd)
|
||||
void ip_unhash_proto(ip_fd)
|
||||
ip_fd_t *ip_fd;
|
||||
{
|
||||
ip_port_t *ip_port;
|
||||
@@ -500,7 +500,7 @@ ip_fd_t *ip_fd;
|
||||
*ip_fd_p= curr->if_proto_next;
|
||||
}
|
||||
|
||||
PUBLIC int ip_setconf(ip_port_nr, ipconf)
|
||||
int ip_setconf(ip_port_nr, ipconf)
|
||||
int ip_port_nr;
|
||||
nwio_ipconf_t *ipconf;
|
||||
{
|
||||
@@ -576,7 +576,7 @@ nwio_ipconf_t *ipconf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int ip_checkopt (ip_fd)
|
||||
static int ip_checkopt (ip_fd)
|
||||
ip_fd_t *ip_fd;
|
||||
{
|
||||
/* bug: we don't check access modes yet */
|
||||
@@ -621,7 +621,7 @@ ip_fd_t *ip_fd;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void reply_thr_get(ip_fd, reply, for_ioctl)
|
||||
static void reply_thr_get(ip_fd, reply, for_ioctl)
|
||||
ip_fd_t *ip_fd;
|
||||
size_t reply;
|
||||
int for_ioctl;
|
||||
@@ -632,7 +632,7 @@ int for_ioctl;
|
||||
assert (!result);
|
||||
}
|
||||
|
||||
PRIVATE void report_addr(ip_port)
|
||||
static void report_addr(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
int i, hdr_len;
|
||||
|
||||
@@ -15,12 +15,12 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
PUBLIC ipaddr_t ip_get_netmask (ipaddr_t hostaddr)
|
||||
ipaddr_t ip_get_netmask (ipaddr_t hostaddr)
|
||||
{
|
||||
return ip_netmask(ip_nettype(hostaddr));
|
||||
}
|
||||
|
||||
PUBLIC int ip_chk_hdropt (u8_t *opt, int optlen)
|
||||
int ip_chk_hdropt (u8_t *opt, int optlen)
|
||||
{
|
||||
int i, security_present= FALSE, lose_source_present= FALSE,
|
||||
strict_source_present= FALSE, record_route_present= FALSE,
|
||||
@@ -119,7 +119,7 @@ PUBLIC int ip_chk_hdropt (u8_t *opt, int optlen)
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC void ip_print_frags(acc_t *acc)
|
||||
void ip_print_frags(acc_t *acc)
|
||||
{
|
||||
#if DEBUG
|
||||
ip_hdr_t *ip_hdr;
|
||||
@@ -147,14 +147,14 @@ assert (acc->acc_length >= IP_MIN_HDR_SIZE);
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC ipaddr_t ip_get_ifaddr(int port_nr)
|
||||
ipaddr_t ip_get_ifaddr(int port_nr)
|
||||
{
|
||||
assert(port_nr >= 0 && port_nr < ip_conf_nr);
|
||||
|
||||
return ip_port_table[port_nr].ip_ipaddr;
|
||||
}
|
||||
|
||||
PUBLIC nettype_t ip_nettype(ipaddr_t ipaddr)
|
||||
nettype_t ip_nettype(ipaddr_t ipaddr)
|
||||
{
|
||||
u8_t highbyte;
|
||||
nettype_t nettype;
|
||||
@@ -192,7 +192,7 @@ PUBLIC nettype_t ip_nettype(ipaddr_t ipaddr)
|
||||
return nettype;
|
||||
}
|
||||
|
||||
PUBLIC ipaddr_t ip_netmask(nettype_t nettype)
|
||||
ipaddr_t ip_netmask(nettype_t nettype)
|
||||
{
|
||||
switch(nettype)
|
||||
{
|
||||
@@ -206,7 +206,7 @@ PUBLIC ipaddr_t ip_netmask(nettype_t nettype)
|
||||
}
|
||||
|
||||
#if 0
|
||||
PUBLIC char *ip_nettoa(nettype_t nettype)
|
||||
char *ip_nettoa(nettype_t nettype)
|
||||
{
|
||||
switch(nettype)
|
||||
{
|
||||
|
||||
@@ -19,12 +19,12 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void ipps_main ARGS(( ip_port_t *ip_port ));
|
||||
FORWARD void ipps_set_ipaddr ARGS(( ip_port_t *ip_port ));
|
||||
FORWARD int ipps_send ARGS(( struct ip_port *ip_port, ipaddr_t dest,
|
||||
static void ipps_main ARGS(( ip_port_t *ip_port ));
|
||||
static void ipps_set_ipaddr ARGS(( ip_port_t *ip_port ));
|
||||
static int ipps_send ARGS(( struct ip_port *ip_port, ipaddr_t dest,
|
||||
acc_t *pack, int type ));
|
||||
|
||||
PUBLIC int ipps_init(ip_port)
|
||||
int ipps_init(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
int result;
|
||||
@@ -40,7 +40,7 @@ ip_port_t *ip_port;
|
||||
return result;
|
||||
}
|
||||
|
||||
PUBLIC void ipps_get(ip_port_nr)
|
||||
void ipps_get(ip_port_nr)
|
||||
int ip_port_nr;
|
||||
{
|
||||
int result;
|
||||
@@ -112,7 +112,7 @@ int ip_port_nr;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void ipps_put(ip_port_nr, nexthop, pack)
|
||||
void ipps_put(ip_port_nr, nexthop, pack)
|
||||
int ip_port_nr;
|
||||
ipaddr_t nexthop;
|
||||
acc_t *pack;
|
||||
@@ -128,18 +128,18 @@ acc_t *pack;
|
||||
ip_arrived(ip_port, pack);
|
||||
}
|
||||
|
||||
PRIVATE void ipps_main(ip_port)
|
||||
static void ipps_main(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
PRIVATE void ipps_set_ipaddr(ip_port)
|
||||
static void ipps_set_ipaddr(ip_port)
|
||||
ip_port_t *ip_port;
|
||||
{
|
||||
}
|
||||
|
||||
PRIVATE int ipps_send(ip_port, dest, pack, type)
|
||||
static int ipps_send(ip_port, dest, pack, type)
|
||||
struct ip_port *ip_port;
|
||||
ipaddr_t dest;
|
||||
acc_t *pack;
|
||||
|
||||
@@ -20,16 +20,16 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
static ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
ipproto_t proto, ipaddr_t src, ipaddr_t dst ));
|
||||
FORWARD acc_t *merge_frags ARGS(( acc_t *first, acc_t *second ));
|
||||
FORWARD int ip_frag_chk ARGS(( acc_t *pack ));
|
||||
FORWARD acc_t *reassemble ARGS(( ip_port_t *ip_port, acc_t *pack,
|
||||
static acc_t *merge_frags ARGS(( acc_t *first, acc_t *second ));
|
||||
static int ip_frag_chk ARGS(( acc_t *pack ));
|
||||
static acc_t *reassemble ARGS(( ip_port_t *ip_port, acc_t *pack,
|
||||
ip_hdr_t *ip_hdr ));
|
||||
FORWARD void route_packets ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
FORWARD int broadcast_dst ARGS(( ip_port_t *ip_port, ipaddr_t dest ));
|
||||
static void route_packets ARGS(( event_t *ev, ev_arg_t ev_arg ));
|
||||
static int broadcast_dst ARGS(( ip_port_t *ip_port, ipaddr_t dest ));
|
||||
|
||||
PUBLIC int ip_read(int fd, size_t count)
|
||||
int ip_read(int fd, size_t count)
|
||||
{
|
||||
ip_fd_t *ip_fd;
|
||||
acc_t *pack;
|
||||
@@ -65,7 +65,7 @@ PUBLIC int ip_read(int fd, size_t count)
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *reassemble (ip_port, pack, pack_hdr)
|
||||
static acc_t *reassemble (ip_port, pack, pack_hdr)
|
||||
ip_port_t *ip_port;
|
||||
acc_t *pack;
|
||||
ip_hdr_t *pack_hdr;
|
||||
@@ -167,7 +167,7 @@ ip_hdr_t *pack_hdr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *merge_frags (first, second)
|
||||
static acc_t *merge_frags (first, second)
|
||||
acc_t *first, *second;
|
||||
{
|
||||
ip_hdr_t *first_hdr, *second_hdr;
|
||||
@@ -237,7 +237,7 @@ assert (first_hdr_size + first_datasize == bf_bufsize(first));
|
||||
return first;
|
||||
}
|
||||
|
||||
PRIVATE ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
static ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
ipproto_t proto, ipaddr_t src, ipaddr_t dst ))
|
||||
{
|
||||
ip_ass_t *new_ass_ent, *tmp_ass_ent;
|
||||
@@ -311,7 +311,7 @@ PRIVATE ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id,
|
||||
return new_ass_ent;
|
||||
}
|
||||
|
||||
PRIVATE int ip_frag_chk(pack)
|
||||
static int ip_frag_chk(pack)
|
||||
acc_t *pack;
|
||||
{
|
||||
ip_hdr_t *ip_hdr;
|
||||
@@ -362,7 +362,7 @@ acc_t *pack;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PUBLIC int ip_sel_read (ip_fd_t *ip_fd)
|
||||
int ip_sel_read (ip_fd_t *ip_fd)
|
||||
{
|
||||
acc_t *pack;
|
||||
|
||||
@@ -384,7 +384,7 @@ PUBLIC int ip_sel_read (ip_fd_t *ip_fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC void ip_packet2user (ip_fd, pack, exp_time, data_len)
|
||||
void ip_packet2user (ip_fd, pack, exp_time, data_len)
|
||||
ip_fd_t *ip_fd;
|
||||
acc_t *pack;
|
||||
time_t exp_time;
|
||||
@@ -471,7 +471,7 @@ size_t data_len;
|
||||
assert (result >= 0);
|
||||
}
|
||||
|
||||
PUBLIC void ip_port_arrive (ip_port, pack, ip_hdr)
|
||||
void ip_port_arrive (ip_port, pack, ip_hdr)
|
||||
ip_port_t *ip_port;
|
||||
acc_t *pack;
|
||||
ip_hdr_t *ip_hdr;
|
||||
@@ -589,7 +589,7 @@ ip_hdr_t *ip_hdr;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void ip_arrived(ip_port, pack)
|
||||
void ip_arrived(ip_port, pack)
|
||||
ip_port_t *ip_port;
|
||||
acc_t *pack;
|
||||
{
|
||||
@@ -718,7 +718,7 @@ assert (pack->acc_length >= IP_MIN_HDR_SIZE);
|
||||
ev_enqueue(&ip_port->ip_routeq_event, route_packets, ev_arg);
|
||||
}
|
||||
|
||||
PUBLIC void ip_arrived_broadcast(ip_port, pack)
|
||||
void ip_arrived_broadcast(ip_port, pack)
|
||||
ip_port_t *ip_port;
|
||||
acc_t *pack;
|
||||
{
|
||||
@@ -784,7 +784,7 @@ assert (pack->acc_length >= IP_MIN_HDR_SIZE);
|
||||
ip_port_arrive (ip_port, pack, ip_hdr);
|
||||
}
|
||||
|
||||
PRIVATE void route_packets(ev, ev_arg)
|
||||
static void route_packets(ev, ev_arg)
|
||||
event_t *ev;
|
||||
ev_arg_t ev_arg;
|
||||
{
|
||||
@@ -992,7 +992,7 @@ ev_arg_t ev_arg;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int broadcast_dst(ip_port, dest)
|
||||
static int broadcast_dst(ip_port, dest)
|
||||
ip_port_t *ip_port;
|
||||
ipaddr_t dest;
|
||||
{
|
||||
|
||||
@@ -21,9 +21,9 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void error_reply ARGS(( ip_fd_t *fd, int error ));
|
||||
static void error_reply ARGS(( ip_fd_t *fd, int error ));
|
||||
|
||||
PUBLIC int ip_write (fd, count)
|
||||
int ip_write (fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -51,7 +51,7 @@ size_t count;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int ip_send(fd, data, data_len)
|
||||
int ip_send(fd, data, data_len)
|
||||
int fd;
|
||||
acc_t *data;
|
||||
size_t data_len;
|
||||
@@ -336,7 +336,7 @@ size_t data_len;
|
||||
return r;
|
||||
}
|
||||
|
||||
PUBLIC void ip_hdr_chksum(ip_hdr, ip_hdr_len)
|
||||
void ip_hdr_chksum(ip_hdr, ip_hdr_len)
|
||||
ip_hdr_t *ip_hdr;
|
||||
int ip_hdr_len;
|
||||
{
|
||||
@@ -344,7 +344,7 @@ int ip_hdr_len;
|
||||
ip_hdr->ih_hdr_chk= ~oneC_sum (0, (u16_t *)ip_hdr, ip_hdr_len);
|
||||
}
|
||||
|
||||
PUBLIC acc_t *ip_split_pack (ip_port, ref_last, mtu)
|
||||
acc_t *ip_split_pack (ip_port, ref_last, mtu)
|
||||
ip_port_t *ip_port;
|
||||
acc_t **ref_last;
|
||||
int mtu;
|
||||
@@ -497,7 +497,7 @@ int mtu;
|
||||
return first_pack;
|
||||
}
|
||||
|
||||
PRIVATE void error_reply (ip_fd, error)
|
||||
static void error_reply (ip_fd, error)
|
||||
ip_fd_t *ip_fd;
|
||||
int error;
|
||||
{
|
||||
|
||||
@@ -35,10 +35,10 @@ typedef struct oroute_hash
|
||||
oroute_t *orh_route;
|
||||
} oroute_hash_t;
|
||||
|
||||
PRIVATE oroute_t oroute_table[OROUTE_NR];
|
||||
PRIVATE oroute_t *oroute_head;
|
||||
PRIVATE int static_oroute_nr;
|
||||
PRIVATE oroute_hash_t oroute_hash_table[OROUTE_HASH_NR][OROUTE_HASH_ASS_NR];
|
||||
static oroute_t oroute_table[OROUTE_NR];
|
||||
static oroute_t *oroute_head;
|
||||
static int static_oroute_nr;
|
||||
static oroute_hash_t oroute_hash_table[OROUTE_HASH_NR][OROUTE_HASH_ASS_NR];
|
||||
|
||||
#define IROUTE_NR 512
|
||||
#define IROUTE_HASH_ASS_NR 4
|
||||
@@ -57,17 +57,17 @@ typedef struct iroute_hash
|
||||
iroute_t *irh_route;
|
||||
} iroute_hash_t;
|
||||
|
||||
PRIVATE iroute_t iroute_table[IROUTE_NR];
|
||||
PRIVATE iroute_hash_t iroute_hash_table[IROUTE_HASH_NR][IROUTE_HASH_ASS_NR];
|
||||
static iroute_t iroute_table[IROUTE_NR];
|
||||
static iroute_hash_t iroute_hash_table[IROUTE_HASH_NR][IROUTE_HASH_ASS_NR];
|
||||
|
||||
FORWARD oroute_t *oroute_find_ent ARGS(( int port_nr, ipaddr_t dest ));
|
||||
FORWARD void oroute_del ARGS(( oroute_t *oroute ));
|
||||
FORWARD oroute_t *sort_dists ARGS(( oroute_t *oroute ));
|
||||
FORWARD oroute_t *sort_gws ARGS(( oroute_t *oroute ));
|
||||
FORWARD void oroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask ));
|
||||
FORWARD void iroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask ));
|
||||
static oroute_t *oroute_find_ent ARGS(( int port_nr, ipaddr_t dest ));
|
||||
static void oroute_del ARGS(( oroute_t *oroute ));
|
||||
static oroute_t *sort_dists ARGS(( oroute_t *oroute ));
|
||||
static oroute_t *sort_gws ARGS(( oroute_t *oroute ));
|
||||
static void oroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask ));
|
||||
static void iroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask ));
|
||||
|
||||
PUBLIC void ipr_init()
|
||||
void ipr_init()
|
||||
{
|
||||
int i;
|
||||
oroute_t *oroute;
|
||||
@@ -84,7 +84,7 @@ PUBLIC void ipr_init()
|
||||
}
|
||||
|
||||
|
||||
PUBLIC iroute_t *iroute_frag(port_nr, dest)
|
||||
iroute_t *iroute_frag(port_nr, dest)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
{
|
||||
@@ -184,7 +184,7 @@ ipaddr_t dest;
|
||||
return bestroute;
|
||||
}
|
||||
|
||||
PUBLIC int oroute_frag(port_nr, dest, ttl, msgsize, nexthop)
|
||||
int oroute_frag(port_nr, dest, ttl, msgsize, nexthop)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
int ttl;
|
||||
@@ -207,7 +207,7 @@ ipaddr_t *nexthop;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int ipr_add_oroute(port_nr, dest, subnetmask, gateway,
|
||||
int ipr_add_oroute(port_nr, dest, subnetmask, gateway,
|
||||
timeout, dist, mtu, static_route, preference, oroute_p)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
@@ -408,7 +408,7 @@ oroute_t **oroute_p;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int ipr_del_oroute(port_nr, dest, subnetmask, gateway, static_route)
|
||||
int ipr_del_oroute(port_nr, dest, subnetmask, gateway, static_route)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
ipaddr_t subnetmask;
|
||||
@@ -447,7 +447,7 @@ int static_route;
|
||||
|
||||
|
||||
|
||||
PUBLIC void ipr_chk_otab(port_nr, addr, mask)
|
||||
void ipr_chk_otab(port_nr, addr, mask)
|
||||
int port_nr;
|
||||
ipaddr_t addr;
|
||||
ipaddr_t mask;
|
||||
@@ -495,7 +495,7 @@ ipaddr_t mask;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_gateway_down(port_nr, gateway, timeout)
|
||||
void ipr_gateway_down(port_nr, gateway, timeout)
|
||||
int port_nr;
|
||||
ipaddr_t gateway;
|
||||
time_t timeout;
|
||||
@@ -523,7 +523,7 @@ time_t timeout;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_destunrch(port_nr, dest, netmask, timeout)
|
||||
void ipr_destunrch(port_nr, dest, netmask, timeout)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
ipaddr_t netmask;
|
||||
@@ -548,7 +548,7 @@ time_t timeout;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_redirect(port_nr, dest, netmask, old_gateway, new_gateway,
|
||||
void ipr_redirect(port_nr, dest, netmask, old_gateway, new_gateway,
|
||||
timeout)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
@@ -611,7 +611,7 @@ time_t timeout;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_ttl_exc(port_nr, dest, netmask, timeout)
|
||||
void ipr_ttl_exc(port_nr, dest, netmask, timeout)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
ipaddr_t netmask;
|
||||
@@ -651,7 +651,7 @@ time_t timeout;
|
||||
assert(result == NW_OK);
|
||||
}
|
||||
|
||||
PUBLIC void ipr_mtu(
|
||||
void ipr_mtu(
|
||||
int port_nr,
|
||||
ipaddr_t dest,
|
||||
u16_t mtu,
|
||||
@@ -683,7 +683,7 @@ PUBLIC void ipr_mtu(
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int ipr_get_oroute(ent_no, route_ent)
|
||||
int ipr_get_oroute(ent_no, route_ent)
|
||||
int ent_no;
|
||||
nwio_route_t *route_ent;
|
||||
{
|
||||
@@ -720,7 +720,7 @@ nwio_route_t *route_ent;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE oroute_t *oroute_find_ent(port_nr, dest)
|
||||
static oroute_t *oroute_find_ent(port_nr, dest)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
{
|
||||
@@ -812,7 +812,7 @@ ipaddr_t dest;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void oroute_del(oroute)
|
||||
static void oroute_del(oroute)
|
||||
oroute_t *oroute;
|
||||
{
|
||||
oroute_t *prev, *nw_route, *gw_route, *dist_route, *prev_route;
|
||||
@@ -888,7 +888,7 @@ oroute_t *oroute;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE oroute_t *sort_dists(oroute)
|
||||
static oroute_t *sort_dists(oroute)
|
||||
oroute_t *oroute;
|
||||
{
|
||||
oroute_t *r, *prev, *best, *best_prev;
|
||||
@@ -932,7 +932,7 @@ oroute_t *oroute;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE oroute_t *sort_gws(oroute)
|
||||
static oroute_t *sort_gws(oroute)
|
||||
oroute_t *oroute;
|
||||
{
|
||||
oroute_t *r, *prev, *best, *best_prev;
|
||||
@@ -976,7 +976,7 @@ oroute_t *oroute;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void oroute_uncache_nw(dest, netmask)
|
||||
static void oroute_uncache_nw(dest, netmask)
|
||||
ipaddr_t dest;
|
||||
ipaddr_t netmask;
|
||||
{
|
||||
@@ -1002,7 +1002,7 @@ ipaddr_t netmask;
|
||||
* Input routing
|
||||
*/
|
||||
|
||||
PUBLIC int ipr_get_iroute(ent_no, route_ent)
|
||||
int ipr_get_iroute(ent_no, route_ent)
|
||||
int ent_no;
|
||||
nwio_route_t *route_ent;
|
||||
{
|
||||
@@ -1035,7 +1035,7 @@ nwio_route_t *route_ent;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int ipr_add_iroute(port_nr, dest, subnetmask, gateway,
|
||||
int ipr_add_iroute(port_nr, dest, subnetmask, gateway,
|
||||
dist, mtu, static_route, iroute_p)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
@@ -1124,7 +1124,7 @@ iroute_t **iroute_p;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int ipr_del_iroute(port_nr, dest, subnetmask, gateway, static_route)
|
||||
int ipr_del_iroute(port_nr, dest, subnetmask, gateway, static_route)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
ipaddr_t subnetmask;
|
||||
@@ -1162,7 +1162,7 @@ int static_route;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void ipr_chk_itab(port_nr, addr, mask)
|
||||
void ipr_chk_itab(port_nr, addr, mask)
|
||||
int port_nr;
|
||||
ipaddr_t addr;
|
||||
ipaddr_t mask;
|
||||
@@ -1218,7 +1218,7 @@ ipaddr_t mask;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void iroute_uncache_nw(dest, netmask)
|
||||
static void iroute_uncache_nw(dest, netmask)
|
||||
ipaddr_t dest;
|
||||
ipaddr_t netmask;
|
||||
{
|
||||
|
||||
@@ -55,36 +55,36 @@ typedef struct psip_fd
|
||||
#define PFF_PROMISC 4
|
||||
#define PFF_NEXTHOP 8
|
||||
|
||||
PRIVATE psip_port_t *psip_port_table;
|
||||
PRIVATE psip_fd_t psip_fd_table[PSIP_FD_NR];
|
||||
static psip_port_t *psip_port_table;
|
||||
static psip_fd_t psip_fd_table[PSIP_FD_NR];
|
||||
|
||||
FORWARD int psip_open ARGS(( int port, int srfd,
|
||||
static int psip_open ARGS(( int port, int srfd,
|
||||
get_userdata_t get_userdata, put_userdata_t put_userdata,
|
||||
put_pkt_t pkt_pkt, select_res_t select_res ));
|
||||
FORWARD int psip_ioctl ARGS(( int fd, ioreq_t req ));
|
||||
FORWARD int psip_read ARGS(( int fd, size_t count ));
|
||||
FORWARD int psip_write ARGS(( int fd, size_t count ));
|
||||
FORWARD int psip_select ARGS(( int port_nr, unsigned operations ));
|
||||
FORWARD void psip_close ARGS(( int fd ));
|
||||
FORWARD int psip_cancel ARGS(( int fd, int which_operation ));
|
||||
FORWARD void promisc_restart_read ARGS(( psip_port_t *psip_port ));
|
||||
FORWARD int psip_setopt ARGS(( psip_fd_t *psip_fd, nwio_psipopt_t *newoptp ));
|
||||
FORWARD void psip_buffree ARGS(( int priority ));
|
||||
FORWARD void check_promisc ARGS(( psip_port_t *psip_port ));
|
||||
static int psip_ioctl ARGS(( int fd, ioreq_t req ));
|
||||
static int psip_read ARGS(( int fd, size_t count ));
|
||||
static int psip_write ARGS(( int fd, size_t count ));
|
||||
static int psip_select ARGS(( int port_nr, unsigned operations ));
|
||||
static void psip_close ARGS(( int fd ));
|
||||
static int psip_cancel ARGS(( int fd, int which_operation ));
|
||||
static void promisc_restart_read ARGS(( psip_port_t *psip_port ));
|
||||
static int psip_setopt ARGS(( psip_fd_t *psip_fd, nwio_psipopt_t *newoptp ));
|
||||
static void psip_buffree ARGS(( int priority ));
|
||||
static void check_promisc ARGS(( psip_port_t *psip_port ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void psip_bufcheck ARGS(( void ));
|
||||
static void psip_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD void reply_thr_put ARGS(( psip_fd_t *psip_fd, int reply,
|
||||
static void reply_thr_put ARGS(( psip_fd_t *psip_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD void reply_thr_get ARGS(( psip_fd_t *psip_fd, int reply,
|
||||
static void reply_thr_get ARGS(( psip_fd_t *psip_fd, int reply,
|
||||
int for_ioctl ));
|
||||
|
||||
PUBLIC void psip_prep()
|
||||
void psip_prep()
|
||||
{
|
||||
psip_port_table= alloc(psip_conf_nr * sizeof(psip_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void psip_init()
|
||||
void psip_init()
|
||||
{
|
||||
int i;
|
||||
psip_port_t *psip_port;
|
||||
@@ -111,7 +111,7 @@ PUBLIC void psip_init()
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC int psip_enable(port_nr, ip_port_nr)
|
||||
int psip_enable(port_nr, ip_port_nr)
|
||||
int port_nr;
|
||||
int ip_port_nr;
|
||||
{
|
||||
@@ -135,7 +135,7 @@ int ip_port_nr;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PUBLIC int psip_send(port_nr, dest, pack)
|
||||
int psip_send(port_nr, dest, pack)
|
||||
int port_nr;
|
||||
ipaddr_t dest;
|
||||
acc_t *pack;
|
||||
@@ -248,7 +248,7 @@ acc_t *pack;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PRIVATE int psip_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
static int psip_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -285,7 +285,7 @@ select_res_t select_res;
|
||||
return i;
|
||||
}
|
||||
|
||||
PRIVATE int psip_ioctl(fd, req)
|
||||
static int psip_ioctl(fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -370,7 +370,7 @@ ioreq_t req;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int psip_read(fd, count)
|
||||
static int psip_read(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -422,7 +422,7 @@ size_t count;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int psip_write(fd, count)
|
||||
static int psip_write(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -507,7 +507,7 @@ size_t count;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int psip_select(fd, operations)
|
||||
static int psip_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -515,7 +515,7 @@ unsigned operations;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void psip_close(fd)
|
||||
static void psip_close(fd)
|
||||
int fd;
|
||||
{
|
||||
psip_port_t *psip_port;
|
||||
@@ -540,7 +540,7 @@ int fd;
|
||||
|
||||
}
|
||||
|
||||
PRIVATE int psip_cancel(fd, which_operation)
|
||||
static int psip_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -587,7 +587,7 @@ int which_operation;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void promisc_restart_read(psip_port)
|
||||
static void promisc_restart_read(psip_port)
|
||||
psip_port_t *psip_port;
|
||||
{
|
||||
psip_fd_t *psip_fd, *prev, *next;
|
||||
@@ -648,7 +648,7 @@ again:
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int psip_setopt(psip_fd, newoptp)
|
||||
static int psip_setopt(psip_fd, newoptp)
|
||||
psip_fd_t *psip_fd;
|
||||
nwio_psipopt_t *newoptp;
|
||||
{
|
||||
@@ -691,7 +691,7 @@ nwio_psipopt_t *newoptp;
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void check_promisc(psip_port)
|
||||
static void check_promisc(psip_port)
|
||||
psip_port_t *psip_port;
|
||||
{
|
||||
int i;
|
||||
@@ -733,7 +733,7 @@ psip_port_t *psip_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void psip_buffree (priority)
|
||||
static void psip_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -763,7 +763,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void psip_bufcheck()
|
||||
static void psip_bufcheck()
|
||||
{
|
||||
int i;
|
||||
psip_port_t *psip_port;
|
||||
@@ -785,7 +785,7 @@ PRIVATE void psip_bufcheck()
|
||||
reply_thr_put
|
||||
*/
|
||||
|
||||
PRIVATE void reply_thr_put(psip_fd, reply, for_ioctl)
|
||||
static void reply_thr_put(psip_fd, reply, for_ioctl)
|
||||
psip_fd_t *psip_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -801,7 +801,7 @@ int for_ioctl;
|
||||
reply_thr_get
|
||||
*/
|
||||
|
||||
PRIVATE void reply_thr_get(psip_fd, reply, for_ioctl)
|
||||
static void reply_thr_get(psip_fd, reply, for_ioctl)
|
||||
psip_fd_t *psip_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
|
||||
@@ -14,15 +14,15 @@ Generate 256-bit random numbers
|
||||
#include "inet.h"
|
||||
#include "rand256.h"
|
||||
|
||||
PRIVATE u32_t base_bits[8];
|
||||
static u32_t base_bits[8];
|
||||
|
||||
PUBLIC void init_rand256(bits)
|
||||
void init_rand256(bits)
|
||||
u8_t bits[32];
|
||||
{
|
||||
memcpy(base_bits, bits, sizeof(base_bits));
|
||||
}
|
||||
|
||||
PUBLIC void rand256(bits)
|
||||
void rand256(bits)
|
||||
u8_t bits[32];
|
||||
{
|
||||
u32_t a;
|
||||
|
||||
@@ -20,53 +20,53 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
PUBLIC tcp_port_t *tcp_port_table;
|
||||
PUBLIC tcp_fd_t tcp_fd_table[TCP_FD_NR];
|
||||
PUBLIC tcp_conn_t tcp_conn_table[TCP_CONN_NR];
|
||||
PUBLIC sr_cancel_t tcp_cancel_f;
|
||||
tcp_port_t *tcp_port_table;
|
||||
tcp_fd_t tcp_fd_table[TCP_FD_NR];
|
||||
tcp_conn_t tcp_conn_table[TCP_CONN_NR];
|
||||
sr_cancel_t tcp_cancel_f;
|
||||
|
||||
FORWARD void tcp_main ARGS(( tcp_port_t *port ));
|
||||
FORWARD int tcp_select ARGS(( int fd, unsigned operations ));
|
||||
FORWARD acc_t *tcp_get_data ARGS(( int fd, size_t offset,
|
||||
static void tcp_main ARGS(( tcp_port_t *port ));
|
||||
static int tcp_select ARGS(( int fd, unsigned operations ));
|
||||
static acc_t *tcp_get_data ARGS(( int fd, size_t offset,
|
||||
size_t count, int for_ioctl ));
|
||||
FORWARD int tcp_put_data ARGS(( int fd, size_t offset,
|
||||
static int tcp_put_data ARGS(( int fd, size_t offset,
|
||||
acc_t *data, int for_ioctl ));
|
||||
FORWARD void tcp_put_pkt ARGS(( int fd, acc_t *data, size_t datalen ));
|
||||
FORWARD void read_ip_packets ARGS(( tcp_port_t *port ));
|
||||
FORWARD int tcp_setconf ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD int tcp_setopt ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD int tcp_connect ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD int tcp_listen ARGS(( tcp_fd_t *tcp_fd, int do_listenq ));
|
||||
FORWARD int tcp_acceptto ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD tcpport_t find_unused_port ARGS(( int fd ));
|
||||
FORWARD int is_unused_port ARGS(( tcpport_t port ));
|
||||
FORWARD int reply_thr_put ARGS(( tcp_fd_t *tcp_fd, int reply,
|
||||
static void tcp_put_pkt ARGS(( int fd, acc_t *data, size_t datalen ));
|
||||
static void read_ip_packets ARGS(( tcp_port_t *port ));
|
||||
static int tcp_setconf ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static int tcp_setopt ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static int tcp_connect ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static int tcp_listen ARGS(( tcp_fd_t *tcp_fd, int do_listenq ));
|
||||
static int tcp_acceptto ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static tcpport_t find_unused_port ARGS(( int fd ));
|
||||
static int is_unused_port ARGS(( tcpport_t port ));
|
||||
static int reply_thr_put ARGS(( tcp_fd_t *tcp_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD void reply_thr_get ARGS(( tcp_fd_t *tcp_fd, int reply,
|
||||
static void reply_thr_get ARGS(( tcp_fd_t *tcp_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD tcp_conn_t *find_conn_entry ARGS(( tcpport_t locport,
|
||||
static tcp_conn_t *find_conn_entry ARGS(( tcpport_t locport,
|
||||
ipaddr_t locaddr, tcpport_t remport, ipaddr_t readaddr ));
|
||||
FORWARD tcp_conn_t *find_empty_conn ARGS(( void ));
|
||||
FORWARD tcp_conn_t *find_best_conn ARGS(( ip_hdr_t *ip_hdr,
|
||||
static tcp_conn_t *find_empty_conn ARGS(( void ));
|
||||
static tcp_conn_t *find_best_conn ARGS(( ip_hdr_t *ip_hdr,
|
||||
tcp_hdr_t *tcp_hdr ));
|
||||
FORWARD tcp_conn_t *new_conn_for_queue ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD int maybe_listen ARGS(( ipaddr_t locaddr, tcpport_t locport,
|
||||
static tcp_conn_t *new_conn_for_queue ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static int maybe_listen ARGS(( ipaddr_t locaddr, tcpport_t locport,
|
||||
ipaddr_t remaddr, tcpport_t remport ));
|
||||
FORWARD int tcp_su4connect ARGS(( tcp_fd_t *tcp_fd ));
|
||||
FORWARD void tcp_buffree ARGS(( int priority ));
|
||||
static int tcp_su4connect ARGS(( tcp_fd_t *tcp_fd ));
|
||||
static void tcp_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void tcp_bufcheck ARGS(( void ));
|
||||
static void tcp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD void tcp_setup_conn ARGS(( tcp_port_t *tcp_port,
|
||||
static void tcp_setup_conn ARGS(( tcp_port_t *tcp_port,
|
||||
tcp_conn_t *tcp_conn ));
|
||||
FORWARD u32_t tcp_rand32 ARGS(( void ));
|
||||
static u32_t tcp_rand32 ARGS(( void ));
|
||||
|
||||
PUBLIC void tcp_prep()
|
||||
void tcp_prep()
|
||||
{
|
||||
tcp_port_table= alloc(tcp_conf_nr * sizeof(tcp_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void tcp_init()
|
||||
void tcp_init()
|
||||
{
|
||||
int i, j, k, ifno;
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -124,7 +124,7 @@ PUBLIC void tcp_init()
|
||||
tcp_cancel_f= tcp_cancel;
|
||||
}
|
||||
|
||||
PRIVATE void tcp_main(tcp_port)
|
||||
static void tcp_main(tcp_port)
|
||||
tcp_port_t *tcp_port;
|
||||
{
|
||||
int result, i;
|
||||
@@ -245,7 +245,7 @@ tcp_port_t *tcp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int tcp_select(fd, operations)
|
||||
static int tcp_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -341,7 +341,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *tcp_get_data (port, offset, count, for_ioctl)
|
||||
static acc_t *tcp_get_data (port, offset, count, for_ioctl)
|
||||
int port;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -435,7 +435,7 @@ assert (count == sizeof(struct nwio_ipopt));
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int tcp_put_data (fd, offset, data, for_ioctl)
|
||||
static int tcp_put_data (fd, offset, data, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -512,7 +512,7 @@ assert (ipconf->nwic_flags & NWIC_IPADDR_SET);
|
||||
tcp_put_pkt
|
||||
*/
|
||||
|
||||
PRIVATE void tcp_put_pkt(fd, data, datalen)
|
||||
static void tcp_put_pkt(fd, data, datalen)
|
||||
int fd;
|
||||
acc_t *data;
|
||||
size_t datalen;
|
||||
@@ -710,7 +710,7 @@ size_t datalen;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC int tcp_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
int tcp_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -754,7 +754,7 @@ select_res_t select_res;
|
||||
/*
|
||||
tcp_ioctl
|
||||
*/
|
||||
PUBLIC int tcp_ioctl (fd, req)
|
||||
int tcp_ioctl (fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -969,7 +969,7 @@ assert (conf_acc->acc_length == sizeof(*tcp_conf));
|
||||
tcp_setconf
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_setconf(tcp_fd)
|
||||
static int tcp_setconf(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
nwio_tcpconf_t *tcpconf;
|
||||
@@ -1160,7 +1160,7 @@ assert (new_di_flags & NWTC_REMPORT_MASK);
|
||||
tcp_setopt
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_setopt(tcp_fd)
|
||||
static int tcp_setopt(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
nwio_tcpopt_t *tcpopt;
|
||||
@@ -1276,7 +1276,7 @@ assert (data->acc_length == sizeof(nwio_tcpopt_t));
|
||||
}
|
||||
|
||||
|
||||
PRIVATE tcpport_t find_unused_port(int fd)
|
||||
static tcpport_t find_unused_port(int fd)
|
||||
{
|
||||
tcpport_t port, nw_port;
|
||||
|
||||
@@ -1296,7 +1296,7 @@ PRIVATE tcpport_t find_unused_port(int fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int is_unused_port(tcpport_t port)
|
||||
static int is_unused_port(tcpport_t port)
|
||||
{
|
||||
int i;
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -1322,7 +1322,7 @@ PRIVATE int is_unused_port(tcpport_t port)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PRIVATE int reply_thr_put(tcp_fd, reply, for_ioctl)
|
||||
static int reply_thr_put(tcp_fd, reply, for_ioctl)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -1333,7 +1333,7 @@ int for_ioctl;
|
||||
(acc_t *)0, for_ioctl);
|
||||
}
|
||||
|
||||
PRIVATE void reply_thr_get(tcp_fd, reply, for_ioctl)
|
||||
static void reply_thr_get(tcp_fd, reply, for_ioctl)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -1345,7 +1345,7 @@ int for_ioctl;
|
||||
assert (!result);
|
||||
}
|
||||
|
||||
PUBLIC int tcp_su4listen(tcp_fd, tcp_conn, do_listenq)
|
||||
int tcp_su4listen(tcp_fd, tcp_conn, do_listenq)
|
||||
tcp_fd_t *tcp_fd;
|
||||
tcp_conn_t *tcp_conn;
|
||||
int do_listenq;
|
||||
@@ -1384,7 +1384,7 @@ This includes connections that are never used, and connections without a
|
||||
user that are not used for a while.
|
||||
*/
|
||||
|
||||
PRIVATE tcp_conn_t *find_empty_conn()
|
||||
static tcp_conn_t *find_empty_conn()
|
||||
{
|
||||
int i;
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -1424,7 +1424,7 @@ If no such connection exists NULL is returned.
|
||||
If a connection exists without mainuser it is closed.
|
||||
*/
|
||||
|
||||
PRIVATE tcp_conn_t *find_conn_entry(
|
||||
static tcp_conn_t *find_conn_entry(
|
||||
tcpport_t locport,
|
||||
ipaddr_t locaddr,
|
||||
tcpport_t remport,
|
||||
@@ -1460,7 +1460,7 @@ PRIVATE tcp_conn_t *find_conn_entry(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE void read_ip_packets(tcp_port)
|
||||
static void read_ip_packets(tcp_port)
|
||||
tcp_port_t *tcp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -1483,7 +1483,7 @@ tcp_port_t *tcp_port;
|
||||
find_best_conn
|
||||
*/
|
||||
|
||||
PRIVATE tcp_conn_t *find_best_conn(ip_hdr, tcp_hdr)
|
||||
static tcp_conn_t *find_best_conn(ip_hdr, tcp_hdr)
|
||||
ip_hdr_t *ip_hdr;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
{
|
||||
@@ -1654,7 +1654,7 @@ tcp_hdr_t *tcp_hdr;
|
||||
/*
|
||||
new_conn_for_queue
|
||||
*/
|
||||
PRIVATE tcp_conn_t *new_conn_for_queue(tcp_fd)
|
||||
static tcp_conn_t *new_conn_for_queue(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
int i;
|
||||
@@ -1681,7 +1681,7 @@ tcp_fd_t *tcp_fd;
|
||||
/*
|
||||
maybe_listen
|
||||
*/
|
||||
PRIVATE int maybe_listen(
|
||||
static int maybe_listen(
|
||||
ipaddr_t locaddr,
|
||||
tcpport_t locport,
|
||||
ipaddr_t remaddr,
|
||||
@@ -1730,7 +1730,7 @@ PRIVATE int maybe_listen(
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void tcp_reply_ioctl(tcp_fd, reply)
|
||||
void tcp_reply_ioctl(tcp_fd, reply)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int reply;
|
||||
{
|
||||
@@ -1745,7 +1745,7 @@ int reply;
|
||||
reply_thr_get (tcp_fd, reply, TRUE);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_reply_write(tcp_fd, reply)
|
||||
void tcp_reply_write(tcp_fd, reply)
|
||||
tcp_fd_t *tcp_fd;
|
||||
size_t reply;
|
||||
{
|
||||
@@ -1755,7 +1755,7 @@ size_t reply;
|
||||
reply_thr_get (tcp_fd, reply, FALSE);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_reply_read(tcp_fd, reply)
|
||||
void tcp_reply_read(tcp_fd, reply)
|
||||
tcp_fd_t *tcp_fd;
|
||||
size_t reply;
|
||||
{
|
||||
@@ -1765,7 +1765,7 @@ size_t reply;
|
||||
reply_thr_put (tcp_fd, reply, FALSE);
|
||||
}
|
||||
|
||||
PUBLIC int tcp_write(fd, count)
|
||||
int tcp_write(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -1818,7 +1818,7 @@ size_t count;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PUBLIC int
|
||||
int
|
||||
tcp_read(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
@@ -1858,7 +1858,7 @@ reply the success or failure of a connect to the user.
|
||||
*/
|
||||
|
||||
|
||||
PUBLIC void tcp_restart_connect(tcp_conn)
|
||||
void tcp_restart_connect(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -1932,7 +1932,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_close
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_close(fd)
|
||||
void tcp_close(fd)
|
||||
int fd;
|
||||
{
|
||||
int i;
|
||||
@@ -2029,7 +2029,7 @@ int fd;
|
||||
tcp_close_connection(tcp_conn, ENOTCONN);
|
||||
}
|
||||
|
||||
PUBLIC int tcp_cancel(fd, which_operation)
|
||||
int tcp_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -2108,7 +2108,7 @@ assert (tcp_fd->tf_flags & TFF_IOCTL_IP);
|
||||
tcp_connect
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_connect(tcp_fd)
|
||||
static int tcp_connect(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -2192,7 +2192,7 @@ tcp_fd_t *tcp_fd;
|
||||
tcp_su4connect
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_su4connect(tcp_fd)
|
||||
static int tcp_su4connect(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -2231,7 +2231,7 @@ tcp_fd_t *tcp_fd;
|
||||
tcp_listen
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_listen(tcp_fd, do_listenq)
|
||||
static int tcp_listen(tcp_fd, do_listenq)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int do_listenq;
|
||||
{
|
||||
@@ -2284,7 +2284,7 @@ int do_listenq;
|
||||
tcp_acceptto
|
||||
*/
|
||||
|
||||
PRIVATE int tcp_acceptto(tcp_fd)
|
||||
static int tcp_acceptto(tcp_fd)
|
||||
tcp_fd_t *tcp_fd;
|
||||
{
|
||||
int i, dst_nr;
|
||||
@@ -2357,7 +2357,7 @@ tcp_fd_t *tcp_fd;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void tcp_buffree (priority)
|
||||
static void tcp_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -2440,7 +2440,7 @@ int priority;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void tcp_bufcheck()
|
||||
static void tcp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -2470,7 +2470,7 @@ PRIVATE void tcp_bufcheck()
|
||||
}
|
||||
#endif
|
||||
|
||||
PUBLIC void tcp_notreach(tcp_conn, error)
|
||||
void tcp_notreach(tcp_conn, error)
|
||||
tcp_conn_t *tcp_conn;
|
||||
int error;
|
||||
{
|
||||
@@ -2497,7 +2497,7 @@ int error;
|
||||
tcp_conn_write(tcp_conn, 1);
|
||||
}
|
||||
|
||||
FORWARD u32_t mtu_table[]=
|
||||
static u32_t mtu_table[]=
|
||||
{ /* From RFC-1191 */
|
||||
/* Plateau MTU Comments Reference */
|
||||
/* ------ --- -------- --------- */
|
||||
@@ -2535,7 +2535,7 @@ FORWARD u32_t mtu_table[]=
|
||||
0, /* End of list */
|
||||
};
|
||||
|
||||
PUBLIC void tcp_mtu_exceeded(tcp_conn)
|
||||
void tcp_mtu_exceeded(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
u16_t mtu;
|
||||
@@ -2600,7 +2600,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_conn_write(tcp_conn, 1);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_mtu_incr(tcp_conn)
|
||||
void tcp_mtu_incr(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
clock_t curr_time;
|
||||
@@ -2637,7 +2637,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_setup_conn
|
||||
*/
|
||||
|
||||
PRIVATE void tcp_setup_conn(tcp_port, tcp_conn)
|
||||
static void tcp_setup_conn(tcp_port, tcp_conn)
|
||||
tcp_port_t *tcp_port;
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
@@ -2714,7 +2714,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_conn->tc_transmit_seq= 0;
|
||||
}
|
||||
|
||||
PRIVATE u32_t tcp_rand32()
|
||||
static u32_t tcp_rand32()
|
||||
{
|
||||
u8_t bits[RAND256_BUFSIZE];
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Copyright 1995 Philip Homburg
|
||||
THIS_FILE
|
||||
|
||||
#undef tcp_LEmod4G
|
||||
PUBLIC int tcp_LEmod4G(n1, n2)
|
||||
int tcp_LEmod4G(n1, n2)
|
||||
u32_t n1;
|
||||
u32_t n2;
|
||||
{
|
||||
@@ -25,7 +25,7 @@ u32_t n2;
|
||||
}
|
||||
|
||||
#undef tcp_GEmod4G
|
||||
PUBLIC int tcp_GEmod4G(n1, n2)
|
||||
int tcp_GEmod4G(n1, n2)
|
||||
u32_t n1;
|
||||
u32_t n2;
|
||||
{
|
||||
@@ -33,7 +33,7 @@ u32_t n2;
|
||||
}
|
||||
|
||||
#undef tcp_Lmod4G
|
||||
PUBLIC int tcp_Lmod4G(n1, n2)
|
||||
int tcp_Lmod4G(n1, n2)
|
||||
u32_t n1;
|
||||
u32_t n2;
|
||||
{
|
||||
@@ -41,14 +41,14 @@ u32_t n2;
|
||||
}
|
||||
|
||||
#undef tcp_Gmod4G
|
||||
PUBLIC int tcp_Gmod4G(n1, n2)
|
||||
int tcp_Gmod4G(n1, n2)
|
||||
u32_t n1;
|
||||
u32_t n2;
|
||||
{
|
||||
return !!((u32_t)(n2-n1) & 0x80000000L);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_extract_ipopt(tcp_conn, ip_hdr)
|
||||
void tcp_extract_ipopt(tcp_conn, ip_hdr)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdr_t *ip_hdr;
|
||||
{
|
||||
@@ -61,7 +61,7 @@ ip_hdr_t *ip_hdr;
|
||||
DBLOCK(1, printf("ip_hdr options NOT supported (yet?)\n"));
|
||||
}
|
||||
|
||||
PUBLIC void tcp_extract_tcpopt(tcp_conn, tcp_hdr, mssp)
|
||||
void tcp_extract_tcpopt(tcp_conn, tcp_hdr, mssp)
|
||||
tcp_conn_t *tcp_conn;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
size_t *mssp;
|
||||
@@ -119,7 +119,7 @@ size_t *mssp;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC u16_t tcp_pack_oneCsum(ip_hdr, tcp_pack)
|
||||
u16_t tcp_pack_oneCsum(ip_hdr, tcp_pack)
|
||||
ip_hdr_t *ip_hdr;
|
||||
acc_t *tcp_pack;
|
||||
{
|
||||
@@ -165,7 +165,7 @@ acc_t *tcp_pack;
|
||||
return sum;
|
||||
}
|
||||
|
||||
PUBLIC void tcp_get_ipopt(tcp_conn, ip_hdropt)
|
||||
void tcp_get_ipopt(tcp_conn, ip_hdropt)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdropt_t *ip_hdropt;
|
||||
{
|
||||
@@ -179,7 +179,7 @@ ip_hdropt_t *ip_hdropt;
|
||||
return;
|
||||
}
|
||||
|
||||
PUBLIC void tcp_get_tcpopt(tcp_conn, tcp_hdropt)
|
||||
void tcp_get_tcpopt(tcp_conn, tcp_hdropt)
|
||||
tcp_conn_t *tcp_conn;
|
||||
tcp_hdropt_t *tcp_hdropt;
|
||||
{
|
||||
@@ -204,7 +204,7 @@ tcp_hdropt_t *tcp_hdropt;
|
||||
return;
|
||||
}
|
||||
|
||||
PUBLIC acc_t *tcp_make_header(tcp_conn, ref_ip_hdr, ref_tcp_hdr, data)
|
||||
acc_t *tcp_make_header(tcp_conn, ref_ip_hdr, ref_tcp_hdr, data)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdr_t **ref_ip_hdr;
|
||||
tcp_hdr_t **ref_tcp_hdr;
|
||||
@@ -295,7 +295,7 @@ acc_t *data;
|
||||
return hdr_acc;
|
||||
}
|
||||
|
||||
PUBLIC void tcp_print_state (tcp_conn)
|
||||
void tcp_print_state (tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
#if DEBUG
|
||||
@@ -319,7 +319,7 @@ tcp_conn_t *tcp_conn;
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC int tcp_check_conn(tcp_conn)
|
||||
int tcp_check_conn(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
int allright;
|
||||
@@ -480,7 +480,7 @@ tcp_conn_t *tcp_conn;
|
||||
return allright;
|
||||
}
|
||||
|
||||
PUBLIC void tcp_print_pack(ip_hdr, tcp_hdr)
|
||||
void tcp_print_pack(ip_hdr, tcp_hdr)
|
||||
ip_hdr_t *ip_hdr;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
{
|
||||
@@ -516,7 +516,7 @@ tcp_hdr_t *tcp_hdr;
|
||||
printf(" <options %d>", tcp_hdr_len-TCP_MIN_HDR_SIZE);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_print_conn(tcp_conn)
|
||||
void tcp_print_conn(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
u32_t iss, irs;
|
||||
|
||||
@@ -18,14 +18,14 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void create_RST ARGS(( tcp_conn_t *tcp_conn,
|
||||
static void create_RST ARGS(( tcp_conn_t *tcp_conn,
|
||||
ip_hdr_t *ip_hdr, tcp_hdr_t *tcp_hdr, int data_len ));
|
||||
FORWARD void process_data ARGS(( tcp_conn_t *tcp_conn,
|
||||
static void process_data ARGS(( tcp_conn_t *tcp_conn,
|
||||
tcp_hdr_t *tcp_hdr, acc_t *tcp_data, int data_len ));
|
||||
FORWARD void process_advanced_data ARGS(( tcp_conn_t *tcp_conn,
|
||||
static void process_advanced_data ARGS(( tcp_conn_t *tcp_conn,
|
||||
tcp_hdr_t *tcp_hdr, acc_t *tcp_data, int data_len ));
|
||||
|
||||
PUBLIC void tcp_frag2conn(tcp_conn, ip_hdr, tcp_hdr, tcp_data, data_len)
|
||||
void tcp_frag2conn(tcp_conn, ip_hdr, tcp_hdr, tcp_data, data_len)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdr_t *ip_hdr;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
@@ -796,7 +796,7 @@ TIME-WAIT:
|
||||
}
|
||||
|
||||
|
||||
PRIVATE void
|
||||
static void
|
||||
process_data(tcp_conn, tcp_hdr, tcp_data, data_len)
|
||||
tcp_conn_t *tcp_conn;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
@@ -1058,7 +1058,7 @@ int data_len;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void process_advanced_data(tcp_conn, tcp_hdr, tcp_data, data_len)
|
||||
static void process_advanced_data(tcp_conn, tcp_hdr, tcp_data, data_len)
|
||||
tcp_conn_t *tcp_conn;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
acc_t *tcp_data;
|
||||
@@ -1120,7 +1120,7 @@ int data_len;
|
||||
tcp_conn->tc_adv_seq= adv_seq;
|
||||
}
|
||||
|
||||
PRIVATE void create_RST(tcp_conn, ip_hdr, tcp_hdr, data_len)
|
||||
static void create_RST(tcp_conn, ip_hdr, tcp_hdr, data_len)
|
||||
tcp_conn_t *tcp_conn;
|
||||
ip_hdr_t *ip_hdr;
|
||||
tcp_hdr_t *tcp_hdr;
|
||||
@@ -1218,7 +1218,7 @@ int data_len;
|
||||
tcp_conn_write(tcp_conn, 1);
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
void
|
||||
tcp_fd_read(tcp_conn, enq)
|
||||
tcp_conn_t *tcp_conn;
|
||||
int enq; /* Enqueue writes. */
|
||||
@@ -1390,7 +1390,7 @@ int enq; /* Enqueue writes. */
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC unsigned
|
||||
unsigned
|
||||
tcp_sel_read(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
@@ -1426,7 +1426,7 @@ tcp_conn_t *tcp_conn;
|
||||
return 1;
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
void
|
||||
tcp_rsel_read(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
@@ -1443,7 +1443,7 @@ tcp_conn_t *tcp_conn;
|
||||
printf("tcp_rsel_read: no select_res\n");
|
||||
}
|
||||
|
||||
PUBLIC void tcp_bytesavailable(tcp_fd, bytesp)
|
||||
void tcp_bytesavailable(tcp_fd, bytesp)
|
||||
tcp_fd_t *tcp_fd;
|
||||
int *bytesp;
|
||||
{
|
||||
|
||||
@@ -19,11 +19,11 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD acc_t *make_pack ARGS(( tcp_conn_t *tcp_conn ));
|
||||
FORWARD void tcp_send_timeout ARGS(( int conn, struct timer *timer ));
|
||||
FORWARD void do_snd_event ARGS(( event_t *ev, ev_arg_t arg ));
|
||||
static acc_t *make_pack ARGS(( tcp_conn_t *tcp_conn ));
|
||||
static void tcp_send_timeout ARGS(( int conn, struct timer *timer ));
|
||||
static void do_snd_event ARGS(( event_t *ev, ev_arg_t arg ));
|
||||
|
||||
PUBLIC void tcp_conn_write (tcp_conn, enq)
|
||||
void tcp_conn_write (tcp_conn, enq)
|
||||
tcp_conn_t *tcp_conn;
|
||||
int enq; /* Writes need to be enqueued. */
|
||||
{
|
||||
@@ -69,7 +69,7 @@ int enq; /* Writes need to be enqueued. */
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void do_snd_event(ev, arg)
|
||||
static void do_snd_event(ev, arg)
|
||||
event_t *ev;
|
||||
ev_arg_t arg;
|
||||
{
|
||||
@@ -81,7 +81,7 @@ ev_arg_t arg;
|
||||
tcp_port_write(tcp_port);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_port_write(tcp_port)
|
||||
void tcp_port_write(tcp_port)
|
||||
tcp_port_t *tcp_port;
|
||||
{
|
||||
tcp_conn_t *tcp_conn;
|
||||
@@ -158,7 +158,7 @@ tcp_port_t *tcp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE acc_t *make_pack(tcp_conn)
|
||||
static acc_t *make_pack(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
acc_t *pack2write, *tmp_pack, *tcp_pack;
|
||||
@@ -530,7 +530,7 @@ after_data:
|
||||
tcp_release_retrans
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_release_retrans(
|
||||
void tcp_release_retrans(
|
||||
tcp_conn_t *tcp_conn,
|
||||
u32_t seg_ack,
|
||||
u16_t new_win
|
||||
@@ -766,7 +766,7 @@ PUBLIC void tcp_release_retrans(
|
||||
tcp_fast_retrans
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_fast_retrans(tcp_conn)
|
||||
void tcp_fast_retrans(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
u16_t mss, mss2;
|
||||
@@ -797,7 +797,7 @@ tcp_conn_t *tcp_conn;
|
||||
}
|
||||
|
||||
#if 0
|
||||
PUBLIC void do_tcp_timeout(tcp_conn)
|
||||
void do_tcp_timeout(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
tcp_send_timeout(tcp_conn-tcp_conn_table,
|
||||
@@ -809,7 +809,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_send_timeout
|
||||
*/
|
||||
|
||||
PRIVATE void tcp_send_timeout(conn, timer)
|
||||
static void tcp_send_timeout(conn, timer)
|
||||
int conn;
|
||||
struct timer *timer;
|
||||
{
|
||||
@@ -1060,7 +1060,7 @@ struct timer *timer;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void tcp_fd_write(tcp_conn)
|
||||
void tcp_fd_write(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -1182,7 +1182,7 @@ tcp_conn_t *tcp_conn;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC unsigned tcp_sel_write(tcp_conn)
|
||||
unsigned tcp_sel_write(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
tcp_fd_t *tcp_fd;
|
||||
@@ -1222,7 +1222,7 @@ tcp_conn_t *tcp_conn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
void
|
||||
tcp_rsel_write(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
@@ -1243,7 +1243,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_shutdown
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_shutdown(tcp_conn)
|
||||
void tcp_shutdown(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
switch (tcp_conn->tc_state)
|
||||
@@ -1272,7 +1272,7 @@ tcp_conn_t *tcp_conn;
|
||||
tcp_set_send_timer(tcp_conn);
|
||||
}
|
||||
|
||||
PUBLIC void tcp_set_send_timer(tcp_conn)
|
||||
void tcp_set_send_timer(tcp_conn)
|
||||
tcp_conn_t *tcp_conn;
|
||||
{
|
||||
clock_t curr_time;
|
||||
@@ -1300,7 +1300,7 @@ tcp_close_connection
|
||||
|
||||
*/
|
||||
|
||||
PUBLIC void tcp_close_connection(tcp_conn, error)
|
||||
void tcp_close_connection(tcp_conn, error)
|
||||
tcp_conn_t *tcp_conn;
|
||||
int error;
|
||||
{
|
||||
|
||||
@@ -19,45 +19,45 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void read_ip_packets ARGS(( udp_port_t *udp_port ));
|
||||
FORWARD void udp_buffree ARGS(( int priority ));
|
||||
static void read_ip_packets ARGS(( udp_port_t *udp_port ));
|
||||
static void udp_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void udp_bufcheck ARGS(( void ));
|
||||
static void udp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
FORWARD void udp_main ARGS(( udp_port_t *udp_port ));
|
||||
FORWARD int udp_select ARGS(( int fd, unsigned operations ));
|
||||
FORWARD acc_t *udp_get_data ARGS(( int fd, size_t offset, size_t count,
|
||||
static void udp_main ARGS(( udp_port_t *udp_port ));
|
||||
static int udp_select ARGS(( int fd, unsigned operations ));
|
||||
static acc_t *udp_get_data ARGS(( int fd, size_t offset, size_t count,
|
||||
int for_ioctl ));
|
||||
FORWARD int udp_put_data ARGS(( int fd, size_t offset, acc_t *data,
|
||||
static int udp_put_data ARGS(( int fd, size_t offset, acc_t *data,
|
||||
int for_ioctl ));
|
||||
FORWARD int udp_peek ARGS(( udp_fd_t * ));
|
||||
FORWARD int udp_sel_read ARGS(( udp_fd_t * ));
|
||||
FORWARD void udp_restart_write_port ARGS(( udp_port_t *udp_port ));
|
||||
FORWARD void udp_ip_arrived ARGS(( int port, acc_t *pack, size_t pack_size ));
|
||||
FORWARD void reply_thr_put ARGS(( udp_fd_t *udp_fd, int reply,
|
||||
static int udp_peek ARGS(( udp_fd_t * ));
|
||||
static int udp_sel_read ARGS(( udp_fd_t * ));
|
||||
static void udp_restart_write_port ARGS(( udp_port_t *udp_port ));
|
||||
static void udp_ip_arrived ARGS(( int port, acc_t *pack, size_t pack_size ));
|
||||
static void reply_thr_put ARGS(( udp_fd_t *udp_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD void reply_thr_get ARGS(( udp_fd_t *udp_fd, int reply,
|
||||
static void reply_thr_get ARGS(( udp_fd_t *udp_fd, int reply,
|
||||
int for_ioctl ));
|
||||
FORWARD int udp_setopt ARGS(( udp_fd_t *udp_fd ));
|
||||
FORWARD udpport_t find_unused_port ARGS(( int fd ));
|
||||
FORWARD int is_unused_port ARGS(( udpport_t port ));
|
||||
FORWARD int udp_packet2user ARGS(( udp_fd_t *udp_fd ));
|
||||
FORWARD void restart_write_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
FORWARD u16_t pack_oneCsum ARGS(( acc_t *pack ));
|
||||
FORWARD void udp_rd_enqueue ARGS(( udp_fd_t *udp_fd, acc_t *pack,
|
||||
static int udp_setopt ARGS(( udp_fd_t *udp_fd ));
|
||||
static udpport_t find_unused_port ARGS(( int fd ));
|
||||
static int is_unused_port ARGS(( udpport_t port ));
|
||||
static int udp_packet2user ARGS(( udp_fd_t *udp_fd ));
|
||||
static void restart_write_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
static u16_t pack_oneCsum ARGS(( acc_t *pack ));
|
||||
static void udp_rd_enqueue ARGS(( udp_fd_t *udp_fd, acc_t *pack,
|
||||
clock_t exp_tim ));
|
||||
FORWARD void hash_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
FORWARD void unhash_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
static void hash_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
static void unhash_fd ARGS(( udp_fd_t *udp_fd ));
|
||||
|
||||
PUBLIC udp_port_t *udp_port_table;
|
||||
PUBLIC udp_fd_t udp_fd_table[UDP_FD_NR];
|
||||
udp_port_t *udp_port_table;
|
||||
udp_fd_t udp_fd_table[UDP_FD_NR];
|
||||
|
||||
PUBLIC void udp_prep()
|
||||
void udp_prep()
|
||||
{
|
||||
udp_port_table= alloc(udp_conf_nr * sizeof(udp_port_table[0]));
|
||||
}
|
||||
|
||||
PUBLIC void udp_init()
|
||||
void udp_init()
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
udp_port_t *udp_port;
|
||||
@@ -104,7 +104,7 @@ PUBLIC void udp_init()
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC int udp_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
int udp_open (port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -141,7 +141,7 @@ select_res_t select_res;
|
||||
|
||||
}
|
||||
|
||||
PUBLIC int udp_ioctl (fd, req)
|
||||
int udp_ioctl (fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -192,7 +192,7 @@ assert (opt_acc->acc_length == sizeof(*udp_opt));
|
||||
return result;
|
||||
}
|
||||
|
||||
PUBLIC int udp_read (fd, count)
|
||||
int udp_read (fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -225,7 +225,7 @@ size_t count;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PRIVATE void udp_main(udp_port)
|
||||
static void udp_main(udp_port)
|
||||
udp_port_t *udp_port;
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
@@ -292,7 +292,7 @@ udp_port_t *udp_port;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int udp_select(fd, operations)
|
||||
static int udp_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -323,7 +323,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PRIVATE acc_t *udp_get_data (port, offset, count, for_ioctl)
|
||||
static acc_t *udp_get_data (port, offset, count, for_ioctl)
|
||||
int port;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -409,7 +409,7 @@ assert (udp_port->up_wr_pack);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE int udp_put_data (fd, offset, data, for_ioctl)
|
||||
static int udp_put_data (fd, offset, data, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -478,7 +478,7 @@ assert (!offset); /* This isn't a valid assertion but ip sends only
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE int udp_setopt(udp_fd)
|
||||
static int udp_setopt(udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
udp_fd_t *fd_ptr;
|
||||
@@ -676,7 +676,7 @@ assert (data->acc_length == sizeof(nwio_udpopt_t));
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE udpport_t find_unused_port(int fd)
|
||||
static udpport_t find_unused_port(int fd)
|
||||
{
|
||||
udpport_t port, nw_port;
|
||||
|
||||
@@ -700,7 +700,7 @@ PRIVATE udpport_t find_unused_port(int fd)
|
||||
reply_thr_put
|
||||
*/
|
||||
|
||||
PRIVATE void reply_thr_put(udp_fd, reply, for_ioctl)
|
||||
static void reply_thr_put(udp_fd, reply, for_ioctl)
|
||||
udp_fd_t *udp_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -716,7 +716,7 @@ int for_ioctl;
|
||||
reply_thr_get
|
||||
*/
|
||||
|
||||
PRIVATE void reply_thr_get(udp_fd, reply, for_ioctl)
|
||||
static void reply_thr_get(udp_fd, reply, for_ioctl)
|
||||
udp_fd_t *udp_fd;
|
||||
int reply;
|
||||
int for_ioctl;
|
||||
@@ -727,7 +727,7 @@ int for_ioctl;
|
||||
assert (!result);
|
||||
}
|
||||
|
||||
PRIVATE int is_unused_port(udpport_t port)
|
||||
static int is_unused_port(udpport_t port)
|
||||
{
|
||||
int i;
|
||||
udp_fd_t *udp_fd;
|
||||
@@ -743,7 +743,7 @@ PRIVATE int is_unused_port(udpport_t port)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PRIVATE void read_ip_packets(udp_port)
|
||||
static void read_ip_packets(udp_port)
|
||||
udp_port_t *udp_port;
|
||||
{
|
||||
int result;
|
||||
@@ -763,7 +763,7 @@ assert(result == NW_OK);
|
||||
}
|
||||
|
||||
|
||||
PRIVATE int udp_peek (udp_fd)
|
||||
static int udp_peek (udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
acc_t *pack, *tmp_acc, *next_acc;
|
||||
@@ -804,7 +804,7 @@ udp_fd_t *udp_fd;
|
||||
return NW_SUSPEND;
|
||||
}
|
||||
|
||||
PRIVATE int udp_sel_read (udp_fd_t *udp_fd)
|
||||
static int udp_sel_read (udp_fd_t *udp_fd)
|
||||
{
|
||||
acc_t *tmp_acc, *next_acc;
|
||||
|
||||
@@ -828,7 +828,7 @@ PRIVATE int udp_sel_read (udp_fd_t *udp_fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int udp_packet2user (udp_fd)
|
||||
static int udp_packet2user (udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
acc_t *pack, *tmp_pack;
|
||||
@@ -889,7 +889,7 @@ udp_fd_t *udp_fd;
|
||||
return result;
|
||||
}
|
||||
|
||||
PRIVATE void udp_ip_arrived(port, pack, pack_size)
|
||||
static void udp_ip_arrived(port, pack, pack_size)
|
||||
int port;
|
||||
acc_t *pack;
|
||||
size_t pack_size;
|
||||
@@ -1158,7 +1158,7 @@ size_t pack_size;
|
||||
bf_afree(udp_acc);
|
||||
}
|
||||
|
||||
PUBLIC void udp_close(fd)
|
||||
void udp_close(fd)
|
||||
int fd;
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
@@ -1182,7 +1182,7 @@ int fd;
|
||||
udp_fd->uf_rdbuf_head= NULL;
|
||||
}
|
||||
|
||||
PUBLIC int udp_write(int fd, size_t count)
|
||||
int udp_write(int fd, size_t count)
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
|
||||
@@ -1214,7 +1214,7 @@ assert (!(udp_fd->uf_flags & UFF_WRITE_IP));
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void restart_write_fd(udp_fd)
|
||||
static void restart_write_fd(udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
udp_port_t *udp_port;
|
||||
@@ -1375,7 +1375,7 @@ assert (!(udp_port->up_flags & UPF_WRITE_IP));
|
||||
reply_thr_get (udp_fd, udp_fd->uf_wr_count, FALSE);
|
||||
}
|
||||
|
||||
PRIVATE u16_t pack_oneCsum(pack)
|
||||
static u16_t pack_oneCsum(pack)
|
||||
acc_t *pack;
|
||||
{
|
||||
u16_t prev;
|
||||
@@ -1423,7 +1423,7 @@ acc_t *pack;
|
||||
return prev;
|
||||
}
|
||||
|
||||
PRIVATE void udp_restart_write_port(udp_port )
|
||||
static void udp_restart_write_port(udp_port )
|
||||
udp_port_t *udp_port;
|
||||
{
|
||||
udp_fd_t *udp_fd;
|
||||
@@ -1459,7 +1459,7 @@ assert (!(udp_port->up_flags & (UPF_WRITE_IP|UPF_WRITE_SP)));
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC int udp_cancel(fd, which_operation)
|
||||
int udp_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -1495,7 +1495,7 @@ assert (udp_fd->uf_flags & UFF_IOCTL_IP);
|
||||
return NW_OK;
|
||||
}
|
||||
|
||||
PRIVATE void udp_buffree (priority)
|
||||
static void udp_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
int i;
|
||||
@@ -1530,7 +1530,7 @@ int priority;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void udp_rd_enqueue(udp_fd, pack, exp_tim)
|
||||
static void udp_rd_enqueue(udp_fd, pack, exp_tim)
|
||||
udp_fd_t *udp_fd;
|
||||
acc_t *pack;
|
||||
clock_t exp_tim;
|
||||
@@ -1578,7 +1578,7 @@ clock_t exp_tim;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void hash_fd(udp_fd)
|
||||
static void hash_fd(udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
udp_port_t *udp_port;
|
||||
@@ -1602,7 +1602,7 @@ udp_fd_t *udp_fd;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void unhash_fd(udp_fd)
|
||||
static void unhash_fd(udp_fd)
|
||||
udp_fd_t *udp_fd;
|
||||
{
|
||||
udp_port_t *udp_port;
|
||||
@@ -1637,7 +1637,7 @@ udp_fd_t *udp_fd;
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void udp_bufcheck()
|
||||
static void udp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
udp_port_t *udp_port;
|
||||
|
||||
Reference in New Issue
Block a user