#define ND_PROTO_MAGICS enum ND_ProtocolLayer; void (*ND_ProtoFieldCB) (LND_Packet *packet, guchar *header, guchar *data); enum ND_ProtoFieldType; enum ND_ProtoFieldState; ND_Protocol* nd_proto_new (LND_Protocol *proto); void nd_proto_free (LND_Protocol *proto); ND_Protocol* nd_proto_get (const LND_Protocol *proto); void nd_proto_field_set (const LND_ProtoInfo *pinf, ND_ProtoField *field, void *data); void nd_proto_field_set_for_menu (const LND_ProtoInfo *pinf, ND_ProtoField *field, void *data, ND_MenuData *menu, char *alt_form_str); const char* nd_proto_field_to_string (const ND_ProtoField *field); char* nd_proto_get_opt_key (LND_Protocol *proto); void nd_proto_4bit_hi_cb (LND_Packet *packet, guchar *header, guchar *data); void nd_proto_4bit_lo_cb (LND_Packet *packet, guchar *header, guchar *data); void nd_proto_8bit_cb (LND_Packet *packet, guchar *header, guchar *data); void nd_proto_16bit_cb (LND_Packet *packet, guchar *header, guchar *data); void nd_proto_24bit_cb (LND_Packet *packet, guchar *header, guchar *data); void nd_proto_32bit_cb (LND_Packet *packet, guchar *header, guchar *data); enum ND_ProtoCallbackMode; ND_ProtoCallbackData* nd_proto_cb_data_new (LND_Protocol *proto, guchar *data, guint offset, gboolean update_packet); void nd_proto_cb_data_free (ND_ProtoCallbackData *cb_data); void nd_proto_iterate_4bit_hi_cb (LND_Packet *packet, void *user_data, guint value); void nd_proto_iterate_4bit_lo_cb (LND_Packet *packet, void *user_data, guint value); void nd_proto_iterate_8bit_cb (LND_Packet *packet, void *user_data, guint value); void nd_proto_iterate_16bit_cb (LND_Packet *packet, void *user_data, guint value); void nd_proto_iterate_32bit_cb (LND_Packet *packet, void *user_data, guint value); #define DATA_TO_PTR (data) |
typedef enum { ND_PROTO_LAYER_LINK = (1 << 0), ND_PROTO_LAYER_NET = (1 << 1), ND_PROTO_LAYER_TRANS = (1 << 2), ND_PROTO_LAYER_APP = (1 << 3) } ND_ProtocolLayer; |
void (*ND_ProtoFieldCB) (LND_Packet *packet, guchar *header, guchar *data); |
typedef enum { ND_FIELD_STATE_NORMAL, ND_FIELD_STATE_UNKN, ND_FIELD_STATE_ERROR } ND_ProtoFieldState; |
void nd_proto_field_set (const LND_ProtoInfo *pinf, ND_ProtoField *field, void *data); |
void nd_proto_field_set_for_menu (const LND_ProtoInfo *pinf, ND_ProtoField *field, void *data, ND_MenuData *menu, char *alt_form_str); |
const char* nd_proto_field_to_string (const ND_ProtoField *field); |
void nd_proto_4bit_hi_cb (LND_Packet *packet, guchar *header, guchar *data); |
void nd_proto_4bit_lo_cb (LND_Packet *packet, guchar *header, guchar *data); |
void nd_proto_8bit_cb (LND_Packet *packet, guchar *header, guchar *data); |
void nd_proto_16bit_cb (LND_Packet *packet, guchar *header, guchar *data); |
void nd_proto_24bit_cb (LND_Packet *packet, guchar *header, guchar *data); |
void nd_proto_32bit_cb (LND_Packet *packet, guchar *header, guchar *data); |
typedef enum { ND_PROT_CB_4LO, ND_PROT_CB_4HI, ND_PROT_CB_8, ND_PROT_CB_16, ND_PROT_CB_32 } ND_ProtoCallbackMode; |
ND_ProtoCallbackData* nd_proto_cb_data_new (LND_Protocol *proto, guchar *data, guint offset, gboolean update_packet); |
This function creates a helper data structure that
gets passed to the iterating callbacks
(nd_proto_iterate_8bit_cb()
and friends).
protocol to use in callback
data pointer to protocol header
offset of the affected field in bytes from start of header
whether to call nd_packet_update()
new callback data structure, or NULL if allocation failed.
void nd_proto_iterate_4bit_hi_cb (LND_Packet *packet, void *user_data, guint value); |
void nd_proto_iterate_4bit_lo_cb (LND_Packet *packet, void *user_data, guint value); |
void nd_proto_iterate_8bit_cb (LND_Packet *packet, void *user_data, guint value); |
void nd_proto_iterate_16bit_cb (LND_Packet *packet, void *user_data, guint value); |
void nd_proto_iterate_32bit_cb (LND_Packet *packet, void *user_data, guint value); |