The NTP packet module provides functionality to manipulate the NTP header.
More...
The NTP packet module provides functionality to manipulate the NTP header.
|
#define | NTP_VERSION (4U) |
| NTP version.
|
|
#define | NTP_PORT (123U) |
| NTP port number.
|
|
#define | NTP_UNIX_OFFSET (2208988800) |
| Offset in seconds of NTP timestamp (seconds from 1990-01-01 00:00:00 UTC) to UNIX timestamp (seconds from 1970-01-01 00:00:00 UTC).
|
|
◆ NTP_PACKET_LI_POS
#define NTP_PACKET_LI_POS (6U) |
◆ ntp_mode_t
NTP modes.
Enumerator |
---|
NTP_MODE_RESERVED | reserved
|
NTP_MODE_SYM_ACTIVE | symmetric active
|
NTP_MODE_SYM_PASSIVE | symmetric passive
|
NTP_MODE_CLIENT | client
|
NTP_MODE_SERVER | server
|
NTP_MODE_BROADCAST | broadcast
|
NTP_MODE_PRIV | reserved for private use
|
Definition at line 58 of file ntp_packet.h.
◆ ntp_packet_get_li()
Get leap indicator from a NTP packet.
- Parameters
-
- Returns
- The leap indicator of
packet
Definition at line 139 of file ntp_packet.h.
◆ ntp_packet_get_mode()
Get mode from a NTP packet.
- Parameters
-
- Returns
- The version of
packet
Definition at line 163 of file ntp_packet.h.
◆ ntp_packet_get_vn()
Get version from a NTP packet.
- Parameters
-
- Returns
- The version of
packet
Definition at line 151 of file ntp_packet.h.
◆ ntp_packet_set_li()
static void ntp_packet_set_li |
( |
ntp_packet_t * |
packet, |
|
|
uint8_t |
li |
|
) |
| |
|
inlinestatic |
Set leap indicator in a NTP packet.
- Parameters
-
[in] | packet | The NTP packet |
[in] | li | Leap indicator |
Definition at line 103 of file ntp_packet.h.
◆ ntp_packet_set_mode()
Set mode in a NTP packet.
- Parameters
-
[in] | packet | The NTP packet |
[in] | mode | Mode |
Definition at line 126 of file ntp_packet.h.
◆ ntp_packet_set_vn()
Set version in a NTP packet.
- Parameters
-
Definition at line 114 of file ntp_packet.h.