-added UdpAppend() git-svn-id: http://moon:8086/svn/mips@219 a8ebac50-d88d-4704-bea3-6648445a41b3
38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
// -------------------------------------------------------------------------
|
|
// udp.h
|
|
//
|
|
// 29.12.2003, J. Ahrensfeld
|
|
//
|
|
// -------------------------------------------------------------------------
|
|
#ifndef UDP_H
|
|
#define UDP_H
|
|
|
|
#include <libsys/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, void const *pUDP_payload, uint16_t len);
|
|
void UDP_append(packet_t *pPacket, void const *pData, uint16_t len);
|
|
|
|
// -------------------------------------------------------------------------
|
|
#endif // UDP_H
|