37 lines
1015 B
C
37 lines
1015 B
C
// -------------------------------------------------------------------------
|
|
// udp.h
|
|
//
|
|
// 29.12.2003, J. Ahrensfeld
|
|
//
|
|
// -------------------------------------------------------------------------
|
|
#ifndef UDP_H
|
|
#define UDP_H
|
|
|
|
#include "libsys.h"
|
|
#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, uint8_t *pUDP_payload, uint16_t len);
|
|
|
|
// -------------------------------------------------------------------------
|
|
#endif // UDP_H
|