The NTP packet module provides functionality to manipulate the NTP header.  
More...
The NTP packet module provides functionality to manipulate the NTP header. 
- See also
 - An implementation of Simple NTP can be found in Simple Network Time Protocol. 
 
 | 
| 
#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 1900-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 59 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 140 of file ntp_packet.h.
 
 
◆ ntp_packet_get_mode()
Get mode from a NTP packet. 
- Parameters
 - 
  
  
 
- Returns
 - The version of 
packet  
Definition at line 164 of file ntp_packet.h.
 
 
◆ ntp_packet_get_vn()
Get version from a NTP packet. 
- Parameters
 - 
  
  
 
- Returns
 - The version of 
packet  
Definition at line 152 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 104 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 127 of file ntp_packet.h.
 
 
◆ ntp_packet_set_vn()
Set version in a NTP packet. 
- Parameters
 - 
  
  
 
Definition at line 115 of file ntp_packet.h.