retire PUBLIC, PRIVATE and FORWARD
This commit is contained in:
@@ -60,53 +60,53 @@ THIS_FILE
|
||||
|
||||
#if BUF512_NR
|
||||
DECLARE_TYPE(buf512, buf512_t, 512);
|
||||
PRIVATE acc_t *buf512_freelist;
|
||||
static acc_t *buf512_freelist;
|
||||
DECLARE_STORAGE(buf512_t, buffers512, BUF512_NR);
|
||||
FORWARD void bf_512free ARGS(( acc_t *acc ));
|
||||
static void bf_512free ARGS(( acc_t *acc ));
|
||||
#endif
|
||||
#if BUF2K_NR
|
||||
DECLARE_TYPE(buf2K, buf2K_t, (2*1024));
|
||||
PRIVATE acc_t *buf2K_freelist;
|
||||
static acc_t *buf2K_freelist;
|
||||
DECLARE_STORAGE(buf2K_t, buffers2K, BUF2K_NR);
|
||||
FORWARD void bf_2Kfree ARGS(( acc_t *acc ));
|
||||
static void bf_2Kfree ARGS(( acc_t *acc ));
|
||||
#endif
|
||||
#if BUF32K_NR
|
||||
DECLARE_TYPE(buf32K, buf32K_t, (32*1024));
|
||||
PRIVATE acc_t *buf32K_freelist;
|
||||
static acc_t *buf32K_freelist;
|
||||
DECLARE_STORAGE(buf32K_t, buffers32K, BUF32K_NR);
|
||||
FORWARD void bf_32Kfree ARGS(( acc_t *acc ));
|
||||
static void bf_32Kfree ARGS(( acc_t *acc ));
|
||||
#endif
|
||||
|
||||
PRIVATE acc_t *acc_freelist;
|
||||
static acc_t *acc_freelist;
|
||||
DECLARE_STORAGE(acc_t, accessors, ACC_NR);
|
||||
|
||||
PRIVATE bf_freereq_t freereq[CLIENT_NR];
|
||||
PRIVATE size_t bf_buf_gran;
|
||||
static bf_freereq_t freereq[CLIENT_NR];
|
||||
static size_t bf_buf_gran;
|
||||
|
||||
PUBLIC size_t bf_free_bufsize;
|
||||
PUBLIC acc_t *bf_temporary_acc;
|
||||
PUBLIC acc_t *bf_linkcheck_acc;
|
||||
size_t bf_free_bufsize;
|
||||
acc_t *bf_temporary_acc;
|
||||
acc_t *bf_linkcheck_acc;
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
int inet_buf_debug;
|
||||
unsigned buf_generation;
|
||||
PRIVATE bf_checkreq_t checkreq[CLIENT_NR];
|
||||
static bf_checkreq_t checkreq[CLIENT_NR];
|
||||
#endif
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
FORWARD acc_t *bf_small_memreq ARGS(( size_t size ));
|
||||
static acc_t *bf_small_memreq ARGS(( size_t size ));
|
||||
#else
|
||||
FORWARD acc_t *_bf_small_memreq ARGS(( char *clnt_file, int clnt_line,
|
||||
static acc_t *_bf_small_memreq ARGS(( char *clnt_file, int clnt_line,
|
||||
size_t size ));
|
||||
#define bf_small_memreq(a) _bf_small_memreq(clnt_file, clnt_line, a)
|
||||
#endif
|
||||
FORWARD void free_accs ARGS(( void ));
|
||||
static void free_accs ARGS(( void ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void count_free_bufs ARGS(( acc_t *list ));
|
||||
FORWARD int report_buffer ARGS(( buf_t *buf, char *label, int i ));
|
||||
static void count_free_bufs ARGS(( acc_t *list ));
|
||||
static int report_buffer ARGS(( buf_t *buf, char *label, int i ));
|
||||
#endif
|
||||
|
||||
PUBLIC void bf_init()
|
||||
void bf_init()
|
||||
{
|
||||
int i;
|
||||
size_t buf_s;
|
||||
@@ -189,10 +189,10 @@ PUBLIC void bf_init()
|
||||
}
|
||||
|
||||
#ifndef BUF_CONSISTENCY_CHECK
|
||||
PUBLIC void bf_logon(func)
|
||||
void bf_logon(func)
|
||||
bf_freereq_t func;
|
||||
#else
|
||||
PUBLIC void bf_logon(func, checkfunc)
|
||||
void bf_logon(func, checkfunc)
|
||||
bf_freereq_t func;
|
||||
bf_checkreq_t checkfunc;
|
||||
#endif
|
||||
@@ -217,9 +217,9 @@ bf_memreq
|
||||
*/
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_memreq(size)
|
||||
acc_t *bf_memreq(size)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_memreq(clnt_file, clnt_line, size)
|
||||
acc_t *_bf_memreq(clnt_file, clnt_line, size)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -322,9 +322,9 @@ bf_small_memreq
|
||||
*/
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PRIVATE acc_t *bf_small_memreq(size)
|
||||
static acc_t *bf_small_memreq(size)
|
||||
#else
|
||||
PRIVATE acc_t *_bf_small_memreq(clnt_file, clnt_line, size)
|
||||
static acc_t *_bf_small_memreq(clnt_file, clnt_line, size)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -334,9 +334,9 @@ size_t size;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC void bf_afree(acc)
|
||||
void bf_afree(acc)
|
||||
#else
|
||||
PUBLIC void _bf_afree(clnt_file, clnt_line, acc)
|
||||
void _bf_afree(clnt_file, clnt_line, acc)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -401,9 +401,9 @@ acc_t *acc;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_dupacc(acc_ptr)
|
||||
acc_t *bf_dupacc(acc_ptr)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_dupacc(clnt_file, clnt_line, acc_ptr)
|
||||
acc_t *_bf_dupacc(clnt_file, clnt_line, acc_ptr)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -433,7 +433,7 @@ register acc_t *acc_ptr;
|
||||
return new_acc;
|
||||
}
|
||||
|
||||
PUBLIC size_t bf_bufsize(acc_ptr)
|
||||
size_t bf_bufsize(acc_ptr)
|
||||
register acc_t *acc_ptr;
|
||||
{
|
||||
register size_t size;
|
||||
@@ -452,9 +452,9 @@ assert(acc_ptr >= accessors && acc_ptr <= &accessors[ACC_NR-1]);
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_packIffLess(pack, min_len)
|
||||
acc_t *bf_packIffLess(pack, min_len)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_packIffLess(clnt_file, clnt_line, pack, min_len)
|
||||
acc_t *_bf_packIffLess(clnt_file, clnt_line, pack, min_len)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -474,9 +474,9 @@ int min_len;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_pack(old_acc)
|
||||
acc_t *bf_pack(old_acc)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_pack(clnt_file, clnt_line, old_acc)
|
||||
acc_t *_bf_pack(clnt_file, clnt_line, old_acc)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -532,9 +532,9 @@ acc_t *old_acc;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_cut (data, offset, length)
|
||||
acc_t *bf_cut (data, offset, length)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_cut (clnt_file, clnt_line, data, offset, length)
|
||||
acc_t *_bf_cut (clnt_file, clnt_line, data, offset, length)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -614,9 +614,9 @@ register unsigned length;
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_delhead (data, offset)
|
||||
acc_t *bf_delhead (data, offset)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_delhead (clnt_file, clnt_line, data, offset)
|
||||
acc_t *_bf_delhead (clnt_file, clnt_line, data, offset)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -668,9 +668,9 @@ bf_append
|
||||
*/
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_append(data_first, data_second)
|
||||
acc_t *bf_append(data_first, data_second)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_append(clnt_file, clnt_line, data_first, data_second)
|
||||
acc_t *_bf_append(clnt_file, clnt_line, data_first, data_second)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
@@ -818,7 +818,7 @@ assert (offset_old < data_second->acc_length);
|
||||
}
|
||||
|
||||
#if BUF512_NR
|
||||
PRIVATE void bf_512free(acc)
|
||||
static void bf_512free(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
@@ -830,7 +830,7 @@ acc_t *acc;
|
||||
}
|
||||
#endif
|
||||
#if BUF2K_NR
|
||||
PRIVATE void bf_2Kfree(acc)
|
||||
static void bf_2Kfree(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
@@ -842,7 +842,7 @@ acc_t *acc;
|
||||
}
|
||||
#endif
|
||||
#if BUF32K_NR
|
||||
PRIVATE void bf_32Kfree(acc)
|
||||
static void bf_32Kfree(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
@@ -855,7 +855,7 @@ acc_t *acc;
|
||||
#endif
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PUBLIC int bf_consistency_check()
|
||||
int bf_consistency_check()
|
||||
{
|
||||
acc_t *acc;
|
||||
int silent;
|
||||
@@ -980,7 +980,7 @@ PUBLIC int bf_consistency_check()
|
||||
return !error;
|
||||
}
|
||||
|
||||
PRIVATE void count_free_bufs(list)
|
||||
static void count_free_bufs(list)
|
||||
acc_t *list;
|
||||
{
|
||||
acc_t *acc;
|
||||
@@ -1011,7 +1011,7 @@ acc_t *list;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int report_buffer(buf, label, i)
|
||||
static int report_buffer(buf, label, i)
|
||||
buf_t *buf;
|
||||
char *label;
|
||||
int i;
|
||||
@@ -1047,7 +1047,7 @@ int i;
|
||||
return 1;
|
||||
}
|
||||
|
||||
PUBLIC void bf_check_acc(acc)
|
||||
void bf_check_acc(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
buf_t *buf;
|
||||
@@ -1081,7 +1081,7 @@ acc_t *acc;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void _bf_mark_1acc(clnt_file, clnt_line, acc)
|
||||
void _bf_mark_1acc(clnt_file, clnt_line, acc)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
acc_t *acc;
|
||||
@@ -1090,7 +1090,7 @@ acc_t *acc;
|
||||
acc->acc_alloc_line= clnt_line;
|
||||
}
|
||||
|
||||
PUBLIC void _bf_mark_acc(clnt_file, clnt_line, acc)
|
||||
void _bf_mark_acc(clnt_file, clnt_line, acc)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
acc_t *acc;
|
||||
@@ -1108,7 +1108,7 @@ acc_t *acc;
|
||||
}
|
||||
#endif
|
||||
|
||||
PUBLIC int bf_linkcheck(acc)
|
||||
int bf_linkcheck(acc)
|
||||
acc_t *acc;
|
||||
{
|
||||
int i;
|
||||
@@ -1163,7 +1163,7 @@ acc_t *acc;
|
||||
return 1;
|
||||
}
|
||||
|
||||
PRIVATE void free_accs()
|
||||
static void free_accs()
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@@ -1190,9 +1190,9 @@ assert(bf_linkcheck(bf_linkcheck_acc));
|
||||
}
|
||||
|
||||
#ifndef BUF_TRACK_ALLOC_FREE
|
||||
PUBLIC acc_t *bf_align(acc, size, alignment)
|
||||
acc_t *bf_align(acc, size, alignment)
|
||||
#else
|
||||
PUBLIC acc_t *_bf_align(clnt_file, clnt_line, acc, size, alignment)
|
||||
acc_t *_bf_align(clnt_file, clnt_line, acc, size, alignment)
|
||||
char *clnt_file;
|
||||
int clnt_line;
|
||||
#endif
|
||||
|
||||
@@ -12,17 +12,17 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
PUBLIC int clck_call_expire;
|
||||
int clck_call_expire;
|
||||
|
||||
PRIVATE time_t curr_time;
|
||||
PRIVATE time_t prev_time;
|
||||
PRIVATE timer_t *timer_chain;
|
||||
PRIVATE time_t next_timeout;
|
||||
static time_t curr_time;
|
||||
static time_t prev_time;
|
||||
static timer_t *timer_chain;
|
||||
static time_t next_timeout;
|
||||
|
||||
FORWARD void clck_fast_release(timer_t *timer);
|
||||
FORWARD void set_timer(void);
|
||||
static void clck_fast_release(timer_t *timer);
|
||||
static void set_timer(void);
|
||||
|
||||
PUBLIC void clck_init()
|
||||
void clck_init()
|
||||
{
|
||||
clck_call_expire= 0;
|
||||
curr_time= 0;
|
||||
@@ -31,7 +31,7 @@ PUBLIC void clck_init()
|
||||
timer_chain= 0;
|
||||
}
|
||||
|
||||
PUBLIC time_t get_time()
|
||||
time_t get_time()
|
||||
{
|
||||
if (!curr_time)
|
||||
{
|
||||
@@ -42,7 +42,7 @@ PUBLIC time_t get_time()
|
||||
return curr_time;
|
||||
}
|
||||
|
||||
PUBLIC void set_time (tim)
|
||||
void set_time (tim)
|
||||
time_t tim;
|
||||
{
|
||||
if (!curr_time && tim >= prev_time)
|
||||
@@ -59,13 +59,13 @@ time_t tim;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void reset_time()
|
||||
void reset_time()
|
||||
{
|
||||
prev_time= curr_time;
|
||||
curr_time= 0;
|
||||
}
|
||||
|
||||
PUBLIC void clck_timer(timer, timeout, func, fd)
|
||||
void clck_timer(timer, timeout, func, fd)
|
||||
timer_t *timer;
|
||||
time_t timeout;
|
||||
timer_func_t func;
|
||||
@@ -103,14 +103,14 @@ int fd;
|
||||
set_timer();
|
||||
}
|
||||
|
||||
PUBLIC void clck_tick (mess)
|
||||
void clck_tick (mess)
|
||||
message *mess;
|
||||
{
|
||||
next_timeout= 0;
|
||||
set_timer();
|
||||
}
|
||||
|
||||
PRIVATE void clck_fast_release (timer)
|
||||
static void clck_fast_release (timer)
|
||||
timer_t *timer;
|
||||
{
|
||||
timer_t *timer_index;
|
||||
@@ -131,7 +131,7 @@ timer_t *timer;
|
||||
timer->tim_active= 0;
|
||||
}
|
||||
|
||||
PRIVATE void set_timer()
|
||||
static void set_timer()
|
||||
{
|
||||
time_t new_time;
|
||||
time_t curr_time;
|
||||
@@ -157,14 +157,14 @@ PRIVATE void set_timer()
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void clck_untimer (timer)
|
||||
void clck_untimer (timer)
|
||||
timer_t *timer;
|
||||
{
|
||||
clck_fast_release (timer);
|
||||
set_timer();
|
||||
}
|
||||
|
||||
PUBLIC void clck_expire_timers()
|
||||
void clck_expire_timers()
|
||||
{
|
||||
time_t curr_time;
|
||||
timer_t *timer_index;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -82,15 +82,15 @@ extern int inet_buf_debug;
|
||||
u32_t system_hz;
|
||||
#endif
|
||||
|
||||
FORWARD void nw_conf(void);
|
||||
FORWARD void nw_init(void);
|
||||
FORWARD void ds_event(void);
|
||||
static void nw_conf(void);
|
||||
static void nw_init(void);
|
||||
static void ds_event(void);
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
|
||||
PUBLIC int main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
mq_t *mq;
|
||||
int ipc_status;
|
||||
@@ -188,7 +188,7 @@ PUBLIC int main(int argc, char *argv[])
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -203,7 +203,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
{
|
||||
/* Initialize the inet server. */
|
||||
int r;
|
||||
@@ -301,7 +301,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
return(OK);
|
||||
}
|
||||
|
||||
PRIVATE void nw_conf()
|
||||
static void nw_conf()
|
||||
{
|
||||
read_conf();
|
||||
eth_prep();
|
||||
@@ -312,7 +312,7 @@ PRIVATE void nw_conf()
|
||||
udp_prep();
|
||||
}
|
||||
|
||||
PRIVATE void nw_init()
|
||||
static void nw_init()
|
||||
{
|
||||
mq_init();
|
||||
bf_init();
|
||||
@@ -330,7 +330,7 @@ PRIVATE void nw_init()
|
||||
/*===========================================================================*
|
||||
* ds_event *
|
||||
*===========================================================================*/
|
||||
PRIVATE void ds_event()
|
||||
static void ds_event()
|
||||
{
|
||||
char key[DS_MAX_KEYLEN];
|
||||
char *driver_prefix = "drv.net.";
|
||||
@@ -370,14 +370,14 @@ PRIVATE void ds_event()
|
||||
printf("inet: ds_event: ds_check failed: %d\n", r);
|
||||
}
|
||||
|
||||
PUBLIC void panic0(file, line)
|
||||
void panic0(file, line)
|
||||
char *file;
|
||||
int line;
|
||||
{
|
||||
printf("panic at %s, %d: ", file, line);
|
||||
}
|
||||
|
||||
PUBLIC void inet_panic()
|
||||
void inet_panic()
|
||||
{
|
||||
printf("\ninet stacktrace: ");
|
||||
util_stacktrace();
|
||||
@@ -386,7 +386,7 @@ PUBLIC void inet_panic()
|
||||
}
|
||||
|
||||
#if !NDEBUG
|
||||
PUBLIC void bad_assertion(file, line, what)
|
||||
void bad_assertion(file, line, what)
|
||||
char *file;
|
||||
int line;
|
||||
char *what;
|
||||
@@ -397,7 +397,7 @@ char *what;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC void bad_compare(file, line, lhs, what, rhs)
|
||||
void bad_compare(file, line, lhs, what, rhs)
|
||||
char *file;
|
||||
int line;
|
||||
int lhs;
|
||||
|
||||
@@ -21,14 +21,14 @@ Copyright 1995 Philip Homburg
|
||||
|
||||
THIS_FILE
|
||||
|
||||
FORWARD void setup_read(eth_port_t *eth_port);
|
||||
FORWARD void read_int(eth_port_t *eth_port, int count);
|
||||
FORWARD void eth_issue_send(eth_port_t *eth_port);
|
||||
FORWARD void write_int(eth_port_t *eth_port);
|
||||
FORWARD void eth_restart(eth_port_t *eth_port, endpoint_t endpoint);
|
||||
FORWARD void send_getstat(eth_port_t *eth_port);
|
||||
static void setup_read(eth_port_t *eth_port);
|
||||
static void read_int(eth_port_t *eth_port, int count);
|
||||
static void eth_issue_send(eth_port_t *eth_port);
|
||||
static void write_int(eth_port_t *eth_port);
|
||||
static void eth_restart(eth_port_t *eth_port, endpoint_t endpoint);
|
||||
static void send_getstat(eth_port_t *eth_port);
|
||||
|
||||
PUBLIC void osdep_eth_init()
|
||||
void osdep_eth_init()
|
||||
{
|
||||
int i, j, rport;
|
||||
struct eth_conf *ecp;
|
||||
@@ -155,7 +155,7 @@ PUBLIC void osdep_eth_init()
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void eth_write_port(eth_port, pack)
|
||||
void eth_write_port(eth_port, pack)
|
||||
eth_port_t *eth_port;
|
||||
acc_t *pack;
|
||||
{
|
||||
@@ -175,7 +175,7 @@ acc_t *pack;
|
||||
eth_issue_send(eth_port);
|
||||
}
|
||||
|
||||
PUBLIC void eth_rec(message *m)
|
||||
void eth_rec(message *m)
|
||||
{
|
||||
int i, r, m_type, flags;
|
||||
eth_port_t *loc_port, *vlan_port;
|
||||
@@ -362,7 +362,7 @@ PUBLIC void eth_rec(message *m)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void eth_check_driver(char *label, endpoint_t endpoint)
|
||||
void eth_check_driver(char *label, endpoint_t endpoint)
|
||||
{
|
||||
int i;
|
||||
eth_port_t *loc_port;
|
||||
@@ -384,7 +384,7 @@ PUBLIC void eth_check_driver(char *label, endpoint_t endpoint)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC int eth_get_stat(eth_port, eth_stat)
|
||||
int eth_get_stat(eth_port, eth_stat)
|
||||
eth_port_t *eth_port;
|
||||
eth_stat_t *eth_stat;
|
||||
{
|
||||
@@ -417,7 +417,7 @@ eth_stat_t *eth_stat;
|
||||
return SUSPEND;
|
||||
}
|
||||
|
||||
PUBLIC void eth_set_rec_conf (eth_port, flags)
|
||||
void eth_set_rec_conf (eth_port, flags)
|
||||
eth_port_t *eth_port;
|
||||
u32_t flags;
|
||||
{
|
||||
@@ -478,7 +478,7 @@ u32_t flags;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void eth_issue_send(eth_port)
|
||||
static void eth_issue_send(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
int i, r, pack_size;
|
||||
@@ -557,7 +557,7 @@ eth_port_t *eth_port;
|
||||
eth_port->etp_osdep.etp_state= OEPS_SEND_SENT;
|
||||
}
|
||||
|
||||
PRIVATE void write_int(eth_port_t *eth_port)
|
||||
static void write_int(eth_port_t *eth_port)
|
||||
{
|
||||
acc_t *pack;
|
||||
int multicast;
|
||||
@@ -590,7 +590,7 @@ PRIVATE void write_int(eth_port_t *eth_port)
|
||||
eth_restart_write(eth_port);
|
||||
}
|
||||
|
||||
PRIVATE void read_int(eth_port, count)
|
||||
static void read_int(eth_port, count)
|
||||
eth_port_t *eth_port;
|
||||
int count;
|
||||
{
|
||||
@@ -654,7 +654,7 @@ int count;
|
||||
setup_read(eth_port);
|
||||
}
|
||||
|
||||
PRIVATE void setup_read(eth_port)
|
||||
static void setup_read(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
acc_t *pack, *pack_ptr;
|
||||
@@ -812,7 +812,7 @@ static void eth_restart(eth_port_t *eth_port, endpoint_t endpoint)
|
||||
|
||||
}
|
||||
|
||||
PRIVATE void send_getstat(eth_port)
|
||||
static void send_getstat(eth_port)
|
||||
eth_port_t *eth_port;
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -14,8 +14,8 @@ THIS_FILE
|
||||
|
||||
#define MQ_SIZE 128
|
||||
|
||||
PRIVATE mq_t mq_list[MQ_SIZE];
|
||||
PRIVATE mq_t *mq_freelist;
|
||||
static mq_t mq_list[MQ_SIZE];
|
||||
static mq_t *mq_freelist;
|
||||
|
||||
void mq_init()
|
||||
{
|
||||
|
||||
@@ -42,9 +42,9 @@ typedef struct qp_fd
|
||||
#define QFF_EMPTY 0
|
||||
#define QFF_INUSE 1
|
||||
|
||||
PRIVATE qp_fd_t qp_fd_table[QP_FD_NR];
|
||||
static qp_fd_t qp_fd_table[QP_FD_NR];
|
||||
|
||||
PRIVATE struct export_param_list inet_ex_list[]=
|
||||
static struct export_param_list inet_ex_list[]=
|
||||
{
|
||||
QP_VARIABLE(sr_fd_table),
|
||||
QP_VARIABLE(ip_dev),
|
||||
@@ -56,9 +56,9 @@ PRIVATE struct export_param_list inet_ex_list[]=
|
||||
QP_END()
|
||||
};
|
||||
|
||||
PRIVATE struct export_params inet_ex_params= { inet_ex_list, NULL };
|
||||
static struct export_params inet_ex_params= { inet_ex_list, NULL };
|
||||
|
||||
PRIVATE struct queryvars {
|
||||
static struct queryvars {
|
||||
/* Input */
|
||||
acc_t *param;
|
||||
|
||||
@@ -73,25 +73,25 @@ PRIVATE struct queryvars {
|
||||
} *qvars;
|
||||
|
||||
|
||||
FORWARD int qp_open ARGS(( int port, int srfd,
|
||||
static int qp_open ARGS(( int port, int srfd,
|
||||
get_userdata_t get_userdata, put_userdata_t put_userdata,
|
||||
put_pkt_t put_pkt, select_res_t select_res ));
|
||||
FORWARD void qp_close ARGS(( int fd ));
|
||||
FORWARD int qp_read ARGS(( int fd, size_t count ));
|
||||
FORWARD int qp_write ARGS(( int fd, size_t count ));
|
||||
FORWARD int qp_ioctl ARGS(( int fd, ioreq_t req ));
|
||||
FORWARD int qp_cancel ARGS(( int fd, int which_operation ));
|
||||
FORWARD int qp_select ARGS(( int fd, unsigned operations ));
|
||||
FORWARD qp_fd_t *get_qp_fd ARGS(( int fd ));
|
||||
FORWARD int do_query ARGS(( qp_fd_t *qp_fd, acc_t *pkt, int count ));
|
||||
FORWARD int qp_getc ARGS(( void ));
|
||||
FORWARD void qp_putc ARGS(( struct queryvars *qv, int c ));
|
||||
FORWARD void qp_buffree ARGS(( int priority ));
|
||||
static void qp_close ARGS(( int fd ));
|
||||
static int qp_read ARGS(( int fd, size_t count ));
|
||||
static int qp_write ARGS(( int fd, size_t count ));
|
||||
static int qp_ioctl ARGS(( int fd, ioreq_t req ));
|
||||
static int qp_cancel ARGS(( int fd, int which_operation ));
|
||||
static int qp_select ARGS(( int fd, unsigned operations ));
|
||||
static qp_fd_t *get_qp_fd ARGS(( int fd ));
|
||||
static int do_query ARGS(( qp_fd_t *qp_fd, acc_t *pkt, int count ));
|
||||
static int qp_getc ARGS(( void ));
|
||||
static void qp_putc ARGS(( struct queryvars *qv, int c ));
|
||||
static void qp_buffree ARGS(( int priority ));
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
FORWARD void qp_bufcheck ARGS(( void ));
|
||||
static void qp_bufcheck ARGS(( void ));
|
||||
#endif
|
||||
|
||||
PUBLIC void qp_init()
|
||||
void qp_init()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -110,7 +110,7 @@ PUBLIC void qp_init()
|
||||
qp_ioctl, qp_cancel, qp_select);
|
||||
}
|
||||
|
||||
PRIVATE int qp_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
static int qp_open(port, srfd, get_userdata, put_userdata, put_pkt,
|
||||
select_res)
|
||||
int port;
|
||||
int srfd;
|
||||
@@ -139,7 +139,7 @@ select_res_t select_res;
|
||||
return i;
|
||||
}
|
||||
|
||||
PRIVATE void qp_close(fd)
|
||||
static void qp_close(fd)
|
||||
int fd;
|
||||
{
|
||||
qp_fd_t *qp_fd;
|
||||
@@ -153,7 +153,7 @@ int fd;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int qp_read(fd, count)
|
||||
static int qp_read(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -177,7 +177,7 @@ size_t count;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int qp_write(fd, count)
|
||||
static int qp_write(fd, count)
|
||||
int fd;
|
||||
size_t count;
|
||||
{
|
||||
@@ -210,7 +210,7 @@ size_t count;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int qp_ioctl(fd, req)
|
||||
static int qp_ioctl(fd, req)
|
||||
int fd;
|
||||
ioreq_t req;
|
||||
{
|
||||
@@ -222,7 +222,7 @@ ioreq_t req;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int qp_cancel(fd, which_operation)
|
||||
static int qp_cancel(fd, which_operation)
|
||||
int fd;
|
||||
int which_operation;
|
||||
{
|
||||
@@ -230,7 +230,7 @@ int which_operation;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int qp_select(fd, operations)
|
||||
static int qp_select(fd, operations)
|
||||
int fd;
|
||||
unsigned operations;
|
||||
{
|
||||
@@ -244,7 +244,7 @@ unsigned operations;
|
||||
return resops;
|
||||
}
|
||||
|
||||
PRIVATE qp_fd_t *get_qp_fd(fd)
|
||||
static qp_fd_t *get_qp_fd(fd)
|
||||
int fd;
|
||||
{
|
||||
qp_fd_t *qp_fd;
|
||||
@@ -255,7 +255,7 @@ int fd;
|
||||
return qp_fd;
|
||||
}
|
||||
|
||||
PRIVATE int do_query(qp_fd, pkt, count)
|
||||
static int do_query(qp_fd, pkt, count)
|
||||
qp_fd_t *qp_fd;
|
||||
acc_t *pkt;
|
||||
int count;
|
||||
@@ -297,7 +297,7 @@ int count;
|
||||
return qv.fd_offset;
|
||||
}
|
||||
|
||||
PRIVATE int qp_getc()
|
||||
static int qp_getc()
|
||||
{
|
||||
/* Return one character of the names to search for. */
|
||||
acc_t *pkt;
|
||||
@@ -322,7 +322,7 @@ PRIVATE int qp_getc()
|
||||
return c;
|
||||
}
|
||||
|
||||
PRIVATE void qp_putc(qv, c)
|
||||
static void qp_putc(qv, c)
|
||||
struct queryvars *qv;
|
||||
int c;
|
||||
{
|
||||
@@ -358,14 +358,14 @@ int c;
|
||||
qv->outbuf_off= 0;
|
||||
}
|
||||
|
||||
PRIVATE void qp_buffree (priority)
|
||||
static void qp_buffree (priority)
|
||||
int priority;
|
||||
{
|
||||
/* For the moment, we are not going to free anything */
|
||||
}
|
||||
|
||||
#ifdef BUF_CONSISTENCY_CHECK
|
||||
PRIVATE void qp_bufcheck()
|
||||
static void qp_bufcheck()
|
||||
{
|
||||
int i;
|
||||
qp_fd_t *qp_fd;
|
||||
|
||||
@@ -70,37 +70,37 @@
|
||||
|
||||
THIS_FILE
|
||||
|
||||
PUBLIC sr_fd_t sr_fd_table[FD_NR];
|
||||
sr_fd_t sr_fd_table[FD_NR];
|
||||
|
||||
PRIVATE mq_t *repl_queue, *repl_queue_tail;
|
||||
PRIVATE struct vscp_vec s_cp_req[SCPVEC_NR];
|
||||
static mq_t *repl_queue, *repl_queue_tail;
|
||||
static struct vscp_vec s_cp_req[SCPVEC_NR];
|
||||
|
||||
FORWARD int sr_open(message *m);
|
||||
FORWARD void sr_close(message *m);
|
||||
FORWARD int sr_rwio(mq_t *m);
|
||||
FORWARD int sr_restart_read(sr_fd_t *fdp);
|
||||
FORWARD int sr_restart_write(sr_fd_t *fdp);
|
||||
FORWARD int sr_restart_ioctl(sr_fd_t *fdp);
|
||||
FORWARD int sr_cancel(message *m);
|
||||
FORWARD int sr_select(message *m);
|
||||
FORWARD void sr_status(message *m);
|
||||
FORWARD void sr_reply_(mq_t *m, int reply, int is_revive);
|
||||
FORWARD sr_fd_t *sr_getchannel(int minor);
|
||||
FORWARD acc_t *sr_get_userdata(int fd, size_t offset, size_t count, int
|
||||
static int sr_open(message *m);
|
||||
static void sr_close(message *m);
|
||||
static int sr_rwio(mq_t *m);
|
||||
static int sr_restart_read(sr_fd_t *fdp);
|
||||
static int sr_restart_write(sr_fd_t *fdp);
|
||||
static int sr_restart_ioctl(sr_fd_t *fdp);
|
||||
static int sr_cancel(message *m);
|
||||
static int sr_select(message *m);
|
||||
static void sr_status(message *m);
|
||||
static void sr_reply_(mq_t *m, int reply, int is_revive);
|
||||
static sr_fd_t *sr_getchannel(int minor);
|
||||
static acc_t *sr_get_userdata(int fd, size_t offset, size_t count, int
|
||||
for_ioctl);
|
||||
FORWARD int sr_put_userdata(int fd, size_t offset, acc_t *data, int
|
||||
static int sr_put_userdata(int fd, size_t offset, acc_t *data, int
|
||||
for_ioctl);
|
||||
FORWARD void sr_select_res(int fd, unsigned ops);
|
||||
FORWARD int sr_repl_queue(int proc, int ref, int operation);
|
||||
FORWARD int walk_queue(sr_fd_t *sr_fd, mq_t **q_head_ptr, mq_t
|
||||
static void sr_select_res(int fd, unsigned ops);
|
||||
static int sr_repl_queue(int proc, int ref, int operation);
|
||||
static int walk_queue(sr_fd_t *sr_fd, mq_t **q_head_ptr, mq_t
|
||||
**q_tail_ptr, int type, int proc_nr, int ref, int first_flag);
|
||||
FORWARD void sr_event(event_t *evp, ev_arg_t arg);
|
||||
FORWARD int cp_u2b(endpoint_t proc, cp_grant_id_t gid, vir_bytes offset,
|
||||
static void sr_event(event_t *evp, ev_arg_t arg);
|
||||
static int cp_u2b(endpoint_t proc, cp_grant_id_t gid, vir_bytes offset,
|
||||
acc_t **var_acc_ptr, int size);
|
||||
FORWARD int cp_b2u(acc_t *acc_ptr, endpoint_t proc, cp_grant_id_t gid,
|
||||
static int cp_b2u(acc_t *acc_ptr, endpoint_t proc, cp_grant_id_t gid,
|
||||
vir_bytes offset);
|
||||
|
||||
PUBLIC void sr_init()
|
||||
void sr_init()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -114,7 +114,7 @@ PUBLIC void sr_init()
|
||||
repl_queue= NULL;
|
||||
}
|
||||
|
||||
PUBLIC void sr_rec(m)
|
||||
void sr_rec(m)
|
||||
mq_t *m;
|
||||
{
|
||||
int result;
|
||||
@@ -190,7 +190,7 @@ mq_t *m;
|
||||
mq_free(m);
|
||||
}
|
||||
|
||||
PUBLIC void sr_add_minor(minor, port, openf, closef, readf, writef,
|
||||
void sr_add_minor(minor, port, openf, closef, readf, writef,
|
||||
ioctlf, cancelf, selectf)
|
||||
int minor;
|
||||
int port;
|
||||
@@ -221,7 +221,7 @@ sr_select_t selectf;
|
||||
sr_fd->srf_select= selectf;
|
||||
}
|
||||
|
||||
PRIVATE int sr_open(m)
|
||||
static int sr_open(m)
|
||||
message *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -262,7 +262,7 @@ message *m;
|
||||
return i;
|
||||
}
|
||||
|
||||
PRIVATE void sr_close(m)
|
||||
static void sr_close(m)
|
||||
message *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -278,7 +278,7 @@ message *m;
|
||||
sr_fd->srf_flags= SFF_FREE;
|
||||
}
|
||||
|
||||
PRIVATE int sr_rwio(m)
|
||||
static int sr_rwio(m)
|
||||
mq_t *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -375,7 +375,7 @@ mq_t *m;
|
||||
return r;
|
||||
}
|
||||
|
||||
PRIVATE int sr_restart_read(sr_fd)
|
||||
static int sr_restart_read(sr_fd)
|
||||
sr_fd_t *sr_fd;
|
||||
{
|
||||
mq_t *mp;
|
||||
@@ -401,7 +401,7 @@ sr_fd_t *sr_fd;
|
||||
return r;
|
||||
}
|
||||
|
||||
PRIVATE int sr_restart_write(sr_fd)
|
||||
static int sr_restart_write(sr_fd)
|
||||
sr_fd_t *sr_fd;
|
||||
{
|
||||
mq_t *mp;
|
||||
@@ -427,7 +427,7 @@ sr_fd_t *sr_fd;
|
||||
return r;
|
||||
}
|
||||
|
||||
PRIVATE int sr_restart_ioctl(sr_fd)
|
||||
static int sr_restart_ioctl(sr_fd)
|
||||
sr_fd_t *sr_fd;
|
||||
{
|
||||
mq_t *mp;
|
||||
@@ -453,7 +453,7 @@ sr_fd_t *sr_fd;
|
||||
return r;
|
||||
}
|
||||
|
||||
PRIVATE int sr_cancel(m)
|
||||
static int sr_cancel(m)
|
||||
message *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -492,7 +492,7 @@ message *m;
|
||||
return result;
|
||||
}
|
||||
|
||||
PRIVATE int sr_select(m)
|
||||
static int sr_select(m)
|
||||
message *m;
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
@@ -522,7 +522,7 @@ message *m;
|
||||
return m_ops;
|
||||
}
|
||||
|
||||
PRIVATE void sr_status(m)
|
||||
static void sr_status(m)
|
||||
message *m;
|
||||
{
|
||||
int fd, result;
|
||||
@@ -581,7 +581,7 @@ message *m;
|
||||
ip_panic(("unable to send"));
|
||||
}
|
||||
|
||||
PRIVATE int walk_queue(sr_fd, q_head_ptr, q_tail_ptr, type, proc_nr, ref,
|
||||
static int walk_queue(sr_fd, q_head_ptr, q_tail_ptr, type, proc_nr, ref,
|
||||
first_flag)
|
||||
sr_fd_t *sr_fd;
|
||||
mq_t **q_head_ptr;
|
||||
@@ -626,7 +626,7 @@ int first_flag;
|
||||
return EAGAIN;
|
||||
}
|
||||
|
||||
PRIVATE sr_fd_t *sr_getchannel(minor)
|
||||
static sr_fd_t *sr_getchannel(minor)
|
||||
int minor;
|
||||
{
|
||||
sr_fd_t *loc_fd;
|
||||
@@ -642,7 +642,7 @@ int minor;
|
||||
return loc_fd;
|
||||
}
|
||||
|
||||
PRIVATE void sr_reply_(mq, status, is_revive)
|
||||
static void sr_reply_(mq, status, is_revive)
|
||||
mq_t *mq;
|
||||
int status;
|
||||
int is_revive;
|
||||
@@ -688,7 +688,7 @@ int is_revive;
|
||||
mq_free(mq);
|
||||
}
|
||||
|
||||
PRIVATE acc_t *sr_get_userdata (fd, offset, count, for_ioctl)
|
||||
static acc_t *sr_get_userdata (fd, offset, count, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
size_t count;
|
||||
@@ -750,7 +750,7 @@ int for_ioctl;
|
||||
return result<0 ? NULL : acc;
|
||||
}
|
||||
|
||||
PRIVATE int sr_put_userdata (fd, offset, data, for_ioctl)
|
||||
static int sr_put_userdata (fd, offset, data, for_ioctl)
|
||||
int fd;
|
||||
size_t offset;
|
||||
acc_t *data;
|
||||
@@ -809,7 +809,7 @@ int for_ioctl;
|
||||
(int)(*head_ptr)->mq_mess.IO_GRANT, offset);
|
||||
}
|
||||
|
||||
PRIVATE void sr_select_res(int fd, unsigned ops)
|
||||
static void sr_select_res(int fd, unsigned ops)
|
||||
{
|
||||
sr_fd_t *sr_fd;
|
||||
|
||||
@@ -822,7 +822,7 @@ PRIVATE void sr_select_res(int fd, unsigned ops)
|
||||
notify(sr_fd->srf_select_proc);
|
||||
}
|
||||
|
||||
PRIVATE void sr_event(evp, arg)
|
||||
static void sr_event(evp, arg)
|
||||
event_t *evp;
|
||||
ev_arg_t arg;
|
||||
{
|
||||
@@ -863,7 +863,7 @@ ev_arg_t arg;
|
||||
ip_panic(("sr_event: unknown event\n"));
|
||||
}
|
||||
|
||||
PRIVATE int cp_u2b(proc, gid, offset, var_acc_ptr, size)
|
||||
static int cp_u2b(proc, gid, offset, var_acc_ptr, size)
|
||||
endpoint_t proc;
|
||||
cp_grant_id_t gid;
|
||||
vir_bytes offset;
|
||||
@@ -926,7 +926,7 @@ int size;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int cp_b2u(acc_ptr, proc, gid, offset)
|
||||
static int cp_b2u(acc_ptr, proc, gid, offset)
|
||||
acc_t *acc_ptr;
|
||||
endpoint_t proc;
|
||||
cp_grant_id_t gid;
|
||||
@@ -989,7 +989,7 @@ vir_bytes offset;
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE int sr_repl_queue(proc, ref, operation)
|
||||
static int sr_repl_queue(proc, ref, operation)
|
||||
int proc;
|
||||
int ref;
|
||||
int operation;
|
||||
|
||||
Reference in New Issue
Block a user