Revision 48e5f32d lib/socket.h

View differences:

lib/socket.h
57 57
int sk_send(sock *, unsigned len);	/* Send data, <0=err, >0=ok, 0=sleep */
58 58
int sk_send_to(sock *, unsigned len, ip_addr to, unsigned port); /* sk_send to given destination */
59 59
void sk_reallocate(sock *);		/* Free and allocate tbuf & rbuf */
60
void sk_set_rbsize(sock *s, uint val);	/* Resize RX buffer */
61
void sk_set_tbsize(sock *s, uint val);	/* Resize TX buffer, keeping content */
62
void sk_set_tbuf(sock *s, void *tbuf);	/* Switch TX buffer, NULL-> return to internal */
60 63
void sk_dump_all(void);
61 64
int sk_set_ttl(sock *s, int ttl);	/* Set transmit TTL for given socket */
62 65
int sk_set_min_ttl(sock *s, int ttl);	/* Set minimal accepted TTL for given socket */
......
89 92

  
90 93
#define SKF_V6ONLY	1	/* Use IPV6_V6ONLY socket option */
91 94
#define SKF_LADDR_RX	2	/* Report local address for RX packets */
92
#define SKF_LADDR_TX	4	/* Allow to specify local address for TX packets */
93
#define SKF_TTL_RX	8	/* Report TTL / Hop Limit for RX packets */
95
#define SKF_TTL_RX	4	/* Report TTL / Hop Limit for RX packets */
96
#define SKF_BIND	8	/* Bind datagram socket to given source address */
94 97

  
95 98
#define SKF_THREAD	0x100	/* Socked used in thread, Do not add to main loop */
99
#define SKF_TRUNCATED	0x200	/* Received packet was truncated, set by IO layer */
100
#define SKF_HDRINCL	0x400	/* Used internally */
101
#define SKF_PKTINFO	0x800	/* Used internally */
96 102

  
97 103
/*
98 104
 *	Socket types		     SA SP DA DP IF  TTL SendTo	(?=may, -=must not, *=must)
......
118 124
 *  call sk_setup_multicast() to enable multicast on that socket,
119 125
 *  and then use sk_join_group() and sk_leave_group() to manage
120 126
 *  a set of received multicast groups.
127
 *
128
 *  For datagram (SK_UDP, SK_IP) sockets, there are two ways to handle
129
 *  source address. The socket could be bound to it using bind()
130
 *  syscall, but that also forbids the reception of multicast packets,
131
 *  or the address could be set on per-packet basis using platform
132
 *  dependent options (but these are not available in some corner
133
 *  cases). The first way is used when SKF_BIND is specified, the
134
 *  second way is used otherwise.
121 135
 */
122 136

  
123 137
#endif

Also available in: Unified diff