|
ginnOS
The reference: libc, the libraries and the kernel
|
#include "ipv4.h"#include "arp.h"#include "byteorder.h"#include "checksum.h"#include "common/memory.h"#include "ethernet.h"#include "icmp.h"#include "tcp.h"#include "udp.h"#include "kernel/memory/heap.h"Macros | |
| #define | VERSION_IHL 0x45 |
| #define | DEFAULT_TTL 64 |
| #define | FLAG_DF 0x4000 |
| #define | FLAG_MF 0x2000 |
| #define | OFFSET_MASK 0x1FFF |
| #define | LOOPBACK_NET 0x7F |
Functions | |
| void | ipv4_receive (netif_t *netif, const uint8_t *packet, uint32_t length) |
| a packet from an interface (net_lock held). | |
| netif_t * | ipv4_route (uint32_t dst, uint32_t *next_hop) |
| the interface a packet to dst goes out on, and the host it goes to first (dst, or a gateway). | |
| uint32_t | ipv4_pseudo_sum (uint32_t source, uint32_t dst, uint8_t protocol, uint32_t length) |
| the sum of the pseudo-header of UDP and TCP (the addresses, the protocol, the length), to start their checksum with. | |
| uint32_t | ipv4_source_for (uint32_t dst) |
| the source address a packet to dst gets (net_lock held), 0 if there is no route. | |
| bool | ipv4_init (void) |
| get the send buffer (from net_init). | |
| bool | ipv4_send (uint32_t source, uint32_t dst, uint8_t protocol, const void *payload, uint32_t length) |
| send a payload to dst (net_lock held). | |
Variables | |
| ipv4_stats_t | ipv4_stats |
IPv4 (see ipv4.h).
| #define VERSION_IHL 0x45 |
| #define DEFAULT_TTL 64 |
| #define FLAG_DF 0x4000 |
| #define FLAG_MF 0x2000 |
| #define OFFSET_MASK 0x1FFF |
| #define LOOPBACK_NET 0x7F |
a packet from an interface (net_lock held).
the interface a packet to dst goes out on, and the host it goes to first (dst, or a gateway).
net_lock held.
the sum of the pseudo-header of UDP and TCP (the addresses, the protocol, the length), to start their checksum with.
the source address a packet to dst gets (net_lock held), 0 if there is no route.
| bool ipv4_init | ( | void | ) |
get the send buffer (from net_init).
| bool ipv4_send | ( | uint32_t | source, |
| uint32_t | dst, | ||
| uint8_t | protocol, | ||
| const void * | payload, | ||
| uint32_t | length ) |
send a payload to dst (net_lock held).
| source | the source address, or 0 for the address of the interface the packet goes out on. |
| ipv4_stats_t ipv4_stats |