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

Go to the source code of this file.

Functions

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...
 
int _ip4_send_fragments (sock_type *sk, BYTE proto, DWORD dest, const void *buf, unsigned len, const char *file, unsigned line)
 

Variables

BOOL _ip4_dont_frag
 
int _ip4_id_increment
 
int _default_ttl
 
BYTE _default_tos
 

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.
Todo:
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 sk,
BYTE  proto,
DWORD  dest,
const void buf,
unsigned  len,
const char *  file,
unsigned  line 
)
Todo:
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

The default type-of-service for IP

Definition at line 53 of file ip4_out.c.

int _default_ttl

The default time-to-live for IP

Definition at line 54 of file ip4_out.c.

BOOL _ip4_dont_frag

Enable the IP_DF bit on output

Definition at line 56 of file ip4_out.c.

int _ip4_id_increment

The IP identifier increment

Definition at line 55 of file ip4_out.c.