Revision ae80a2de lib/socket.h
lib/socket.h | ||
---|---|---|
20 | 20 |
int type; /* Socket type */ |
21 | 21 |
void *data; /* User data */ |
22 | 22 |
ip_addr saddr, daddr; /* IPA_NONE = unspecified */ |
23 |
unsigned sport, dport; /* 0 = unspecified (for IP: protocol type) */
|
|
23 |
uint sport, dport; /* 0 = unspecified (for IP: protocol type) */
|
|
24 | 24 |
int tos; /* TOS / traffic class, -1 = default */ |
25 | 25 |
int priority; /* Local socket priority, -1 = default */ |
26 | 26 |
int ttl; /* Time To Live, -1 = default */ |
... | ... | |
28 | 28 |
struct iface *iface; /* Interface; specify this for broad/multicast sockets */ |
29 | 29 |
|
30 | 30 |
byte *rbuf, *rpos; /* NULL=allocate automatically */ |
31 |
unsigned rbsize;
|
|
31 |
uint rbsize;
|
|
32 | 32 |
int (*rx_hook)(struct birdsock *, int size); /* NULL=receiving turned off, returns 1 to clear rx buffer */ |
33 | 33 |
|
34 | 34 |
byte *tbuf, *tpos; /* NULL=allocate automatically */ |
35 | 35 |
byte *ttx; /* Internal */ |
36 |
unsigned tbsize;
|
|
36 |
uint tbsize;
|
|
37 | 37 |
void (*tx_hook)(struct birdsock *); |
38 | 38 |
|
39 | 39 |
void (*err_hook)(struct birdsock *, int); /* errno or zero if EOF */ |
40 | 40 |
|
41 | 41 |
/* Information about received datagrams (UDP, RAW), valid in rx_hook */ |
42 | 42 |
ip_addr faddr, laddr; /* src (From) and dst (Local) address of the datagram */ |
43 |
unsigned fport; /* src port of the datagram */
|
|
44 |
unsigned lifindex; /* local interface that received the datagram */
|
|
43 |
uint fport; /* src port of the datagram */
|
|
44 |
uint lifindex; /* local interface that received the datagram */
|
|
45 | 45 |
/* laddr and lifindex are valid only if SKF_LADDR_RX flag is set to request it */ |
46 | 46 |
|
47 | 47 |
int af; /* Address family (AF_INET, AF_INET6 or 0 for non-IP) of fd */ |
... | ... | |
59 | 59 |
|
60 | 60 |
int sk_open(sock *); /* Open socket */ |
61 | 61 |
int sk_rx_ready(sock *s); |
62 |
int sk_send(sock *, unsigned len); /* Send data, <0=err, >0=ok, 0=sleep */
|
|
63 |
int sk_send_to(sock *, unsigned len, ip_addr to, unsigned port); /* sk_send to given destination */
|
|
62 |
int sk_send(sock *, uint len); /* Send data, <0=err, >0=ok, 0=sleep */
|
|
63 |
int sk_send_to(sock *, uint len, ip_addr to, uint port); /* sk_send to given destination */
|
|
64 | 64 |
void sk_reallocate(sock *); /* Free and allocate tbuf & rbuf */ |
65 | 65 |
void sk_set_rbsize(sock *s, uint val); /* Resize RX buffer */ |
66 | 66 |
void sk_set_tbsize(sock *s, uint val); /* Resize TX buffer, keeping content */ |
Also available in: Unified diff