24 lines
484 B
C
24 lines
484 B
C
#ifndef __UDP_H__
|
|
#define __UDP_H__
|
|
|
|
#include "ether.h"
|
|
#include "ip.h"
|
|
|
|
struct udp_header_t {
|
|
unsigned short source_port;
|
|
unsigned short destination_port;
|
|
unsigned short length;
|
|
unsigned short checksum;
|
|
char payload[];
|
|
}__attribute__((packed));
|
|
|
|
struct udp_data_t {
|
|
unsigned char *data;
|
|
unsigned int from;
|
|
unsigned short len;
|
|
};
|
|
|
|
void udp_process_packet(struct ether_t *ether, unsigned int dest, unsigned int src, struct udp_header_t *packet, unsigned int len);
|
|
|
|
#endif
|