Files | |
file | uip-fw.h |
uIP packet forwarding header file. | |
file | uip-fw.c |
uIP packet forwarding. | |
Data Structures | |
struct | uip_fw_netif |
Representation of a uIP network interface. More... | |
Defines | |
#define | UIP_FW_NETIF(ip1, ip2, ip3, ip4, nm1, nm2, nm3, nm4, outputfunc) |
Intantiating macro for a uIP network interface. | |
#define | uip_fw_setipaddr(netif, addr) |
Set the IP address of a network interface. | |
#define | uip_fw_setnetmask(netif, addr) |
Set the netmask of a network interface. | |
#define | UIP_FW_LOCAL |
A non-error message that indicates that a packet should be processed locally. | |
#define | UIP_FW_OK |
A non-error message that indicates that something went OK. | |
#define | UIP_FW_FORWARDED |
A non-error message that indicates that a packet was forwarded. | |
#define | UIP_FW_ZEROLEN |
A non-error message that indicates that a zero-length packet transmission was attempted, and that no packet was sent. | |
#define | UIP_FW_TOOLARGE |
An error message that indicates that a packet that was too large for the outbound network interface was detected. | |
#define | UIP_FW_NOROUTE |
An error message that indicates that no suitable interface could be found for an outbound packet. | |
#define | UIP_FW_DROPPED |
An error message that indicates that a packet that should be forwarded or output was dropped. | |
#define | ICMP_ECHO 8 |
#define | ICMP_TE 11 |
#define | BUF ((struct tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) |
#define | ICMPBUF ((struct icmpip_hdr *)&uip_buf[UIP_LLH_LEN]) |
#define | FWCACHE_SIZE 2 |
#define | FW_TIME 20 |
Functions | |
void | uip_fw_init (void) |
Initialize the uIP packet forwarding module. | |
u8_t | uip_fw_forward (void) |
Forward an IP packet in the uip_buf buffer. | |
u8_t | uip_fw_output (void) |
Output an IP packet on the correct network interface. | |
void | uip_fw_register (struct uip_fw_netif *netif) |
Register a network interface with the forwarding module. | |
void | uip_fw_default (struct uip_fw_netif *netif) |
Register a default network interface. | |
void | uip_fw_periodic (void) |
Perform periodic processing. |
|
Intantiating macro for a uIP network interface. Example: struct uip_fw_netif slipnetif = {UIP_FW_NETIF(192,168,76,1, 255,255,255,0, slip_output)};
|
|
Set the IP address of a network interface.
|
|
Set the netmask of a network interface.
|
|
Register a default network interface. All packets that don't go out on any of the other interfaces will be routed to the default interface.
|
|
Forward an IP packet in the uip_buf buffer.
Definition at line 407 of file uip-fw.c. References BUF, HTONS, ICMP_ECHO, ICMPBUF, uip_appdata, uip_buf, UIP_FW_FORWARDED, UIP_FW_LOCAL, uip_fw_output(), uip_hostaddr, uip_len, UIP_LLH_LEN, UIP_PROTO_ICMP, and UIP_TCPIP_HLEN. |
|
Output an IP packet on the correct network interface. The IP packet should be present in the uip_buf buffer and its length in the global uip_len variable.
Definition at line 359 of file uip-fw.c. References BUF, uip_fw_netif::next, NULL, uip_fw_netif::output, UIP_FW_NOROUTE, UIP_FW_OK, UIP_FW_ZEROLEN, and uip_len. Referenced by uip_fw_forward(). |
|
Register a network interface with the forwarding module.
Definition at line 497 of file uip-fw.c. References uip_fw_netif::next. |