45 if (total_payload_len <= max_ip_payload) {
55 while (sent < total_payload_len) {
57 (total_payload_len - sent > max_ip_payload)
59 : (total_payload_len - sent);
75 if (sent + chunk_size < total_payload_len) {
76 flags_offset |= 0x2000;
void ethernet_send_frame(netdev_t *dev, struct netbuff *netbuff, uint16_t ethertype, const uint8_t dst_mac[6])
static void fill_ip_header(struct ipv4_header *ip_hdr, uint16_t total_length, uint16_t id, uint16_t flags_fragment, uint8_t protocol, uint32_t src_ip, uint32_t dst_ip)
void ipv4_send(netdev_t *dev, struct netbuff *nb, uint32_t dst_ip, uint8_t protocol, uint8_t mac_dest[6])
void free_netbuff(struct netbuff *netbuff)
void * netbuff_put(struct netbuff *nb, size_t len)
void * netbuff_push(struct netbuff *nb, size_t len)
struct netbuff * create_netbuff()
uint16_t get_next_ip_id(netdev_t *dev)
uint16_t checksum16_adc(const uint16_t *data, size_t length)
uint32_t vxInetAddr(const char *addr)
static uint16_t vxHtons(uint16_t value)
void memcopy(void *dest, void *src, size_t size)