![]() |
Rawsock library
v0.3.4
Library to make the use of raw sockets easier, under Linux. Currently supporting IPv4, UDP and a custom latency measurement protocol (LaMP - supported both in raw and non-raw sockets).
|
#include <inttypes.h>#include <stdlib.h>#include <netinet/in.h>Go to the source code of this file.
Functions | |
| uint16_t | minirighi_udp_checksum (const void *buff, size_t len, in_addr_t src_addr, in_addr_t dest_addr) |
| Calculate the UDP checksum (calculated with the whole packet) More... | |
UDP checksum calculation utility - from the Minirighi IA-32 Operating System
This header file gives access to a function (minirighi_udp_checksum()) that can be used to compute the UDP checksum to be put inside the corresponding field of the UDP header.
This is not an original work: this function comes from the Minirighi IA-32 Operating System, released under GNU GPL. Except for the name, there is no modification to its code.
Moreover, the original definition can be found at line 29 of file udp.c of the Minirighi system.
The function, even though it is used internally in the main Rawsock module, is available through a separate header in order to enable any application to use it separately, when needed.
Definition in file minirighi_udp_checksum.h.
| uint16_t minirighi_udp_checksum | ( | const void * | buff, |
| size_t | len, | ||
| in_addr_t | src_addr, | ||
| in_addr_t | dest_addr | ||
| ) |
Calculate the UDP checksum (calculated with the whole packet)
| [in] | buff | The UDP packet. |
| [in] | len | The UDP packet length. |
| [in] | src_addr | The IP source address (in network format). |
| [in] | dest_addr | The IP destination address (in network format). |
Definition at line 18 of file minirighi_udp_checksum.c.