ike_debug.c File Reference

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

#include "ike/ike.h"
#include "ike/ike_debug.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   IKE_TRACE_LEVEL
 

Functions

void ikeDumpMessage (const uint8_t *message, size_t length)
 Dump IKE message. More...
 
void ikeDumpHeader (const IkeHeader *header)
 Dump IKE header. More...
 
void ikeDumpFlags (uint8_t flags)
 Dump flags. More...
 
void ikeDumpPayloads (const uint8_t *payloads, size_t length, uint8_t nextPayload)
 Dump IKE payloads. More...
 
void ikeDumpPayloadHeader (const IkePayloadHeader *header)
 Dump generic payload header. More...
 
void ikeDumpSaPayload (const IkeSaPayload *payload, size_t length)
 Dump Security Association payload. More...
 
void ikeDumpProposal (const IkeProposal *proposal, size_t length)
 Dump Proposal substructure. More...
 
void ikeDumpTransform (const IkeTransform *transform, size_t length)
 Dump Transform substructure. More...
 
error_t ikeDumpTransformAttr (const IkeTransformAttr *attr, size_t length, size_t *consumed)
 Dump transform attribute. More...
 
void ikeDumpKePayload (const IkeKePayload *payload, size_t length)
 Dump Key Exchange payload. More...
 
void ikeDumpIdPayload (const IkeIdPayload *payload, size_t length)
 Dump Identification payload. More...
 
void ikeDumpCertPayload (const IkeCertPayload *payload, size_t length)
 Dump Certificate payload. More...
 
void ikeDumpCertReqPayload (const IkeCertReqPayload *payload, size_t length)
 Dump Certificate Request payload. More...
 
void ikeDumpAuthPayload (const IkeAuthPayload *payload, size_t length)
 Dump Authentication payload. More...
 
void ikeDumpNoncePayload (const IkeNoncePayload *payload, size_t length)
 Dump Nonce payload. More...
 
void ikeDumpNotifyPayload (const IkeNotifyPayload *payload, size_t length)
 Dump Notify payload. More...
 
void ikeDumpDeletePayload (const IkeDeletePayload *payload, size_t length)
 Dump Delete payload. More...
 
void ikeDumpTsPayload (const IkeTsPayload *payload, size_t length)
 Dump Traffic Selector payload. More...
 
void ikeDumpTs (const IkeTs *ts, size_t length)
 Dump Traffic Selector substructure. More...
 
void ikeDumpEncryptedPayload (const IkeEncryptedPayload *payload, size_t length)
 Dump Encrypted payload. More...
 
void ikeDumpEncryptedFragPayload (const IkeEncryptedFragPayload *payload, size_t length)
 Dump Encrypted Fragment payload. More...
 
const char_tikeGetParamName (uint_t value, const IkeParamName *paramList, size_t paramListLen)
 Convert a parameter to string representation. More...
 

Detailed Description

Data logging functions for debugging purpose (IKEv2)

License

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

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

This file is part of CycloneIPSEC 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.0

Definition in file ike_debug.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   IKE_TRACE_LEVEL

Definition at line 32 of file ike_debug.c.

Function Documentation

◆ ikeDumpAuthPayload()

void ikeDumpAuthPayload ( const IkeAuthPayload payload,
size_t  length 
)

Dump Authentication payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1152 of file ike_debug.c.

◆ ikeDumpCertPayload()

void ikeDumpCertPayload ( const IkeCertPayload payload,
size_t  length 
)

Dump Certificate payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1088 of file ike_debug.c.

◆ ikeDumpCertReqPayload()

void ikeDumpCertReqPayload ( const IkeCertReqPayload payload,
size_t  length 
)

Dump Certificate Request payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1120 of file ike_debug.c.

◆ ikeDumpDeletePayload()

void ikeDumpDeletePayload ( const IkeDeletePayload payload,
size_t  length 
)

Dump Delete payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1267 of file ike_debug.c.

◆ ikeDumpEncryptedFragPayload()

void ikeDumpEncryptedFragPayload ( const IkeEncryptedFragPayload payload,
size_t  length 
)

Dump Encrypted Fragment payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1479 of file ike_debug.c.

◆ ikeDumpEncryptedPayload()

void ikeDumpEncryptedPayload ( const IkeEncryptedPayload payload,
size_t  length 
)

