lwIP
2.0.2
Lightweight IP stack
|
Functions | |
err_t | raw_bind (struct raw_pcb *pcb, const ip_addr_t *ipaddr) |
err_t | raw_connect (struct raw_pcb *pcb, const ip_addr_t *ipaddr) |
void | raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg) |
err_t | raw_sendto (struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr) |
err_t | raw_send (struct raw_pcb *pcb, struct pbuf *p) |
void | raw_remove (struct raw_pcb *pcb) |
struct raw_pcb * | raw_new (u8_t proto) |
struct raw_pcb * | raw_new_ip_type (u8_t type, u8_t proto) |
Implementation of raw protocol PCBs for low-level handling of different types of protocols besides (or overriding) those already available in lwIP.
Bind a RAW PCB.
pcb | RAW PCB to be bound with a local address ipaddr. |
ipaddr | local IP address to bind with. Use IP4_ADDR_ANY to bind to all local interfaces. |
Connect an RAW PCB. This function is required by upper layers of lwip. Using the raw api you could use raw_sendto() instead
This will associate the RAW PCB with the remote address.
pcb | RAW PCB to be connected with remote address ipaddr and port. |
ipaddr | remote IP address to connect with. |
struct raw_pcb* raw_new | ( | u8_t | proto | ) |
Create a RAW PCB.
proto | the protocol number of the IPs payload (e.g. IP_PROTO_ICMP) |
struct raw_pcb* raw_new_ip_type | ( | u8_t | type, |
u8_t | proto | ||
) |
Create a RAW PCB for specific IP type.
type | IP address type, see lwip_ip_addr_type definitions. If you want to listen to IPv4 and IPv6 (dual-stack) packets, supply IPADDR_TYPE_ANY as argument and bind to IP_ANY_TYPE. |
proto | the protocol number (next header) of the IPv6 packet payload (e.g. IP6_NEXTH_ICMP6) |
void raw_recv | ( | struct raw_pcb * | pcb, |
raw_recv_fn | recv, | ||
void * | recv_arg | ||
) |
Set the callback function for received packets that match the raw PCB's protocol and binding.
The callback function MUST either
void raw_remove | ( | struct raw_pcb * | pcb | ) |
Remove an RAW PCB.
pcb | RAW PCB to be removed. The PCB is removed from the list of RAW PCB's and the data structure is freed from memory. |
Send the raw IP packet to the address given by raw_connect()
pcb | the raw pcb which to send |
p | the IP payload to send |
Send the raw IP packet to the given address. Note that actually you cannot modify the IP headers (this is inconsistent with the receive callback where you actually get the IP headers), you can only specify the IP payload here. It requires some more changes in lwIP. (there will be a raw_send() function then.)
pcb | the raw pcb which to send |
p | the IP payload to send |
ipaddr | the destination address of the IP packet |