// ------------------------------------------------------------------------- // udp.h // // 29.12.2003, J. Ahrensfeld // // ------------------------------------------------------------------------- #ifndef UDP_H #define UDP_H #include #include "ethernet.h" // ------------------------------------------------------------------------- typedef struct _sUDP { uint16_t src_port; uint16_t dst_port; uint16_t len; uint16_t chksum; } __attribute__ ((__packed__)) UDP; typedef struct _sUDPPP { uint8_t inet_addr_src[4]; uint8_t inet_addr_dst[4]; uint8_t zero; uint8_t proto; uint16_t len; } __attribute__ ((__packed__)) UDPPP; // ------------------------------------------------------------------------- uint8_t *UDP_create(packet_t *pPacket, uint8_t *inet_addr_src, uint16_t port_src, uint8_t *inet_addr_dst, uint16_t port_dst, void const *pUDP_payload, uint16_t len); void UDP_append(packet_t *pPacket, void const *pData, uint16_t len); // ------------------------------------------------------------------------- #endif // UDP_H