Skip to content

File SolidSyslogOriginSd.h

FileList > Core > Interface > SolidSyslogOriginSd.h

Go to the source code of this file

A StructuredData source for the RFC 5424 §7.2 "origin" SD-ELEMENT (IANA SD-ID, so no enterprise-number suffix), emitted on every message the owning logger formats. More...

  • #include "ExternC.h"
  • #include <stddef.h>

Classes

Type Name
struct SolidSyslogOriginSdConfig
Wiring for the "origin" SD-ELEMENT (RFC 5424 §7.2).

Public Types

Type Name
typedef void(* SolidSyslogOriginIpAtFunction
Writes the index-th origin address into thevalue sink.
typedef size_t(* SolidSyslogOriginIpCountFunction
Returns how many origin "ip" PARAMs to emit; GetIpAt is then called for each index in [0, count).

Public Functions

Type Name
struct SolidSyslogStructuredData * SolidSyslogOriginSd_Create (const struct SolidSyslogOriginSdConfig * config)
Create an origin SD source, emitted on every message the owning logger formats.
void SolidSyslogOriginSd_Destroy (struct SolidSyslogStructuredData * base)
Release the SD's pool slot.

Detailed Description

It can carry software, swVersion, enterpriseId, and any number of repeated ip PARAMs. Every field is independently optional: a NULL string omits its PARAM, and the ip PARAMs appear only when both GetIpCount and GetIpAt are supplied (GetIpAt is then called once per index). The config strings are borrowed, not copied, and read at Format time — they must outlive the created SD.

Public Types Documentation

typedef SolidSyslogOriginIpAtFunction

Writes the index-th origin address into thevalue sink.

typedef void(* SolidSyslogOriginIpAtFunction) (struct SolidSyslogSdValue *value, void *context, size_t index);

context is passed through unchanged.


typedef SolidSyslogOriginIpCountFunction

Returns how many origin "ip" PARAMs to emit; GetIpAt is then called for each index in [0, count).

typedef size_t(* SolidSyslogOriginIpCountFunction) (void);


Public Functions Documentation

function SolidSyslogOriginSd_Create

Create an origin SD source, emitted on every message the owning logger formats.

struct SolidSyslogStructuredData * SolidSyslogOriginSd_Create (
    const struct SolidSyslogOriginSdConfig * config
) 

Never returns NULL: an exhausted pool reports via SolidSyslog_Error and returns the shared no-op NullSd, so callers need not null-check the result.


function SolidSyslogOriginSd_Destroy

Release the SD's pool slot.

void SolidSyslogOriginSd_Destroy (
    struct SolidSyslogStructuredData * base
) 

The borrowed config strings are not freed; the caller owns them.



The documentation for this class was generated from the following file Core/Interface/SolidSyslogOriginSd.h