Watt-32 tcp/ip  2.2 dev-rel.10
Functions | Variables
ip4_out.c File Reference

Go to the source code of this file.


WORD _get_ip4_id (void)
 Increment IPv4-identifier before returning it. More...
WORD _get_this_ip4_id (void)
 Return IPv4-identifier but don't increment it.
int _ip4_output (in_Header *ip, DWORD src_ip, DWORD dst_ip, BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id, int data_len, const void *sock, const char *file, unsigned line)
 The IP4 packet transmitter. More...
static __inline in_Headermake_ip_pkt (DWORD host, BOOL first, char **data)
static in_Headermake_tcp_pkt (const _tcp_Socket *s, BOOL first, char **data)
static __inline in_Headermake_udp_pkt (const _udp_Socket *s, BOOL first, unsigned len, char **data)
int _ip4_send_fragments (sock_type *s, BYTE proto, DWORD dest, const void *buf, unsigned len, const char *file, unsigned line)


BYTE _default_tos = 0
int _default_ttl = 254
int _ip4_id_increment = 1
BOOL _ip4_dont_frag = FALSE
static WORD ip4_id = 0

Detailed Description

IPv4 output routines.

Definition in file ip4_out.c.

Function Documentation

WORD _get_ip4_id ( void  )

Increment IPv4-identifier before returning it.

Note: Use _get_this_ip4_id() for sending IP fragments.

Definition at line 65 of file ip4_out.c.

References _ip4_id_increment.

int _ip4_output ( in_Header ip,
DWORD  src_ip,
DWORD  dst_ip,
BYTE  protocol,
BYTE  ttl,
BYTE  tos,
WORD  ip_id,
int  data_len,
const void sock,
const char *  file,
unsigned  line 

The IP4 packet transmitter.

Return values
'data_len+ sizeof(*ip)' on success.
0on fail.
Handle IP-fragments here (call ip4_send_fragments() when needed)

Definition at line 86 of file ip4_out.c.

References _default_ttl, _eth_send(), _get_ip4_id(), _ip4_dont_frag, and my_ip_addr.

int _ip4_send_fragments ( sock_type s,
BYTE  proto,
DWORD  dest,
const void buf,
unsigned  len,
const char *  file,
unsigned  line 
Maybe send highest offset fragment first?

Definition at line 235 of file ip4_out.c.

References _get_ip4_id(), _ip4_output(), tcp_Socket::state, and tcp_tick().

Variable Documentation

BYTE _default_tos = 0

The default type-of-service for IP

Definition at line 53 of file ip4_out.c.

int _default_ttl = 254

The default time-to-live for IP

Definition at line 54 of file ip4_out.c.

BOOL _ip4_dont_frag = FALSE

Enable the IP_DF bit on output

Definition at line 56 of file ip4_out.c.

int _ip4_id_increment = 1

The IP identifier increment

Definition at line 55 of file ip4_out.c.