122#define NMSG_MSGMOD_FIELD_REPEATED 0x01
123#define NMSG_MSGMOD_FIELD_REQUIRED 0x02
124#define NMSG_MSGMOD_FIELD_HIDDEN 0x04
125#define NMSG_MSGMOD_FIELD_NOPRINT 0x08
126#define NMSG_MSGMOD_FIELD_FORMAT_RAW 0x10
235 uint8_t **pbuf,
size_t *sz);
260 nmsg_pcap_t pcap, nmsg_message_t *m);
nmsg_res nmsg_msgmod_fini(nmsg_msgmod_t mod, void **clos)
Finalize a mesage module.
const char * nmsg_msgmod_msgtype_to_mname(unsigned vid, unsigned msgtype)
Convert a vendor ID / message type ID tuple to the human-readable form of the message type.
nmsg_msgmod_t nmsg_msgmod_lookup_byname(const char *vname, const char *mname)
Determine which nmsg_msgmod is responsible for a given vid/msgtype tuple, if any.
const char * nmsg_msgmod_vid_to_vname(unsigned vid)
Convert a numeric vendor ID to its human-readable name.
nmsg_res nmsg_msgmod_pres_to_payload_finalize(nmsg_msgmod_t mod, void *clos, uint8_t **pbuf, size_t *sz)
After a call to nmsg_msgmod_pres_to_payload() returns nmsg_res_pbuf_ready, this function will return ...
nmsg_res nmsg_msgmod_pkt_to_payload(struct nmsg_msgmod *mod, void *clos, nmsg_pcap_t pcap, nmsg_message_t *m)
Read a raw packet and optionally convert it to an NMSG payload.
nmsg_msgmod_t nmsg_msgmod_lookup(unsigned vid, unsigned msgtype)
Determine which nmsg_msgmod is responsible for a given vid/msgtype tuple, if any.
nmsg_res nmsg_msgmod_init(nmsg_msgmod_t mod, void **clos)
Initialize a message module.
nmsg_res nmsg_msgmod_pres_to_payload(nmsg_msgmod_t mod, void *clos, const char *pres)
Convert a presentation format line to an NMSG payload.
unsigned nmsg_msgmod_get_max_vid(void)
Return the maximum vendor ID.
unsigned nmsg_msgmod_vname_to_vid(const char *vname)
Convert a human-readable vendor name to its numeric ID.
unsigned nmsg_msgmod_get_max_msgtype(unsigned vid)
Return the maximum message type registered to a vendor ID.
nmsg_msgmod_field_type
Enum mapping protocol buffer schema types to nmsg-specific types for "transparent" modules.
@ nmsg_msgmod_ft_ip
Protobuf byte array.
@ nmsg_msgmod_ft_uint16
Protobuf uint32.
@ nmsg_msgmod_ft_mlstring
Protobuf byte array.
@ nmsg_msgmod_ft_uint64
Protobuf uint64.
@ nmsg_msgmod_ft_double
Protobuf double.
@ nmsg_msgmod_ft_string
Protobuf byte array.
@ nmsg_msgmod_ft_bool
Protobuf bool.
@ nmsg_msgmod_ft_int16
Protobuf int32.
@ nmsg_msgmod_ft_int32
Protobuf int32.
@ nmsg_msgmod_ft_int64
Protobuf int64.
@ nmsg_msgmod_ft_bytes
Protobuf byte array.
@ nmsg_msgmod_ft_uint32
Protobuf uint32.
@ nmsg_msgmod_ft_enum
Protobuf enum.
nmsg_res nmsg_msgmod_ipdg_to_payload(nmsg_msgmod_t mod, void *clos, const struct nmsg_ipdg *dg, uint8_t **pbuf, size_t *sz)
Convert an IP datagram to an NMSG payload.
unsigned nmsg_msgmod_mname_to_msgtype(unsigned vid, const char *mname)
Convert the human-readable name of a message type to a message type ID.