mirror of
https://github.com/apache/nuttx.git
synced 2026-03-27 02:29:15 +08:00
udp: add udphdr definition
adapts to third-party code compilation. in the process of porting ConnMan, we encounter some situations where the structure is not defined, or the returned data types do not match the expectations. Refer to the common implementation of other systems and add relevant definitions. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -31,4 +31,27 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* UDP header as specified by RFC 768, August 1980. */
|
||||
|
||||
struct udphdr
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint16_t uh_sport; /* source port */
|
||||
uint16_t uh_dport; /* destination port */
|
||||
uint16_t uh_ulen; /* udp length */
|
||||
uint16_t uh_sum; /* udp checksum */
|
||||
};
|
||||
struct
|
||||
{
|
||||
uint16_t source;
|
||||
uint16_t dest;
|
||||
uint16_t len;
|
||||
uint16_t check;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* __INCLUDE_NETINET_UDP_H */
|
||||
|
||||
Reference in New Issue
Block a user