summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-llc.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-llc.c')
-rw-r--r--epan/dissectors/packet-llc.c140
1 files changed, 70 insertions, 70 deletions
diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c
index df0ce1be..0c43aef3 100644
--- a/epan/dissectors/packet-llc.c
+++ b/epan/dissectors/packet-llc.c
@@ -37,40 +37,40 @@ void proto_reg_handoff_llc(void);
#define UDP_PORT_LLC_RANGE "12000-12004"
-static int proto_llc = -1;
-static int hf_llc_dsap = -1;
-static int hf_llc_ssap = -1;
-static int hf_llc_dsap_sap = -1;
-static int hf_llc_dsap_ig = -1;
-static int hf_llc_ssap_sap = -1;
-static int hf_llc_ssap_cr = -1;
-static int hf_llc_ctrl = -1;
-static int hf_llc_n_r = -1;
-static int hf_llc_n_s = -1;
-static int hf_llc_p = -1;
-static int hf_llc_p_ext = -1;
-static int hf_llc_f = -1;
-static int hf_llc_f_ext = -1;
-static int hf_llc_s_ftype = -1;
-static int hf_llc_u_modifier_cmd = -1;
-static int hf_llc_u_modifier_resp = -1;
-static int hf_llc_ftype_i = -1;
-static int hf_llc_ftype_s_u = -1;
-static int hf_llc_ftype_s_u_ext = -1;
-static int hf_llc_type = -1;
-static int hf_llc_oui = -1;
-static int hf_llc_pid = -1;
-
-static int proto_basicxid = -1;
-static int hf_llc_xid_format = -1;
-static int hf_llc_xid_types = -1;
-static int hf_llc_xid_wsize = -1;
-
-static gint ett_llc = -1;
-static gint ett_llc_dsap = -1;
-static gint ett_llc_ssap = -1;
-static gint ett_llc_ctrl = -1;
-static gint ett_llc_basicxid = -1;
+static int proto_llc;
+static int hf_llc_dsap;
+static int hf_llc_ssap;
+static int hf_llc_dsap_sap;
+static int hf_llc_dsap_ig;
+static int hf_llc_ssap_sap;
+static int hf_llc_ssap_cr;
+static int hf_llc_ctrl;
+static int hf_llc_n_r;
+static int hf_llc_n_s;
+static int hf_llc_p;
+static int hf_llc_p_ext;
+static int hf_llc_f;
+static int hf_llc_f_ext;
+static int hf_llc_s_ftype;
+static int hf_llc_u_modifier_cmd;
+static int hf_llc_u_modifier_resp;
+static int hf_llc_ftype_i;
+static int hf_llc_ftype_s_u;
+static int hf_llc_ftype_s_u_ext;
+static int hf_llc_type;
+static int hf_llc_oui;
+static int hf_llc_pid;
+
+static int proto_basicxid;
+static int hf_llc_xid_format;
+static int hf_llc_xid_types;
+static int hf_llc_xid_wsize;
+
+static int ett_llc;
+static int ett_llc_dsap;
+static int ett_llc_ssap;
+static int ett_llc_ctrl;
+static int ett_llc_basicxid;
static dissector_table_t dsap_subdissector_table;
static dissector_table_t xid_subdissector_table;
@@ -188,7 +188,7 @@ static const value_string type_vals[] = {
/*
* Hash table for translating OUIs to an oui_info_t.
*/
-static wmem_map_t *oui_info_table = NULL;
+static wmem_map_t *oui_info_table;
/*
* Decode the SAP value as a bitfield into a string, skipping the GI/CR bit.
@@ -207,7 +207,7 @@ static wmem_map_t *oui_info_table = NULL;
*/
static void
-llc_sap_value( gchar *result, guint32 sap )
+llc_sap_value( char *result, uint32_t sap )
{
snprintf( result, ITEM_LABEL_LENGTH, "%s", val_to_str_const(sap<<1, sap_vals, "Unknown"));
}
@@ -216,7 +216,7 @@ llc_sap_value( gchar *result, guint32 sap )
* Add an entry for a new OUI.
*/
void
-llc_add_oui(guint32 oui, const char *table_name, const char *table_ui_name,
+llc_add_oui(uint32_t oui, const char *table_name, const char *table_ui_name,
hf_register_info *hf_item, const int proto)
{
oui_info_t *new_info;
@@ -237,14 +237,14 @@ llc_add_oui(guint32 oui, const char *table_name, const char *table_ui_name,
wmem_map_insert(oui_info_table, GUINT_TO_POINTER(oui), new_info);
}
-static gboolean
-capture_snap(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
+static bool
+capture_snap(const unsigned char *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- guint32 oui;
- guint16 etype;
+ uint32_t oui;
+ uint16_t etype;
if (!BYTES_ARE_IN_FRAME(offset, len, 5))
- return FALSE;
+ return false;
oui = pd[offset] << 16 | pd[offset+1] << 8 | pd[offset+2];
etype = pntoh16(&pd[offset+3]);
@@ -267,18 +267,18 @@ capture_snap(const guchar *pd, int offset, int len, capture_packet_info_t *cpinf
return try_capture_dissector("ethertype", etype, pd, offset+5+5, len, cpinfo, pseudo_header);
}
- return FALSE;
+ return false;
}
-static gboolean
-capture_llc(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_) {
+static bool
+capture_llc(const unsigned char *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_) {
int is_snap;
- guint16 control;
+ uint16_t control;
int llc_header_len;
if (!BYTES_ARE_IN_FRAME(offset, len, 2))
- return FALSE;
+ return false;
is_snap = (pd[offset] == SAP_SNAP) && (pd[offset+1] == SAP_SNAP);
llc_header_len = 2; /* DSAP + SSAP */
@@ -290,12 +290,12 @@ capture_llc(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo
* whether it's basic or extended operation; is that the case?
*/
control = get_xdlc_control(pd, offset+2, pd[offset+1] & SSAP_CR_BIT);
- llc_header_len += XDLC_CONTROL_LEN(control, TRUE);
+ llc_header_len += XDLC_CONTROL_LEN(control, true);
if (!BYTES_ARE_IN_FRAME(offset, len, llc_header_len))
- return FALSE;
+ return false;
if (!XDLC_IS_INFORMATION(control))
- return FALSE;
+ return false;
if (is_snap)
return capture_snap(pd, offset+llc_header_len, len, cpinfo, pseudo_header);
@@ -335,12 +335,12 @@ dissect_basicxid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
{
proto_tree *xid_tree = NULL;
proto_item *ti = NULL;
- guint8 format, types, wsize;
+ uint8_t format, types, wsize;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "XID");
col_clear(pinfo->cinfo, COL_INFO);
- format = tvb_get_guint8(tvb, 0);
+ format = tvb_get_uint8(tvb, 0);
ti = proto_tree_add_item(tree, proto_basicxid, tvb, 0, -1, ENC_NA);
xid_tree = proto_item_add_subtree(ti, ett_llc_basicxid);
@@ -348,7 +348,7 @@ dissect_basicxid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
col_append_str(pinfo->cinfo, COL_INFO, "Basic Format");
- types = tvb_get_guint8(tvb, 1);
+ types = tvb_get_uint8(tvb, 1);
proto_tree_add_uint(xid_tree, hf_llc_xid_types, tvb, 1,
1, types & TYPES_MASK);
@@ -356,7 +356,7 @@ dissect_basicxid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
"; %s", val_to_str(types & TYPES_MASK, type_vals, "0x%02x")
);
- wsize = tvb_get_guint8(tvb, 2);
+ wsize = tvb_get_uint8(tvb, 2);
proto_tree_add_uint(xid_tree, hf_llc_xid_wsize, tvb, 2,
1, (wsize & 0xFE) >> 1);
@@ -378,15 +378,15 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree *field_tree;
proto_item *ti, *sap_item;
int is_snap;
- guint16 control;
+ uint16_t control;
int llc_header_len;
- guint8 dsap, ssap, format;
+ uint8_t dsap, ssap, format;
tvbuff_t *next_tvb;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLC");
col_clear(pinfo->cinfo, COL_INFO);
- dsap = tvb_get_guint8(tvb, 0);
+ dsap = tvb_get_uint8(tvb, 0);
ti = proto_tree_add_item(tree, proto_llc, tvb, 0, -1, ENC_NA);
llc_tree = proto_item_add_subtree(ti, ett_llc);
@@ -396,7 +396,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(field_tree, hf_llc_dsap_sap, tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(field_tree, hf_llc_dsap_ig, tvb, 0, 1, ENC_NA);
- ssap = tvb_get_guint8(tvb, 1);
+ ssap = tvb_get_uint8(tvb, 1);
sap_item = proto_tree_add_item(llc_tree, hf_llc_ssap, tvb, 1, 1, ENC_BIG_ENDIAN);
field_tree = proto_item_add_subtree(sap_item, ett_llc_ssap);
proto_tree_add_item(field_tree, hf_llc_ssap_sap, tvb, 1, 1, ENC_BIG_ENDIAN);
@@ -414,8 +414,8 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
control = dissect_xdlc_control(tvb, 2, pinfo, llc_tree,
hf_llc_ctrl, ett_llc_ctrl,
&llc_cf_items, &llc_cf_items_ext,
- NULL, NULL, ssap & SSAP_CR_BIT, TRUE, FALSE);
- llc_header_len += XDLC_CONTROL_LEN(control, TRUE);
+ NULL, NULL, ssap & SSAP_CR_BIT, true, false);
+ llc_header_len += XDLC_CONTROL_LEN(control, true);
if (is_snap)
llc_header_len += 5; /* 3 bytes of OUI, 2 bytes of protocol ID */
@@ -423,7 +423,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_item_set_len(ti, llc_header_len);
if (is_snap) {
- dissect_snap(tvb, 2+XDLC_CONTROL_LEN(control, TRUE), pinfo, tree, llc_tree, control,
+ dissect_snap(tvb, 2+XDLC_CONTROL_LEN(control, true), pinfo, tree, llc_tree, control,
hf_llc_oui, hf_llc_type, hf_llc_pid, 2);
}
else {
@@ -455,7 +455,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
* Non-SNAP XID frame.
* Test for LLC basic format first
*/
- format = tvb_get_guint8(next_tvb, 0);
+ format = tvb_get_uint8(next_tvb, 0);
if (format == 0x81) {
dissect_basicxid(next_tvb, pinfo, tree, data);
} else {
@@ -489,9 +489,9 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
proto_tree *snap_tree, int control, int hf_oui, int hf_type, int hf_pid,
int bridge_pad)
{
- guint32 oui;
- const gchar *oui_str;
- guint16 etype;
+ uint32_t oui;
+ const char *oui_str;
+ uint16_t etype;
tvbuff_t *next_tvb;
oui_info_t *oui_info;
dissector_table_t subdissector_table;
@@ -693,7 +693,7 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
* if there isn't one.
*/
oui_info_t *
-get_snap_oui_info(guint32 oui)
+get_snap_oui_info(uint32_t oui)
{
if (oui_info_table != NULL) {
return (oui_info_t *)wmem_map_lookup(oui_info_table,
@@ -711,7 +711,7 @@ dissect_epd_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
{
proto_tree *llc_tree;
proto_item *ti;
- guint32 etype;
+ uint32_t etype;
tvbuff_t *next_tvb;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLC");
@@ -823,7 +823,7 @@ proto_register_llc(void)
{ "Protocol ID", "llc.pid", FT_UINT16, BASE_HEX,
NULL, 0x0, NULL, HFILL }}
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_llc,
&ett_llc_dsap,
&ett_llc_ssap,
@@ -866,7 +866,7 @@ proto_register_basicxid(void)
{ "Receive Window Size", "basicxid.llc.xid.wsize", FT_UINT8, BASE_DEC,
NULL, 0x0, NULL, HFILL }}
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_llc_basicxid
};
@@ -878,7 +878,7 @@ proto_register_basicxid(void)
}
static void
-register_hf(gpointer key _U_, gpointer value, gpointer user_data _U_)
+register_hf(void *key _U_, void *value, void *user_data _U_)
{
oui_info_t *info = (oui_info_t *)value;