summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ncp-sss.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--epan/dissectors/packet-ncp-sss.c442
1 files changed, 221 insertions, 221 deletions
diff --git a/epan/dissectors/packet-ncp-sss.c b/epan/dissectors/packet-ncp-sss.c
index 7dc9966e..bee5830b 100644
--- a/epan/dissectors/packet-ncp-sss.c
+++ b/epan/dissectors/packet-ncp-sss.c
@@ -18,56 +18,56 @@
void proto_register_sss(void);
-static gint ett_sss = -1;
-
-static int proto_sss = -1;
-static int hf_buffer_size = -1;
-static int hf_ping_version = -1;
-static int hf_flags = -1;
-static int hf_context = -1;
-static int hf_frag_handle = -1;
-static int hf_length = -1;
-static int hf_verb = -1;
-static int hf_user = -1;
-static int hf_secret = -1;
-static int hf_sss_version = -1;
-static int hf_return_code = -1;
-static int hf_enc_cred = -1;
-static int hf_enc_data = -1;
-static int hfbit1 = -1;
-static int hfbit2 = -1;
-static int hfbit3 = -1;
-static int hfbit4 = -1;
-static int hfbit5 = -1;
-static int hfbit6 = -1;
-static int hfbit7 = -1;
-static int hfbit8 = -1;
-static int hfbit9 = -1;
-static int hfbit10 = -1;
-static int hfbit11 = -1;
-static int hfbit12 = -1;
-static int hfbit13 = -1;
-static int hfbit14 = -1;
-static int hfbit15 = -1;
-static int hfbit16 = -1;
-static int hfbit17 = -1;
-static int hfbit18 = -1;
-static int hfbit19 = -1;
-static int hfbit20 = -1;
-static int hfbit21 = -1;
-static int hfbit22 = -1;
-static int hfbit23 = -1;
-static int hfbit24 = -1;
-static int hfbit25 = -1;
-static int hfbit26 = -1;
-static int hfbit27 = -1;
-static int hfbit28 = -1;
-static int hfbit29 = -1;
-static int hfbit30 = -1;
-static int hfbit31 = -1;
-static int hfbit32 = -1;
-
-static expert_field ei_return_code = EI_INIT;
+static int ett_sss;
+
+static int proto_sss;
+static int hf_sss_buffer_size;
+static int hf_sss_ping_version;
+static int hf_sss_flags;
+static int hf_sss_context;
+static int hf_sss_frag_handle;
+static int hf_sss_length;
+static int hf_sss_verb;
+static int hf_sss_user;
+static int hf_sss_secret;
+static int hf_sss_sss_version;
+static int hf_sss_return_code;
+static int hf_sss_enc_cred;
+static int hf_sss_enc_data;
+static int hf_sss_bit1;
+static int hf_sss_bit2;
+static int hf_sss_bit3;
+static int hf_sss_bit4;
+static int hf_sss_bit5;
+static int hf_sss_bit6;
+static int hf_sss_bit7;
+static int hf_sss_bit8;
+static int hf_sss_bit9;
+static int hf_sss_bit10;
+static int hf_sss_bit11;
+static int hf_sss_bit12;
+static int hf_sss_bit13;
+static int hf_sss_bit14;
+static int hf_sss_bit15;
+static int hf_sss_bit16;
+static int hf_sss_bit17;
+static int hf_sss_bit18;
+static int hf_sss_bit19;
+static int hf_sss_bit20;
+static int hf_sss_bit21;
+static int hf_sss_bit22;
+static int hf_sss_bit23;
+static int hf_sss_bit24;
+static int hf_sss_bit25;
+static int hf_sss_bit26;
+static int hf_sss_bit27;
+static int hf_sss_bit28;
+static int hf_sss_bit29;
+static int hf_sss_bit30;
+static int hf_sss_bit31;
+static int hf_sss_bit32;
+
+static expert_field ei_return_code;
static const value_string sss_func_enum[] = {
{ 0x00000001, "Ping Server" },
@@ -137,15 +137,15 @@ static const value_string sss_errors_enum[] = {
static void
-process_flags(proto_tree *sss_tree, tvbuff_t *tvb, guint32 foffset)
+process_flags(proto_tree *sss_tree, tvbuff_t *tvb, uint32_t foffset)
{
- gchar flags_str[1024];
- const gchar *sep;
+ char flags_str[1024];
+ const char *sep;
proto_item *tinew;
proto_tree *flags_tree;
- guint32 i;
- guint32 bvalue = 0;
- guint32 flags = 0;
+ uint32_t i;
+ uint32_t bvalue = 0;
+ uint32_t flags = 0;
bvalue = 0x00000001;
flags_str[0]='\0';
@@ -259,7 +259,7 @@ process_flags(proto_tree *sss_tree, tvbuff_t *tvb, guint32 foffset)
bvalue = bvalue*2;
}
- tinew = proto_tree_add_uint(sss_tree, hf_flags, tvb, foffset, 4, flags);
+ tinew = proto_tree_add_uint(sss_tree, hf_sss_flags, tvb, foffset, 4, flags);
flags_tree = proto_item_add_subtree(tinew, ett_nds);
bvalue = 0x00000001;
@@ -268,100 +268,100 @@ process_flags(proto_tree *sss_tree, tvbuff_t *tvb, guint32 foffset)
if (flags & bvalue) {
switch(bvalue) {
case 0x00000001:
- proto_tree_add_item(flags_tree, hfbit1, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit1, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000002:
- proto_tree_add_item(flags_tree, hfbit2, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit2, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000004:
- proto_tree_add_item(flags_tree, hfbit3, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit3, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000008:
- proto_tree_add_item(flags_tree, hfbit4, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit4, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000010:
- proto_tree_add_item(flags_tree, hfbit5, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit5, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000020:
- proto_tree_add_item(flags_tree, hfbit6, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit6, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000040:
- proto_tree_add_item(flags_tree, hfbit7, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit7, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000080:
- proto_tree_add_item(flags_tree, hfbit8, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit8, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000100:
- proto_tree_add_item(flags_tree, hfbit9, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit9, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000200:
- proto_tree_add_item(flags_tree, hfbit10, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit10, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000400:
- proto_tree_add_item(flags_tree, hfbit11, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit11, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00000800:
- proto_tree_add_item(flags_tree, hfbit12, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit12, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00001000:
- proto_tree_add_item(flags_tree, hfbit13, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit13, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00002000:
- proto_tree_add_item(flags_tree, hfbit14, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit14, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00004000:
- proto_tree_add_item(flags_tree, hfbit15, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit15, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00008000:
- proto_tree_add_item(flags_tree, hfbit16, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit16, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00010000:
- proto_tree_add_item(flags_tree, hfbit17, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit17, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00020000:
- proto_tree_add_item(flags_tree, hfbit18, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit18, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00040000:
- proto_tree_add_item(flags_tree, hfbit19, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit19, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00080000:
- proto_tree_add_item(flags_tree, hfbit20, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit20, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00100000:
- proto_tree_add_item(flags_tree, hfbit21, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit21, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00200000:
- proto_tree_add_item(flags_tree, hfbit22, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit22, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00400000:
- proto_tree_add_item(flags_tree, hfbit23, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit23, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x00800000:
- proto_tree_add_item(flags_tree, hfbit24, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit24, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x01000000:
- proto_tree_add_item(flags_tree, hfbit25, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit25, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x02000000:
- proto_tree_add_item(flags_tree, hfbit26, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit26, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x04000000:
- proto_tree_add_item(flags_tree, hfbit27, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit27, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x08000000:
- proto_tree_add_item(flags_tree, hfbit28, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit28, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x10000000:
- proto_tree_add_item(flags_tree, hfbit29, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit29, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x20000000:
- proto_tree_add_item(flags_tree, hfbit30, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit30, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x40000000:
- proto_tree_add_item(flags_tree, hfbit31, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit31, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
case 0x80000000:
- proto_tree_add_item(flags_tree, hfbit32, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flags_tree, hf_sss_bit32, tvb, foffset, 4, ENC_BIG_ENDIAN);
break;
default:
break;
@@ -380,7 +380,7 @@ find_delimiter(tvbuff_t *tvb, int foffset)
{
int offset;
- offset = tvb_find_guint8(tvb, foffset, 256, '*');
+ offset = tvb_find_uint8(tvb, foffset, 256, '*');
if (offset >= foffset) {
return offset - foffset;
}
@@ -388,14 +388,14 @@ find_delimiter(tvbuff_t *tvb, int foffset)
}
static int
-sss_string(tvbuff_t* tvb, int hfinfo, proto_tree *sss_tree, int offset, gboolean little, guint32 length)
+sss_string(tvbuff_t* tvb, int hfinfo, proto_tree *sss_tree, int offset, bool little, uint32_t length)
{
int foffset = offset;
- guint32 str_length;
+ uint32_t str_length;
char buffer[1024];
- guint32 i;
- guint8 c_char;
- gint length_remaining;
+ uint32_t i;
+ uint8_t c_char;
+ int length_remaining;
if (length==0) {
if (little) {
@@ -411,7 +411,7 @@ sss_string(tvbuff_t* tvb, int hfinfo, proto_tree *sss_tree, int offset, gboolean
if (length_remaining <= 0) {
return foffset;
}
- if (str_length > (guint)length_remaining || str_length > (sizeof(buffer)-1)) {
+ if (str_length > (unsigned)length_remaining || str_length > (sizeof(buffer)-1)) {
proto_tree_add_string(sss_tree, hfinfo, tvb, foffset,
length_remaining + 4, "<String too long to process>");
foffset += length_remaining;
@@ -422,7 +422,7 @@ sss_string(tvbuff_t* tvb, int hfinfo, proto_tree *sss_tree, int offset, gboolean
return foffset;
}
for ( i = 0; i < str_length; i++ ) {
- c_char = tvb_get_guint8(tvb, foffset);
+ c_char = tvb_get_uint8(tvb, foffset);
if (g_ascii_isprint(c_char)) {
buffer[i] = c_char;
} else {
@@ -455,10 +455,10 @@ sss_string(tvbuff_t* tvb, int hfinfo, proto_tree *sss_tree, int offset, gboolean
void
dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp_req_hash_value *request_value)
{
- guint8 /*func,*/ subfunc = 0;
- guint32 subverb=0;
- guint32 msg_length=0;
- guint32 foffset= 0;
+ uint8_t /*func,*/ subfunc = 0;
+ uint32_t subverb=0;
+ uint32_t msg_length=0;
+ uint32_t foffset= 0;
proto_tree *atree;
proto_item *aitem;
@@ -467,9 +467,9 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
return;
}
foffset = 6;
- /*func = tvb_get_guint8(tvb, foffset);*/
+ /*func = tvb_get_uint8(tvb, foffset);*/
foffset += 1;
- subfunc = tvb_get_guint8(tvb, foffset);
+ subfunc = tvb_get_uint8(tvb, foffset);
foffset += 1;
/* Fill in the PROTOCOL & INFO columns. */
@@ -479,24 +479,24 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
switch (subfunc) {
case 1:
atree = proto_tree_add_subtree_format(ncp_tree, tvb, foffset, -1, ett_sss, NULL, "Packet Type: %s", val_to_str(subfunc, sss_func_enum, "Unknown (%d)"));
- proto_tree_add_item(atree, hf_ping_version, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(atree, hf_sss_ping_version, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
foffset += 4;
- proto_tree_add_item(atree, hf_flags, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(atree, hf_sss_flags, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
/*foffset += 4;*/
break;
case 2:
- proto_tree_add_item(ncp_tree, hf_frag_handle, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ncp_tree, hf_sss_frag_handle, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
if (tvb_get_letohl(tvb, foffset)==0xffffffff) { /* Fragment handle of -1 means no fragment. So process packet */
foffset += 4;
- proto_tree_add_item(ncp_tree, hf_buffer_size, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ncp_tree, hf_sss_buffer_size, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
foffset += 4;
- proto_tree_add_item(ncp_tree, hf_length, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ncp_tree, hf_sss_length, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
foffset += 4;
foffset += 12; /* Blank Context */
subverb = tvb_get_letohl(tvb, foffset);
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(subverb, sss_verb_enum, "Unknown (%d)"));
- aitem = proto_tree_add_item(ncp_tree, hf_verb, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ aitem = proto_tree_add_item(ncp_tree, hf_sss_verb, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
atree = proto_item_add_subtree(aitem, ett_sss);
if (request_value) {
request_value->req_nds_flags=subverb;
@@ -504,15 +504,15 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
foffset += 4;
process_flags(atree, tvb, foffset);
foffset += 4;
- proto_tree_add_item(atree, hf_context, tvb, foffset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(atree, hf_sss_context, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
switch (subverb) {
case 0:
foffset += 4;
- /*foffset =*/ sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
+ /*foffset =*/ sss_string(tvb, hf_sss_user, atree, foffset, true, 0);
break;
case 1:
- foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
+ foffset = sss_string(tvb, hf_sss_secret, atree, foffset, true, 0);
msg_length = tvb_get_letohl(tvb, foffset);
foffset += (msg_length+4); /* Unsure of what this length and parameter are */
/* A bad secret of length greater then 256 characters will cause frag
@@ -520,41 +520,41 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
So check to make sure we still have data in the packet anytime
we read a secret. */
if (tvb_reported_length_remaining(tvb, foffset) > 4) {
- /*foffset =*/ sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
+ /*foffset =*/ sss_string(tvb, hf_sss_user, atree, foffset, true, 0);
}
break;
case 2:
foffset += 4;
- foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
+ foffset = sss_string(tvb, hf_sss_secret, atree, foffset, true, 0);
if (tvb_reported_length_remaining(tvb, foffset) > 4) {
msg_length = tvb_get_letohl(tvb, foffset);
foffset += 4;
- if (tvb_captured_length_remaining(tvb, foffset) < (gint) msg_length) {
- proto_tree_add_item(atree, hf_enc_data, tvb, foffset, -1, ENC_NA);
+ if (tvb_captured_length_remaining(tvb, foffset) < (int) msg_length) {
+ proto_tree_add_item(atree, hf_sss_enc_data, tvb, foffset, -1, ENC_NA);
} else {
- proto_tree_add_item(atree, hf_enc_data, tvb, foffset, msg_length, ENC_NA);
+ proto_tree_add_item(atree, hf_sss_enc_data, tvb, foffset, msg_length, ENC_NA);
}
}
break;
case 3:
case 4:
- foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
+ foffset = sss_string(tvb, hf_sss_secret, atree, foffset, true, 0);
if (tvb_reported_length_remaining(tvb, foffset) > 4) {
- /*foffset =*/ sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
+ /*foffset =*/ sss_string(tvb, hf_sss_user, atree, foffset, true, 0);
}
break;
case 5:
break;
case 6:
- foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
+ foffset = sss_string(tvb, hf_sss_secret, atree, foffset, true, 0);
if (tvb_reported_length_remaining(tvb, foffset) > 4) {
- /*foffset =*/ sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
+ /*foffset =*/ sss_string(tvb, hf_sss_user, atree, foffset, true, 0);
}
break;
case 7:
msg_length = tvb_get_letohl(tvb, foffset);
foffset += 4;
- proto_tree_add_item(atree, hf_enc_cred, tvb, foffset, msg_length, ENC_NA);
+ proto_tree_add_item(atree, hf_sss_enc_cred, tvb, foffset, msg_length, ENC_NA);
break;
case 8:
case 9:
@@ -570,7 +570,7 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
}
if (tvb_reported_length_remaining(tvb, foffset) > 8) {
foffset += 4;
- proto_tree_add_item(ncp_tree, hf_enc_data, tvb, foffset, -1, ENC_NA);
+ proto_tree_add_item(ncp_tree, hf_sss_enc_data, tvb, foffset, -1, ENC_NA);
}
}
break;
@@ -583,16 +583,16 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
}
void
-dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint8 subfunc, ncp_req_hash_value *request_value)
+dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, uint8_t subfunc, ncp_req_hash_value *request_value)
{
- guint32 foffset=0;
- guint32 subverb=0;
- guint32 msg_length=0;
- guint32 return_code=0;
- guint32 number_of_items=0;
- gint32 length_of_string=0;
- guint32 i = 0;
- const gchar *str;
+ uint32_t foffset=0;
+ uint32_t subverb=0;
+ uint32_t msg_length=0;
+ uint32_t return_code=0;
+ uint32_t number_of_items=0;
+ int32_t length_of_string=0;
+ uint32_t i = 0;
+ const char *str;
proto_tree *atree;
proto_item *expert_item;
@@ -605,9 +605,9 @@ dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint
atree = proto_tree_add_subtree_format(ncp_tree, tvb, foffset, -1, ett_sss, NULL, "Function: %s", val_to_str_const(subfunc, sss_func_enum, "Unknown"));
switch (subfunc) {
case 1:
- proto_tree_add_item(atree, hf_flags, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(atree, hf_sss_flags, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
foffset += 4;
- proto_tree_add_item(atree, hf_sss_version, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(atree, hf_sss_sss_version, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
/*foffset += 4;*/
break;
case 2:
@@ -615,13 +615,13 @@ dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint
subverb = request_value->req_nds_flags;
str = try_val_to_str(subverb, sss_verb_enum);
if (str) {
- proto_tree_add_uint(atree, hf_verb, tvb, foffset, -1, subverb);
+ proto_tree_add_uint(atree, hf_sss_verb, tvb, foffset, -1, subverb);
}
}
- proto_tree_add_item(atree, hf_length, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(atree, hf_sss_length, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
msg_length = tvb_get_letohl(tvb, foffset);
foffset += 4;
- proto_tree_add_item(atree, hf_frag_handle, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(atree, hf_sss_frag_handle, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
foffset += 4;
msg_length -= 4;
if ((tvb_get_letohl(tvb, foffset-4)==0xffffffff) && (msg_length > 4)) {
@@ -629,12 +629,12 @@ dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint
return_code = tvb_get_letohl(tvb, foffset);
str = try_val_to_str(return_code, sss_errors_enum);
if (str) {
- expert_item = proto_tree_add_item(atree, hf_return_code, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
+ expert_item = proto_tree_add_item(atree, hf_sss_return_code, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
expert_add_info_format(pinfo, expert_item, &ei_return_code, "SSS Error: %s", str);
col_add_fstr(pinfo->cinfo, COL_INFO, "R Error - %s", val_to_str(return_code, sss_errors_enum, "Unknown (%d)"));
/*foffset+=4;*/
} else {
- proto_tree_add_uint_format_value(atree, hf_return_code, tvb, foffset, 4, 0, "Success (0x00000000)");
+ proto_tree_add_uint_format_value(atree, hf_sss_return_code, tvb, foffset, 4, 0, "Success (0x00000000)");
if (tvb_reported_length_remaining(tvb, foffset) > 8) {
foffset += 4;
if (request_value && subverb == 6) {
@@ -646,22 +646,22 @@ dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint
if (length_of_string > tvb_reported_length_remaining(tvb, foffset)) {
return;
}
- foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, length_of_string);
+ foffset = sss_string(tvb, hf_sss_secret, atree, foffset, true, length_of_string);
if (tvb_reported_length_remaining(tvb, foffset) < 8) {
return;
}
foffset++;
}
} else {
- proto_tree_add_item(atree, hf_enc_data, tvb, foffset, tvb_captured_length_remaining(tvb, foffset), ENC_NA);
+ proto_tree_add_item(atree, hf_sss_enc_data, tvb, foffset, tvb_captured_length_remaining(tvb, foffset), ENC_NA);
}
}
}
} else {
- proto_tree_add_uint_format_value(atree, hf_return_code, tvb, foffset, 4, 0, "Success (0x00000000)");
+ proto_tree_add_uint_format_value(atree, hf_sss_return_code, tvb, foffset, 4, 0, "Success (0x00000000)");
if (tvb_reported_length_remaining(tvb, foffset) > 8) {
foffset += 4;
- proto_tree_add_item(atree, hf_enc_data, tvb, foffset, tvb_captured_length_remaining(tvb, foffset), ENC_NA);
+ proto_tree_add_item(atree, hf_sss_enc_data, tvb, foffset, tvb_captured_length_remaining(tvb, foffset), ENC_NA);
}
}
break;
@@ -676,143 +676,143 @@ void
proto_register_sss(void)
{
static hf_register_info hf_sss[] = {
- { &hf_buffer_size,
+ { &hf_sss_buffer_size,
{ "Buffer Size", "sss.buffer", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
- { &hf_ping_version,
+ { &hf_sss_ping_version,
{ "Ping Version", "sss.ping_version", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
- { &hf_flags,
+ { &hf_sss_flags,
{ "Flags", "sss.flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
- { &hf_context,
+ { &hf_sss_context,
{ "Context", "sss.context", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
- { &hf_frag_handle,
+ { &hf_sss_frag_handle,
{ "Fragment Handle", "sss.frag_handle", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
- { &hf_length,
+ { &hf_sss_length,
{ "Length", "sss.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
- { &hf_verb,
+ { &hf_sss_verb,
{ "Verb", "sss.verb", FT_UINT32, BASE_HEX, VALS(sss_verb_enum), 0x0, NULL, HFILL }},
- { &hf_user,
+ { &hf_sss_user,
{ "User", "sss.user", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
- { &hf_secret,
+ { &hf_sss_secret,
{ "Secret ID", "sss.secret", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
- { &hf_sss_version,
+ { &hf_sss_sss_version,
{ "SecretStore Protocol Version", "sss.version", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
- { &hf_return_code,
+ { &hf_sss_return_code,
{ "Return Code", "sss.return_code", FT_UINT32, BASE_HEX, VALS(sss_errors_enum), 0x0, NULL, HFILL }},
- { &hf_enc_cred,
+ { &hf_sss_enc_cred,
{ "Encrypted Credential", "sss.enc_cred", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
- { &hf_enc_data,
+ { &hf_sss_enc_data,
{ "Encrypted Data", "sss.enc_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
- { &hfbit1,
- { "Enhanced Protection", "ncp.sss_bit1", FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL }},
+ { &hf_sss_bit1,
+ { "Enhanced Protection", "sss.bit1", FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL }},
- { &hfbit2,
- { "Create ID", "ncp.sss_bit2", FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL }},
+ { &hf_sss_bit2,
+ { "Create ID", "sss.bit2", FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL }},
- { &hfbit3,
- { "Remove Lock", "ncp.sss_bit3", FT_BOOLEAN, 32, NULL, 0x00000004, NULL, HFILL }},
+ { &hf_sss_bit3,
+ { "Remove Lock", "sss.bit3", FT_BOOLEAN, 32, NULL, 0x00000004, NULL, HFILL }},
- { &hfbit4,
- { "Repair", "ncp.sss_bit4", FT_BOOLEAN, 32, NULL, 0x00000008, NULL, HFILL }},
+ { &hf_sss_bit4,
+ { "Repair", "sss.bit4", FT_BOOLEAN, 32, NULL, 0x00000008, NULL, HFILL }},
- { &hfbit5,
- { "Unicode", "ncp.sss_bit5", FT_BOOLEAN, 32, NULL, 0x00000010, NULL, HFILL }},
+ { &hf_sss_bit5,
+ { "Unicode", "sss.bit5", FT_BOOLEAN, 32, NULL, 0x00000010, NULL, HFILL }},
- { &hfbit6,
- { "EP Master Password Used", "ncp.sss_bit6", FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL }},
+ { &hf_sss_bit6,
+ { "EP Master Password Used", "sss.bit6", FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL }},
- { &hfbit7,
- { "EP Password Used", "ncp.sss_bit7", FT_BOOLEAN, 32, NULL, 0x00000040, NULL, HFILL }},
+ { &hf_sss_bit7,
+ { "EP Password Used", "sss.bit7", FT_BOOLEAN, 32, NULL, 0x00000040, NULL, HFILL }},
- { &hfbit8,
- { "Set Tree Name", "ncp.sss_bit8", FT_BOOLEAN, 32, NULL, 0x00000080, NULL, HFILL }},
+ { &hf_sss_bit8,
+ { "Set Tree Name", "sss.bit8", FT_BOOLEAN, 32, NULL, 0x00000080, NULL, HFILL }},
- { &hfbit9,
- { "Get Context", "ncp.sss_bit9", FT_BOOLEAN, 32, NULL, 0x00000100, NULL, HFILL }},
+ { &hf_sss_bit9,
+ { "Get Context", "sss.bit9", FT_BOOLEAN, 32, NULL, 0x00000100, NULL, HFILL }},
- { &hfbit10,
- { "Destroy Context", "ncp.sss_bit10", FT_BOOLEAN, 32, NULL, 0x00000200, NULL, HFILL }},
+ { &hf_sss_bit10,
+ { "Destroy Context", "sss.bit10", FT_BOOLEAN, 32, NULL, 0x00000200, NULL, HFILL }},
- { &hfbit11,
- { "Not Defined", "ncp.sss_bit11", FT_BOOLEAN, 32, NULL, 0x00000400, NULL, HFILL }},
+ { &hf_sss_bit11,
+ { "Not Defined", "sss.bit11", FT_BOOLEAN, 32, NULL, 0x00000400, NULL, HFILL }},
- { &hfbit12,
- { "Not Defined", "ncp.sss_bit12", FT_BOOLEAN, 32, NULL, 0x00000800, NULL, HFILL }},
+ { &hf_sss_bit12,
+ { "Not Defined", "sss.bit12", FT_BOOLEAN, 32, NULL, 0x00000800, NULL, HFILL }},
- { &hfbit13,
- { "Not Defined", "ncp.sss_bit13", FT_BOOLEAN, 32, NULL, 0x00001000, NULL, HFILL }},
+ { &hf_sss_bit13,
+ { "Not Defined", "sss.bit13", FT_BOOLEAN, 32, NULL, 0x00001000, NULL, HFILL }},
- { &hfbit14,
- { "Not Defined", "ncp.sss_bit14", FT_BOOLEAN, 32, NULL, 0x00002000, NULL, HFILL }},
+ { &hf_sss_bit14,
+ { "Not Defined", "sss.bit14", FT_BOOLEAN, 32, NULL, 0x00002000, NULL, HFILL }},
- { &hfbit15,
- { "Not Defined", "ncp.sss_bit15", FT_BOOLEAN, 32, NULL, 0x00004000, NULL, HFILL }},
+ { &hf_sss_bit15,
+ { "Not Defined", "sss.bit15", FT_BOOLEAN, 32, NULL, 0x00004000, NULL, HFILL }},
- { &hfbit16,
- { "Not Defined", "ncp.sss_bit16", FT_BOOLEAN, 32, NULL, 0x00008000, NULL, HFILL }},
+ { &hf_sss_bit16,
+ { "Not Defined", "sss.bit16", FT_BOOLEAN, 32, NULL, 0x00008000, NULL, HFILL }},
- { &hfbit17,
- { "EP Lock", "ncp.sss_bit17", FT_BOOLEAN, 32, NULL, 0x00010000, NULL, HFILL }},
+ { &hf_sss_bit17,
+ { "EP Lock", "sss.bit17", FT_BOOLEAN, 32, NULL, 0x00010000, NULL, HFILL }},
- { &hfbit18,
- { "Not Initialized", "ncp.sss_bit18", FT_BOOLEAN, 32, NULL, 0x00020000, NULL, HFILL }},
+ { &hf_sss_bit18,
+ { "Not Initialized", "sss.bit18", FT_BOOLEAN, 32, NULL, 0x00020000, NULL, HFILL }},
- { &hfbit19,
- { "Enhanced Protection", "ncp.sss_bit19", FT_BOOLEAN, 32, NULL, 0x00040000, NULL, HFILL }},
+ { &hf_sss_bit19,
+ { "Enhanced Protection", "sss.bit19", FT_BOOLEAN, 32, NULL, 0x00040000, NULL, HFILL }},
- { &hfbit20,
- { "Store Not Synced", "ncp.sss_bit20", FT_BOOLEAN, 32, NULL, 0x00080000, NULL, HFILL }},
+ { &hf_sss_bit20,
+ { "Store Not Synced", "sss.bit20", FT_BOOLEAN, 32, NULL, 0x00080000, NULL, HFILL }},
- { &hfbit21,
- { "Admin Last Modified", "ncp.sss_bit21", FT_BOOLEAN, 32, NULL, 0x00100000, NULL, HFILL }},
+ { &hf_sss_bit21,
+ { "Admin Last Modified", "sss.bit21", FT_BOOLEAN, 32, NULL, 0x00100000, NULL, HFILL }},
- { &hfbit22,
- { "EP Password Present", "ncp.sss_bit22", FT_BOOLEAN, 32, NULL, 0x00200000, NULL, HFILL }},
+ { &hf_sss_bit22,
+ { "EP Password Present", "sss.bit22", FT_BOOLEAN, 32, NULL, 0x00200000, NULL, HFILL }},
- { &hfbit23,
- { "EP Master Password Present", "ncp.sss_bit23", FT_BOOLEAN, 32, NULL, 0x00400000, NULL, HFILL }},
+ { &hf_sss_bit23,
+ { "EP Master Password Present", "sss.bit23", FT_BOOLEAN, 32, NULL, 0x00400000, NULL, HFILL }},
- { &hfbit24,
- { "MP Disabled", "ncp.sss_bit24", FT_BOOLEAN, 32, NULL, 0x00800000, NULL, HFILL }},
+ { &hf_sss_bit24,
+ { "MP Disabled", "sss.bit24", FT_BOOLEAN, 32, NULL, 0x00800000, NULL, HFILL }},
- { &hfbit25,
- { "Not Defined", "ncp.sss_bit25", FT_BOOLEAN, 32, NULL, 0x01000000, NULL, HFILL }},
+ { &hf_sss_bit25,
+ { "Not Defined", "sss.bit25", FT_BOOLEAN, 32, NULL, 0x01000000, NULL, HFILL }},
- { &hfbit26,
- { "Not Defined", "ncp.sss_bit26", FT_BOOLEAN, 32, NULL, 0x02000000, NULL, HFILL }},
+ { &hf_sss_bit26,
+ { "Not Defined", "sss.bit26", FT_BOOLEAN, 32, NULL, 0x02000000, NULL, HFILL }},
- { &hfbit27,
- { "Not Defined", "ncp.sss_bit27", FT_BOOLEAN, 32, NULL, 0x04000000, NULL, HFILL }},
+ { &hf_sss_bit27,
+ { "Not Defined", "sss.bit27", FT_BOOLEAN, 32, NULL, 0x04000000, NULL, HFILL }},
- { &hfbit28,
- { "Not Defined", "ncp.sss_bit28", FT_BOOLEAN, 32, NULL, 0x08000000, NULL, HFILL }},
+ { &hf_sss_bit28,
+ { "Not Defined", "sss.bit28", FT_BOOLEAN, 32, NULL, 0x08000000, NULL, HFILL }},
- { &hfbit29,
- { "Not Defined", "ncp.sss_bit29", FT_BOOLEAN, 32, NULL, 0x10000000, NULL, HFILL }},
+ { &hf_sss_bit29,
+ { "Not Defined", "sss.bit29", FT_BOOLEAN, 32, NULL, 0x10000000, NULL, HFILL }},
- { &hfbit30,
- { "Not Defined", "ncp.sss_bit30", FT_BOOLEAN, 32, NULL, 0x20000000, NULL, HFILL }},
+ { &hf_sss_bit30,
+ { "Not Defined", "sss.bit30", FT_BOOLEAN, 32, NULL, 0x20000000, NULL, HFILL }},
- { &hfbit31,
- { "Not Defined", "ncp.sss_bit31", FT_BOOLEAN, 32, NULL, 0x40000000, NULL, HFILL }},
+ { &hf_sss_bit31,
+ { "Not Defined", "sss.bit31", FT_BOOLEAN, 32, NULL, 0x40000000, NULL, HFILL }},
- { &hfbit32,
- { "Not Defined", "ncp.sss_bit32", FT_BOOLEAN, 32, NULL, 0x80000000, NULL, HFILL }}
+ { &hf_sss_bit32,
+ { "Not Defined", "sss.bit32", FT_BOOLEAN, 32, NULL, 0x80000000, NULL, HFILL }}
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_sss
};