ntp_debug.h File Reference

Data logging functions for debugging purpose (NTP) More...

#include "core/net.h"
#include "ntp/ntp_common.h"
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  NtpParamName
 Parameter value/name binding. More...
 

Functions

void ntpDumpPacket (const NtpHeader *packet, size_t length)
 Dump NTP packet for debugging purpose. More...
 
void ntpDumpExtensions (const uint8_t *extension, size_t length)
 Dump NTP extension fields. More...
 
void ntpDumpExtension (const NtpExtension *extension, size_t length)
 Dump NTP extension field. More...
 
void ntpDumpNtsAeadExtension (const NtpNtsAeadExtension *extension, size_t length)
 Dump NTS Authenticator and Encrypted Extension Fields extension. More...
 
void ntpDumpTimestamp (const NtpTimestamp *timestamp)
 Dump NTP timestamp. More...
 
const char_tntpGetParamName (uint_t value, const NtpParamName *paramList, size_t paramListLen)
 Convert a parameter to string representation. More...
 

Detailed Description

Data logging functions for debugging purpose (NTP)

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file ntp_debug.h.

Function Documentation

◆ ntpDumpExtension()

void ntpDumpExtension ( const NtpExtension extension,
size_t  length 
)

Dump NTP extension field.

Parameters
[in]extensionPointer to the extension field
[in]lengthLength of the extension field, in bytes

Definition at line 246 of file ntp_debug.c.

◆ ntpDumpExtensions()

void ntpDumpExtensions ( const uint8_t *  extensions,
size_t  length 
)

Dump NTP extension fields.

Parameters
[in]extensionsPointer to the extension fields
[in]lengthTotal length of the extension fields, in bytes

Definition at line 212 of file ntp_debug.c.

◆ ntpDumpNtsAeadExtension()

void ntpDumpNtsAeadExtension ( const NtpNtsAeadExtension extension,
size_t  length 
)

Dump NTS Authenticator and Encrypted Extension Fields extension.

Parameters
[in]extensionPointer to the extension field
[in]lengthLength of the extension field, in bytes

Definition at line 295 of file ntp_debug.c.

◆ ntpDumpPacket()

void ntpDumpPacket ( const NtpHeader packet,
size_t  length 
)

Dump NTP packet for debugging purpose.

Parameters
[in]packetPointer to the NTP packet to dump
[in]lengthLength of the packet, in bytes

Definition at line 108 of file ntp_debug.c.

◆ ntpDumpTimestamp()

void ntpDumpTimestamp ( const NtpTimestamp timestamp)

Dump NTP timestamp.

Parameters
[in]timestampPointer to the NTP timestamp

Definition at line 331 of file ntp_debug.c.

◆ ntpGetParamName()

const char_t* ntpGetParamName ( uint_t  value,
const NtpParamName paramList,
size_t  paramListLen 
)

Convert a parameter to string representation.

Parameters
[in]valueParameter value
[in]paramListList of acceptable parameters
[in]paramListLenNumber of entries in the list
Returns
NULL-terminated string describing the parameter

Definition at line 348 of file ntp_debug.c.