2011-09-28 16:29:01 +02:00
|
|
|
/*
|
|
|
|
* udp.h
|
|
|
|
*
|
|
|
|
* Created on: 05.09.2011
|
|
|
|
* Author: Oliver
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef UDP_H_
|
|
|
|
#define UDP_H_
|
|
|
|
|
|
|
|
#define UDP_HDR_LEN 8
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Probably stack size too high
|
2011-10-13 04:31:07 +02:00
|
|
|
#define UDP_STACK_SIZE 4096
|
2011-09-28 16:29:01 +02:00
|
|
|
|
|
|
|
#include "sys/net/sixlowpan/sixlowip.h"
|
|
|
|
|
|
|
|
typedef struct __attribute__ ((packed)) udp_hdr_t{
|
|
|
|
uint16_t src_port;
|
|
|
|
uint16_t dst_port;
|
|
|
|
uint16_t length;
|
|
|
|
uint16_t checksum;
|
|
|
|
} udp_hdr_t;
|
|
|
|
|
2011-10-13 04:31:07 +02:00
|
|
|
uint8_t buffer_udp[BUFFER_SIZE];
|
|
|
|
char udp_stack_buffer[UDP_STACK_SIZE];
|
2011-09-28 16:29:01 +02:00
|
|
|
|
|
|
|
uint16_t udp_csum(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header);
|
|
|
|
void udp_packet_handler(void);
|
2011-10-13 04:31:07 +02:00
|
|
|
void printArrayRange_udp(uint8_t *array, uint16_t len);
|
2011-09-28 16:29:01 +02:00
|
|
|
|
|
|
|
#endif /* UDP_H_ */
|