All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sir_udp.h
Go to the documentation of this file.
1 /*
2  * sir_udp.h
3  *
4  * Created on: Apr 7, 2014
5  * Author: root
6  */
7 
8 #ifndef SIR_UDP_H_
9 #define SIR_UDP_H_
10 
12 #include "ip/sir_ip_includes.h"
13 #include "ipv6/sir_ipv6_includes.h"
14 
15 
16 // UDP error codes
17 #define SIR_UDP_OK 0
18 #define SIR_UDP_NOHEADERSPACE 1 // No space for UDP header in buffer
19 #define SIR_UDP_NULLPOINTER 2 // No allocared memory
20 #define SIR_UDP_NOMEMLIST 3 // Invalid memlist as parameter
21 #define SIR_UDP_EMPTYMEMLIST 4 // Empty memlist as parameter
22 
23 
25 {
26 public:
27  static CSiriusUDP *Instance(void);
28  void Init(int iInstance);
29  bool UDP_Timing();
30  uint16_t GetEphemeralPort(void);
31  bool FreeEphemeralPort(uint16_t ui16EphemeralPort);
32  int UDPHeaderSize(void);
33  static int CreateUDPHeader(CSiriusMemList *pBuffer, uint32_t ui32Payloadsize, uint16_t ui16DestPort, uint16_t ui16SrcPort);
34 
35 private:
36  CFreeIndexStorage<uint16_t> m_cEphemeralPort;
37 };
38 #endif /* SIR_UDP_H_ */
static int CreateUDPHeader(CSiriusMemList *pBuffer, uint32_t ui32Payloadsize, uint16_t ui16DestPort, uint16_t ui16SrcPort)
void Init(int iInstance)
bool FreeEphemeralPort(uint16_t ui16EphemeralPort)
static CSiriusUDP * Instance(void)
bool UDP_Timing()
uint16_t GetEphemeralPort(void)
Most important class of Sirius. Used to maintain and process all kinds of queues. ...
Definition: sir_memlist.h:51
int UDPHeaderSize(void)