OpenNet
UDP.h
Aller à la documentation de ce fichier.
1 
2 // Product OpenNet
3 
7 
8 // TEST COVERAGE 2019-05-10 KMS - Martin Dubois, ing.
9 
10 #pragma once
11 
12 // Constants
14 
21 #define UDP_HEADER_SIZE_byte (8)
22 
29 #define UDP_IP_PROTOCOL (0x11)
30 
31 #ifndef _OPEN_NET_NO_FUNCTION_
32 
33 // Functions
35 
46 OPEN_NET_GLOBAL unsigned char * UDP_Data(OPEN_NET_GLOBAL unsigned char * aData)
47 {
48  return (aData + UDP_HEADER_SIZE_byte);
49 }
50 
61 unsigned short UDP_DestinationPort(OPEN_NET_GLOBAL const unsigned char * aData)
62 {
63  return (*((OPEN_NET_GLOBAL const unsigned short *)(aData + 2)));
64 }
65 
76 unsigned short UDP_SourcePort(OPEN_NET_GLOBAL const unsigned char * aData)
77 {
78  return (*((OPEN_NET_GLOBAL const unsigned short *)(aData + 0)));
79 }
80 
81 #endif // ! _OPEN_NET_NO_FUNCTION_
#define UDP_HEADER_SIZE_byte
La taille de l'entête UDP.
Definition: UDP.h:21
unsigned short UDP_DestinationPort(OPEN_NET_GLOBAL const unsigned char *aData)
Cette fonction retourne le port de destination.
Definition: UDP.h:61
unsigned short UDP_SourcePort(OPEN_NET_GLOBAL const unsigned char *aData)
Cette fonction retourne le port de source.
Definition: UDP.h:76
OPEN_NET_GLOBAL unsigned char * UDP_Data(OPEN_NET_GLOBAL unsigned char *aData)
Cette fonction retourne l'adresse de la charge utile.
Definition: UDP.h:46