Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
Typedefs | Functions
message.h File Reference

Message is the unit of forwarding, i.e. the packets being switched. More...

#include <hicn/hicn-light/config.h>
#include <hicn/core/logger.h>
#include <hicn/core/messagePacketType.h>
#include <hicn/core/streamBuffer.h>
#include <hicn/core/name.h>
#include <parc/algol/parc_EventBuffer.h>
#include <parc/algol/parc_EventQueue.h>
#include <hicn/utils/address.h>
#include <hicn/core/ticks.h>
Include dependency graph for message.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct message Message
 

Functions

Message * message_CreateFromEventBuffer (PARCEventBuffer *data, size_t dataLength, unsigned ingressConnectionId, Ticks receiveTime, Logger *logger)
 
Message * message_CreateFromByteArray (unsigned connid, uint8_t *pckt, MessagePacketType type, Ticks receiveTime, Logger *logger)
 
Message * message_Acquire (const Message *message)
 
void message_Release (Message **messagePtr)
 
bool message_Write (PARCEventQueue *parcEventQueue, const Message *message)
 
size_t message_Length (const Message *message)
 
bool message_HasWldr (const Message *message)
 
bool message_IsWldrNotification (const Message *message)
 
void message_ResetWldrLabel (Message *message)
 
unsigned message_GetWldrLabel (const Message *message)
 
unsigned message_GetWldrExpectedLabel (const Message *message)
 
unsigned message_GetWldrLastReceived (const Message *message)
 
void message_SetWldrLabel (Message *message, uint16_t label)
 
Message * message_CreateWldrNotification (Message *original, uint16_t expected, uint16_t lastReceived)
 
unsigned message_GetIngressConnectionId (const Message *message)
 
void message_SetIngressConnectionId (Message *message, unsigned conn)
 
Ticks message_GetReceiveTime (const Message *message)
 
MessagePacketType message_GetType (const Message *message)
 
uint32_t message_GetPathLabel (const Message *message)
 
void message_SetPathLabel (Message *message, uint32_t label)
 
void message_UpdatePathLabel (Message *message, uint8_t outFace)
 
void message_ResetPathLabel (Message *message)
 
Name * message_GetName (const Message *message)
 
bool message_HasInterestLifetime (const Message *message)
 
uint64_t message_GetInterestLifetimeTicks (const Message *message)
 
bool message_HasContentExpiryTime (const Message *message)
 
uint64_t message_GetContentExpiryTimeTicks (const Message *message)
 
const uint8_t * message_FixedHeader (const Message *message)
 

Detailed Description

Message is the unit of forwarding, i.e. the packets being switched.

Function Documentation

◆ message_Acquire()

Message* message_Acquire ( const Message *  message)

@function message_Copy @abstract Get a reference counted copy

◆ message_CreateFromByteArray()

Message* message_CreateFromByteArray ( unsigned  connid,
uint8_t *  pckt,
MessagePacketType  type,
Ticks  receiveTime,
Logger *  logger 
)

@function message_CreateFromByteArray @abstract create a message from a byte array

◆ message_CreateFromEventBuffer()

Message* message_CreateFromEventBuffer ( PARCEventBuffer *  data,
size_t  dataLength,
unsigned  ingressConnectionId,
Ticks  receiveTime,
Logger *  logger 
)

@function message_CreateFromBuffer @abstract Takes ownership of the input buffer, which comprises one complete message

◆ message_FixedHeader()

const uint8_t* message_FixedHeader ( const Message *  message)

Returns a pointer to the beginning of the FixedHeader

Parameters
[in]messageAn allocated and parsed Message
Returns
non-null The fixed header memory
null No fixed header or an error

◆ message_GetContentExpiryTimeTicks()

uint64_t message_GetContentExpiryTimeTicks ( const Message *  message)

returns the moment (in hicn-light ticks) when the content object will expire

◆ message_GetIngressConnectionId()

unsigned message_GetIngressConnectionId ( const Message *  message)

Returns the connection id of the packet input

◆ message_GetInterestLifetimeTicks()

uint64_t message_GetInterestLifetimeTicks ( const Message *  message)

Returns the Interest lifetime in hicn-light Ticks

the interest expires after now + returned ticks

Parameters
[in]messageAn allocated and parsed Message
Return values
integerLifetime in forwarder Ticks

◆ message_GetName()

Name* message_GetName ( const Message *  message)

@function message_GetName @abstract The name in the message @discussion The name of the Interest or Content Object. If the caller will store the name, he should make a reference counted copy.

Returns
The name as stored in the message object.

◆ message_GetReceiveTime()

Ticks message_GetReceiveTime ( const Message *  message)

Returns the receive time (in router ticks) of the message

◆ message_GetType()

MessagePacketType message_GetType ( const Message *  message)

Returns the PacketType

◆ message_HasContentExpiryTime()

bool message_HasContentExpiryTime ( const Message *  message)

checks if the expiry time is set inside the content object

◆ message_HasInterestLifetime()

bool message_HasInterestLifetime ( const Message *  message)

Determines if the message has an Interest Lifetime parameter

Parameters
[in]messageAn allocated and parsed Message
Return values
trueIf an Intrerest Lifetime field exists
falseIf no Interest Lifetime exists

◆ message_Length()

size_t message_Length ( const Message *  message)

Returns the total byte length of the message

◆ message_Release()

void message_Release ( Message **  messagePtr)

Releases the message and frees the memory

◆ message_Write()

bool message_Write ( PARCEventQueue *  parcEventQueue,
const Message *  message 
)

Writes the message to the queue