* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# include "config.h"
#endif
-#include <stdlib.h>
#include <string.h>
#include <glib.h>
RWSTAT
};
/* File open modes */
-#define P9_OREAD 0x0
-#define P9_OWRITE 0x1
-#define P9_ORDWR 0x2
+#define P9_OREAD 0x0
+#define P9_OWRITE 0x1
+#define P9_ORDWR 0x2
#define P9_OEXEC 0x3
-#define P9_MODEMASK 0x3
-#define P9_OTRUNC 0x10
-#define P9_ORCLOSE 0x40
+#define P9_MODEMASK 0x3
+#define P9_OTRUNC 0x10
+#define P9_ORCLOSE 0x40
/* stat mode flags */
#define DMDIR 0x80000000 /* Directory */
static gint ett_9P_qidtype = -1;
/*9P Msg types to name mapping */
-static const value_string ninep_msg_type[] =
+static const value_string ninep_msg_type[] =
{ {TVERSION, "Tversion"},
{RVERSION, "Rversion"},
{TAUTH, "Tauth"},
{0, NULL},
};
/* Open/Create modes */
-static const value_string ninep_mode_vals[] =
+static const value_string ninep_mode_vals[] =
{
{P9_OREAD, "Read Access"},
{P9_OWRITE, "Write Access"},
/* Dissect 9P messages*/
static void dissect_9P(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
- guint32 ninesz,tmp,i;
+ guint32 /*ninesz,*/tmp,i;
guint16 tmp16;
guint8 ninemsg;
guint offset = 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "9P");
col_clear(pinfo->cinfo, COL_INFO);
- ninesz = tvb_get_letohl(tvb, offset);
+ /*ninesz = tvb_get_letohl(tvb, offset);*/
ninemsg = tvb_get_guint8(tvb, offset + 4);
- mname = val_to_str(ninemsg, ninep_msg_type,"Unknown");
-
+ mname = val_to_str(ninemsg, ninep_msg_type, "Unknown");
+
if(strcmp(mname,"Unknown") == 0) {
col_add_fstr(pinfo->cinfo, COL_INFO, "9P Data Continuation(?) (Tag %u)",(guint)ninemsg);
tmp16 = tvb_get_letohs(tvb,offset);
ti = proto_tree_add_item(ninep_tree, hf_9P_version, tvb, offset+2, tmp16, TRUE);
- tmp_tree = proto_item_add_subtree(ti,ett_9P_version);
+ tmp_tree = proto_item_add_subtree(ti,ett_9P_version);
proto_tree_add_item(tmp_tree, hf_9P_parmsz, tvb, offset, 2, TRUE);
offset += 2;
break;
proto_tree_add_item(ninep_tree, hf_9P_newfid, tvb, offset, 4, TRUE);
offset +=4;
-
+
tmp16 = tvb_get_letohs(tvb,offset);
proto_tree_add_item(ninep_tree, hf_9P_nwalk, tvb, offset, 2, TRUE);
offset +=2;
if(tmp16 > 250) {
tmp16 = 250;
tmp_tree = proto_tree_add_text(ninep_tree, tvb, 0, 0, "Only first 250 items shown");
- PROTO_ITEM_SET_GENERATED(tmp_tree);
+ PROTO_ITEM_SET_GENERATED(tmp_tree);
}
for(i = 0 ; i < tmp16; i++) {
guint16 tmplen;
proto_item *wname;
proto_tree *wname_tree;
-
+
tmplen = tvb_get_letohs(tvb,offset);
wname = proto_tree_add_item(ninep_tree, hf_9P_wname, tvb, offset+2, tmplen, TRUE);
wname_tree = proto_item_add_subtree(wname,ett_9P_wname);
if(tmp16 > 250) {
tmp16 = 250;
tmp_tree = proto_tree_add_text(ninep_tree, tvb, 0, 0, "Only first 250 items shown");
- PROTO_ITEM_SET_GENERATED(tmp_tree);
+ PROTO_ITEM_SET_GENERATED(tmp_tree);
}
for(i = 0; i < tmp16; i++) {
dissect_9P_qid(tvb,ninep_tree,offset);
offset += 13;
- }
- break;
+ }
+ break;
case TOPEN:
proto_tree_add_item(ninep_tree, hf_9P_fid, tvb, offset, 4, TRUE);
offset +=4;
offset +=8;
proto_tree_add_item(ninep_tree, hf_9P_count, tvb, offset, 4, TRUE);
- break;
+ break;
case RREAD:
tmp = tvb_get_letohl(tvb,offset);
proto_tree_add_item(ninep_tree, hf_9P_count, tvb, offset, 4, TRUE);
if(!tree)
return;
-
+
type = tvb_get_guint8(tvb,offset);
vers = tvb_get_letohs(tvb,offset+1);
path = tvb_get_letoh64(tvb,offset+1+4);
proto_item *ti;
const gchar *op_str;
int sha_offset, spa_offset, tha_offset, tpa_offset;
- gchar *sha_str, *spa_str, *tha_str, *tpa_str;
+ gchar *sha_str, *spa_str, /* *tha_str, */ *tpa_str;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AARP");
col_clear(pinfo->cinfo, COL_INFO);
/* Extract the addresses. */
sha_str = tvb_aarphrdaddr_to_str(tvb, sha_offset, ar_hln, ar_hrd);
spa_str = tvb_aarpproaddr_to_str(tvb, spa_offset, ar_pln, ar_pro);
+#if 0
+ /* TODO: tha_str is currently not shown nor parsed */
tha_str = tvb_aarphrdaddr_to_str(tvb, tha_offset, ar_hln, ar_hrd);
+#endif
tpa_str = tvb_aarpproaddr_to_str(tvb, tpa_offset, ar_pln, ar_pro);
switch (ar_op) {
acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, acn_dmp_adt_type *adt)
{
guint8 D, A;
- guint32 start_offset;
guint32 data_size;
guint32 data_value;
guint32 data_address;
proto_item *ti;
guint32 ok_to_process = FALSE;
- start_offset = offset;
buffer[0] = 0;
/* We would like to rip through Property Address-Data pairs */
acn_add_dmp_reason_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, acn_dmp_adt_type *adt)
{
guint8 D, A;
- guint32 start_offset;
guint32 data_value;
guint32 data_address;
guint32 x;
gchar buffer[BUFFER_SIZE];
const gchar *name;
- start_offset = offset;
buffer[0] = 0;
D = ACN_DMP_ADT_EXTRACT_D(adt->flags);
guint32 pdu_start;
guint32 pdu_length;
guint32 pdu_flvh_length; /* flags, length, vector, header */
- acn_pdu_offsets pdu_offsets = {0,0,0,0,0};
guint8 D;
guint8 octet;
guint32 length1;
/* save start of pdu block */
pdu_start = offset;
- pdu_offsets.start = pdu_start;
/* get PDU flags and length flag first */
octet = tvb_get_guint8(tvb, offset++);
guint32 pdu_start;
guint32 pdu_length;
guint32 pdu_flvh_length; /* flags, length, vector, header */
- acn_pdu_offsets pdu_offsets = {0,0,0,0,0};
guint8 octet;
guint32 length1;
guint32 length2;
guint32 length3;
guint32 vector_offset;
guint32 data_offset;
- guint32 end_offset;
guint32 data_length;
proto_item *ti, *pi;
/* save start of pdu block */
pdu_start = offset;
- pdu_offsets.start = pdu_start;
/* get PDU flags and length flag first */
octet = tvb_get_guint8(tvb, offset++);
data_offset = last_pdu_offsets->data;
data_length = last_pdu_offsets->data_length;
}
- end_offset = data_offset + data_length;
switch (vector) {
case ACN_SDT_VECTOR_ACK:
guint32 pdu_start;
guint32 pdu_length;
guint32 pdu_flvh_length; /* flags, length, vector, header */
- acn_pdu_offsets pdu_offsets = {0,0,0,0,0};
guint8 octet;
guint32 length1;
guint32 length2;
/* save start of pdu block */
pdu_start = offset;
- pdu_offsets.start = pdu_start;
/* get PDU flags and length flag first */
octet = tvb_get_guint8(tvb, offset++);
guint32 length3;
guint32 vector_offset;
guint32 data_offset;
- guint32 end_offset;
guint32 data_length;
proto_item *ti, *pi;
data_offset = last_pdu_offsets->data;
data_length = last_pdu_offsets->data_length;
}
- end_offset = data_offset + data_length;
/* process based on vector */
switch (vector) {