source: trunk/minix/servers/inet/generic/udp_int.h@ 12

Last change on this file since 12 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.5 KB
Line 
1/*
2generic/udp_int.h
3
4Created: March 2001 by Philip Homburg <philip@f-mnx.phicoh.com>
5
6Some internals of the UDP module
7*/
8
9#define UDP_FD_NR (4*IP_PORT_MAX)
10#define UDP_PORT_HASH_NR 16 /* Must be a power of 2 */
11
12typedef struct udp_port
13{
14 int up_flags;
15 int up_state;
16 int up_ipfd;
17 int up_ipdev;
18 acc_t *up_wr_pack;
19 ipaddr_t up_ipaddr;
20 struct udp_fd *up_next_fd;
21 struct udp_fd *up_write_fd;
22 struct udp_fd *up_port_any;
23 struct udp_fd *up_port_hash[UDP_PORT_HASH_NR];
24} udp_port_t;
25
26#define UPF_EMPTY 0x0
27#define UPF_WRITE_IP 0x1
28#define UPF_WRITE_SP 0x2
29#define UPF_READ_IP 0x4
30#define UPF_READ_SP 0x8
31#define UPF_SUSPEND 0x10
32#define UPF_MORE2WRITE 0x20
33
34#define UPS_EMPTY 0
35#define UPS_SETPROTO 1
36#define UPS_GETCONF 2
37#define UPS_MAIN 3
38#define UPS_ERROR 4
39
40typedef struct udp_fd
41{
42 int uf_flags;
43 udp_port_t *uf_port;
44 ioreq_t uf_ioreq;
45 int uf_srfd;
46 nwio_udpopt_t uf_udpopt;
47 get_userdata_t uf_get_userdata;
48 put_userdata_t uf_put_userdata;
49 select_res_t uf_select_res;
50 acc_t *uf_rdbuf_head;
51 acc_t *uf_rdbuf_tail;
52 size_t uf_rd_count;
53 size_t uf_wr_count;
54 clock_t uf_exp_tim;
55 struct udp_fd *uf_port_next;
56} udp_fd_t;
57
58#define UFF_EMPTY 0x0
59#define UFF_INUSE 0x1
60#define UFF_IOCTL_IP 0x2
61#define UFF_READ_IP 0x4
62#define UFF_WRITE_IP 0x8
63#define UFF_OPTSET 0x10
64#define UFF_PEEK_IP 0x20
65#define UFF_SEL_READ 0x40
66#define UFF_SEL_WRITE 0x80
67
68EXTERN udp_port_t *udp_port_table;
69EXTERN udp_fd_t udp_fd_table[UDP_FD_NR];
70
71/*
72 * $PchId: udp_int.h,v 1.4 2004/08/03 11:12:01 philip Exp $
73 */
Note: See TracBrowser for help on using the repository browser.