Dump Encrypted payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1455 of file ike_debug.c.

◆ ikeDumpFlags()

void ikeDumpFlags ( uint8_t  flags)

Dump flags.

Parameters
[in]flagsspecific options that are set for the IKE message

Definition at line 438 of file ike_debug.c.

◆ ikeDumpHeader()

void ikeDumpHeader ( const IkeHeader header)

Dump IKE header.

Parameters
[in]headerPointer to the IKE header to dump

Definition at line 407 of file ike_debug.c.

◆ ikeDumpIdPayload()

void ikeDumpIdPayload ( const IkeIdPayload payload,
size_t  length 
)

Dump Identification payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1027 of file ike_debug.c.

◆ ikeDumpKePayload()

void ikeDumpKePayload ( const IkeKePayload payload,
size_t  length 
)

Dump Key Exchange payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 990 of file ike_debug.c.

◆ ikeDumpMessage()

void ikeDumpMessage ( const uint8_t *  message,
size_t  length 
)

Dump IKE message.

Parameters
[in]messagePointer to the IKE message to dump
[in]lengthLength of the IKE message, in bytes

Definition at line 379 of file ike_debug.c.

◆ ikeDumpNoncePayload()

void ikeDumpNoncePayload ( const IkeNoncePayload payload,
size_t  length 
)

Dump Nonce payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1184 of file ike_debug.c.

◆ ikeDumpNotifyPayload()

void ikeDumpNotifyPayload ( const IkeNotifyPayload payload,
size_t  length 
)

Dump Notify payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1207 of file ike_debug.c.

◆ ikeDumpPayloadHeader()

void ikeDumpPayloadHeader ( const IkePayloadHeader header)

Dump generic payload header.

Parameters
[in]headerPointer to the generic payload header to dump

Definition at line 637 of file ike_debug.c.

◆ ikeDumpPayloads()

void ikeDumpPayloads ( const uint8_t *  payloads,
size_t  length,
uint8_t  nextPayload 
)

Dump IKE payloads.

Parameters
[in]payloadsPointer to the IKE payloads to dump
[in]lengthLength of the IKE payloads, in bytes
[in]nextPayloadNext payload type

Definition at line 511 of file ike_debug.c.

◆ ikeDumpProposal()

void ikeDumpProposal ( const IkeProposal proposal,
size_t  length 
)

Dump Proposal substructure.

Parameters
[in]proposalPointer to the Proposal substructure to dump
[in]lengthLength of the proposal, in bytes

Definition at line 707 of file ike_debug.c.

◆ ikeDumpSaPayload()

void ikeDumpSaPayload ( const IkeSaPayload payload,
size_t  length 
)

Dump Security Association payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 658 of file ike_debug.c.

◆ ikeDumpTransform()

void ikeDumpTransform ( const IkeTransform transform,
size_t  length 
)

Dump Transform substructure.

Parameters
[in]transformPointer to the Transform substructure to dump
[in]lengthLength of the transform, in bytes

Definition at line 795 of file ike_debug.c.

◆ ikeDumpTransformAttr()

error_t ikeDumpTransformAttr ( const IkeTransformAttr attr,
size_t  length,
size_t *  consumed 
)

Dump transform attribute.

Parameters
[in]attrPointer to the transform attribute to dump
[in]lengthNumber of bytes available in the input stream
[out]consumedTotal number of characters that have been consumed
Returns
Error code

Definition at line 913 of file ike_debug.c.

◆ ikeDumpTs()

void ikeDumpTs ( const IkeTs ts,
size_t  length 
)

Dump Traffic Selector substructure.

Parameters
[in]tsPointer to the Traffic Selector substructure to dump
[in]lengthLength of the selector, in bytes

Definition at line 1366 of file ike_debug.c.

◆ ikeDumpTsPayload()

void ikeDumpTsPayload ( const IkeTsPayload payload,
size_t  length 
)

Dump Traffic Selector payload.

Parameters
[in]payloadPointer to the payload to dump
[in]lengthLength of the payload, in bytes

Definition at line 1309 of file ike_debug.c.

◆ ikeGetParamName()

const char_t* ikeGetParamName ( uint_t  value,
const IkeParamName 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 1514 of file ike_debug.c.