本文整理汇总了C++中col_clear函数的典型用法代码示例。如果您正苦于以下问题:C++ col_clear函数的具体用法?C++ col_clear怎么用?C++ col_clear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了col_clear函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dissect_ipvs_syncd
static void
dissect_ipvs_syncd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
proto_tree *tree;
proto_item *item;
int offset = 0;
guint8 cnt = 0;
int conn = 0;
item = proto_tree_add_item(parent_tree, proto_ipvs_syncd, tvb, offset, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_ipvs_syncd);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPVS");
col_clear(pinfo->cinfo, COL_INFO);
cnt = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_conn_count, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_syncid, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_size, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
for (conn = 0; conn < cnt; conn++)
{
proto_tree *ctree, *ti;
proto_tree *ftree, *fi;
guint16 flags;
ti = proto_tree_add_text(tree, tvb, offset, 24, "Connection #%d", conn+1);
ctree = proto_item_add_subtree(ti, ett_conn);
proto_tree_add_item(ctree, hf_resv8, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(ctree, hf_proto, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(ctree, hf_cport, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(ctree, hf_vport, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(ctree, hf_dport, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(ctree, hf_caddr, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ctree, hf_vaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ctree, hf_daddr, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
flags = tvb_get_ntohs(tvb, offset);
fi = proto_tree_add_item(ctree, hf_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
ftree = proto_item_add_subtree(fi, ett_flags);
if ( (flags & 0x0F) == IP_VS_CONN_F_MASQ )
{
proto_tree_add_text(ftree, tvb, offset+1, 1, "Connection Type: Masquerade");
}
else if ( (flags & 0x0F) == IP_VS_CONN_F_LOCALNODE )
{
proto_tree_add_text(ftree, tvb, offset+1, 1, "Connection Type: Local Node");
}
else if ( (flags & 0x0F) == IP_VS_CONN_F_TUNNEL )
{
proto_tree_add_text(ftree, tvb, offset+1, 1, "Connection Type: Tunnel");
}
else if ( (flags & 0x0F) == IP_VS_CONN_F_DROUTE )
{
proto_tree_add_text(ftree, tvb, offset+1, 1, "Connection Type: Direct Routing");
}
else
{
proto_tree_add_text(ftree, tvb, offset+1, 1, "Connection Type: Unknown (%d)",
flags & IP_VS_CONN_F_FWD_MASK);
}
if ( flags & IP_VS_CONN_F_HASHED )
{
proto_tree_add_text(ftree, tvb, offset+1, 1, "Hashed Entry");
}
if ( flags & IP_VS_CONN_F_NOOUTPUT )
{
proto_tree_add_text(ftree, tvb, offset+1, 1, "No Output Packets");
}
if ( flags & IP_VS_CONN_F_INACTIVE )
{
proto_tree_add_text(ftree, tvb, offset, 1, "Connection Not Established");
}
//.........这里部分代码省略.........
开发者ID:hubolo,项目名称:wireshark-1.8.0,代码行数:101,代码来源:packet-ipvs-syncd.c
示例2: dissect_fip
static void
dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint op;
guint sub;
guint rlen;
proto_item *ti;
proto_item *item;
proto_tree *fip_tree;
proto_tree *subtree;
guint dtype;
guint dlen;
guint desc_offset;
guint val;
tvbuff_t *desc_tvb;
const char *info;
const char *text;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FIP");
col_clear(pinfo->cinfo, COL_INFO);
if (!tvb_bytes_exist(tvb, 0, FIP_HEADER_LEN)) {
col_set_str(pinfo->cinfo, COL_INFO, "[packet too short]");
if (tree)
proto_tree_add_protocol_format(tree, proto_fip, tvb, 0,
-1, "FIP [packet too short]");
return;
}
op = tvb_get_ntohs(tvb, 2);
sub = tvb_get_guint8(tvb, 5);
switch (op) {
case FIP_OP_DISC:
info = val_to_str(sub, fip_disc_subcodes, "Discovery 0x%x");
break;
case FIP_OP_LS:
info = val_to_str(sub, fip_ls_subcodes, "Link Service 0x%x");
break;
case FIP_OP_CTRL:
info = val_to_str(sub, fip_ctrl_subcodes, "Control 0x%x");
break;
case FIP_OP_VLAN:
info = val_to_str(sub, fip_vlan_subcodes, "VLAN 0x%x");
break;
case FIP_OP_VN2VN:
info = val_to_str(sub, fip_vn2vn_subcodes, "VN2VN 0x%x");
break;
default:
info = val_to_str(op, fip_opcodes, "Unknown op 0x%x");
break;
}
col_add_str(pinfo->cinfo, COL_INFO, info);
rlen = tvb_get_ntohs(tvb, 6);
ti = proto_tree_add_protocol_format(tree, proto_fip, tvb, 0,
FIP_HEADER_LEN + rlen * FIP_BPW,
"FIP %s", info);
fip_tree = proto_item_add_subtree(ti, ett_fip);
proto_tree_add_item(fip_tree, hf_fip_ver, tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(fip_tree, hf_fip_op, tvb, 2, 2, ENC_BIG_ENDIAN);
switch (op) {
case FIP_OP_DISC:
proto_tree_add_item(fip_tree, hf_fip_disc_subcode, tvb, 5, 1, ENC_BIG_ENDIAN);
break;
case FIP_OP_LS:
proto_tree_add_item(fip_tree, hf_fip_ls_subcode, tvb, 5, 1, ENC_BIG_ENDIAN);
break;
case FIP_OP_CTRL:
proto_tree_add_item(fip_tree, hf_fip_ctrl_subcode, tvb, 5, 1, ENC_BIG_ENDIAN);
break;
case FIP_OP_VLAN:
proto_tree_add_item(fip_tree, hf_fip_vlan_subcode, tvb, 5, 1, ENC_BIG_ENDIAN);
break;
case FIP_OP_VN2VN:
proto_tree_add_item(fip_tree, hf_fip_vn2vn_subcode, tvb, 5, 1, ENC_BIG_ENDIAN);
break;
default:
proto_tree_add_item(fip_tree, hf_fip_hex_subcode, tvb, 5, 1, ENC_BIG_ENDIAN);
break;
}
proto_tree_add_item(fip_tree, hf_fip_dlen, tvb, 6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(fip_tree, tvb, 8, hf_fip_flags,
ett_fip_flags, hf_fip_flags_fields, ENC_BIG_ENDIAN);
desc_offset = FIP_HEADER_LEN;
rlen *= FIP_BPW;
proto_tree_add_bytes_format(fip_tree, hf_fip_descriptors, tvb, desc_offset, rlen, NULL, "Descriptors");
while ((rlen > 0) && tvb_bytes_exist(tvb, desc_offset, 2)) {
dlen = tvb_get_guint8(tvb, desc_offset + 1) * FIP_BPW;
if (!dlen) {
proto_tree_add_expert(fip_tree, pinfo, &ei_fip_descriptors, tvb, desc_offset, -1);
break;
}
if (!tvb_bytes_exist(tvb, desc_offset, dlen) || dlen > rlen) {
break;
//.........这里部分代码省略.........
开发者ID:ARK1988,项目名称:wireshark,代码行数:101,代码来源:packet-fip.c
示例3: dissect_ipxwan
static void
dissect_ipxwan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ti;
proto_tree *ipxwan_tree = NULL;
int offset = 0;
guint8 packet_type;
guint8 num_options;
guint8 option_number;
proto_tree *option_tree;
guint16 option_data_len;
guint16 wan_link_delay;
guint32 delay;
guint32 throughput;
guint32 delta_time;
guint8 compression_type;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPX WAN");
col_clear(pinfo->cinfo, COL_INFO);
if (tree) {
ti = proto_tree_add_item(tree, proto_ipxwan, tvb, 0, -1,
FALSE);
ipxwan_tree = proto_item_add_subtree(ti, ett_ipxwan);
}
if (tree) {
proto_tree_add_item(ipxwan_tree, hf_ipxwan_identifier, tvb,
offset, 4, FALSE);
}
offset += 4;
packet_type = tvb_get_guint8(tvb, offset);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(packet_type, ipxwan_packet_type_vals,
"Unknown packet type %u"));
}
if (tree) {
proto_tree_add_uint(ipxwan_tree, hf_ipxwan_packet_type, tvb,
offset, 1, packet_type);
offset += 1;
proto_tree_add_item(ipxwan_tree, hf_ipxwan_node_id, tvb,
offset, 4, FALSE);
offset += 4;
proto_tree_add_item(ipxwan_tree, hf_ipxwan_sequence_number, tvb,
offset, 1, FALSE);
offset += 1;
num_options = tvb_get_guint8(tvb, offset);
proto_tree_add_uint(ipxwan_tree, hf_ipxwan_num_options, tvb,
offset, 1, num_options);
offset += 1;
while (num_options != 0) {
option_number = tvb_get_guint8(tvb, offset);
ti = proto_tree_add_text(ipxwan_tree, tvb, offset, -1,
"Option: %s",
val_to_str(option_number, ipxwan_option_num_vals,
"Unknown (%u)"));
option_tree = proto_item_add_subtree(ti,
ett_ipxwan_option);
proto_tree_add_uint(option_tree, hf_ipxwan_option_num,
tvb, offset, 1, option_number);
offset += 1;
proto_tree_add_item(option_tree, hf_ipxwan_accept_option,
tvb, offset, 1, FALSE);
offset += 1;
option_data_len = tvb_get_ntohs(tvb, offset);
proto_tree_add_uint(option_tree, hf_ipxwan_option_data_len,
tvb, offset, 2, option_data_len);
offset += 2;
proto_item_set_len(ti, option_data_len+4);
switch (option_number) {
case OPT_ROUTING_TYPE:
if (option_data_len != 1) {
proto_tree_add_text(option_tree,
tvb, offset, option_data_len,
"Bogus length: %u, should be 1",
option_data_len);
} else {
proto_tree_add_item(option_tree,
hf_ipxwan_routing_type, tvb,
offset, 1, FALSE);
}
break;
case OPT_RIP_SAP_INFO_EXCHANGE:
if (option_data_len != 54) {
proto_tree_add_text(option_tree,
tvb, offset, option_data_len,
"Bogus length: %u, should be 54",
option_data_len);
} else {
wan_link_delay = tvb_get_ntohs(tvb,
offset);
proto_tree_add_uint_format(option_tree,
hf_ipxwan_wan_link_delay, tvb,
offset, 2, wan_link_delay,
"WAN Link Delay: %ums",
//.........这里部分代码省略.........
开发者ID:RazZziel,项目名称:wireshark-dplay,代码行数:101,代码来源:packet-ipxwan.c
示例4: xmpp_iq
void
xmpp_iq(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *packet)
{
proto_item *xmpp_iq_item;
proto_tree *xmpp_iq_tree;
xmpp_attr_t *attr_id, *attr_type;
xmpp_attr_info attrs_info[] = {
{"xmlns", hf_xmpp_xmlns, FALSE, FALSE, NULL, NULL},
{"id", hf_xmpp_id, TRUE, TRUE, NULL, NULL},
{"type", hf_xmpp_type, TRUE, TRUE, NULL, NULL},
{"from", hf_xmpp_from, FALSE, TRUE, NULL, NULL},
{"to", hf_xmpp_to, FALSE, TRUE, NULL, NULL},
{"xml:lang", -1, FALSE, FALSE, NULL, NULL}
};
conversation_t *conversation;
xmpp_conv_info_t *xmpp_info;
xmpp_transaction_t *reqresp_trans;
xmpp_elem_info elems_info [] = {
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","http://jabber.org/protocol/disco#items"), xmpp_disco_items_query, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "jabber:iq:roster"), xmpp_roster_query, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "http://jabber.org/protocol/disco#info"), xmpp_disco_info_query, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "http://jabber.org/protocol/bytestreams"), xmpp_bytestreams_query, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "http://jabber.org/protocol/muc#owner"), xmpp_muc_owner_query, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "http://jabber.org/protocol/muc#admin"), xmpp_muc_admin_query, ONE},
{NAME, "bind", xmpp_iq_bind, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("session", "xmlns", "urn:ietf:params:xml:ns:xmpp-session"), xmpp_session, ONE},
{NAME, "vCard", xmpp_vcard, ONE},
{NAME, "jingle", xmpp_jingle, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("services", "xmlns", "http://jabber.org/protocol/jinglenodes"), xmpp_jinglenodes_services, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("channel", "xmlns", "http://jabber.org/protocol/jinglenodes#channel"), xmpp_jinglenodes_channel, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("open", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_open, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("close", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_close, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("data", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_data, ONE},
{NAME, "si", xmpp_si, ONE},
{NAME, "error", xmpp_error, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("session", "xmlns", "http://www.google.com/session"), xmpp_gtalk_session, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","google:jingleinfo"), xmpp_gtalk_jingleinfo_query, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("usersetting", "xmlns","google:setting"), xmpp_gtalk_usersetting, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","jabber:iq:last"), xmpp_last_query, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","jabber:iq:version"), xmpp_version_query, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","google:mail:notify"), xmpp_gtalk_mail_query, ONE},
{NAME, "mailbox", xmpp_gtalk_mail_mailbox, ONE},
{NAME, "new-mail", xmpp_gtalk_mail_new_mail, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","google:shared-status"), xmpp_gtalk_status_query, ONE},
{NAME, "conference-info", xmpp_conference_info, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("ping", "xmlns","urn:xmpp:ping"), xmpp_ping, ONE},
{NAME_AND_ATTR, xmpp_name_attr_struct("inputevt", "xmlns","http://jitsi.org/protocol/inputevt"), xmpp_jitsi_inputevt, ONE},
};
attr_id = xmpp_get_attr(packet, "id");
attr_type = xmpp_get_attr(packet, "type");
conversation = find_or_create_conversation(pinfo);
xmpp_info = (xmpp_conv_info_t *)conversation_get_proto_data(conversation, proto_xmpp);
xmpp_iq_item = proto_tree_add_item(tree, hf_xmpp_iq, tvb, packet->offset, packet->length, ENC_LITTLE_ENDIAN);
xmpp_iq_tree = proto_item_add_subtree(xmpp_iq_item,ett_xmpp_iq);
xmpp_display_attrs(xmpp_iq_tree, packet, pinfo, tvb, attrs_info, array_length(attrs_info));
col_clear(pinfo->cinfo, COL_INFO);
col_add_fstr(pinfo->cinfo, COL_INFO, "IQ(%s) ", attr_type?attr_type->value:"");
xmpp_display_elems(xmpp_iq_tree, packet, pinfo, tvb, elems_info, array_length(elems_info));
/*displays generated info such as req/resp tracking, jingle sid
* in each packet related to specified jingle session and IBB sid in packet related to it*/
if(xmpp_info && attr_id)
{
gchar *jingle_sid, *ibb_sid, *gtalk_sid;
jingle_sid = (gchar *)se_tree_lookup_string(xmpp_info->jingle_sessions, attr_id->value, EMEM_TREE_STRING_NOCASE);
if (jingle_sid) {
proto_item *it = proto_tree_add_string(tree, hf_xmpp_jingle_session, tvb, 0, 0, jingle_sid);
PROTO_ITEM_SET_GENERATED(it);
}
ibb_sid = (gchar *)se_tree_lookup_string(xmpp_info->ibb_sessions, attr_id->value, EMEM_TREE_STRING_NOCASE);
if (ibb_sid) {
proto_item *it = proto_tree_add_string(tree, hf_xmpp_ibb, tvb, 0, 0, ibb_sid);
PROTO_ITEM_SET_GENERATED(it);
}
gtalk_sid = (gchar *)se_tree_lookup_string(xmpp_info->gtalk_sessions, attr_id->value, EMEM_TREE_STRING_NOCASE);
if (gtalk_sid) {
proto_item *it = proto_tree_add_string(tree, hf_xmpp_gtalk, tvb, 0, 0, gtalk_sid);
PROTO_ITEM_SET_GENERATED(it);
}
reqresp_trans = (xmpp_transaction_t *)se_tree_lookup_string(xmpp_info->req_resp, attr_id->value, EMEM_TREE_STRING_NOCASE);
/*displays request/response field in each iq packet*/
if (reqresp_trans) {
//.........这里部分代码省略.........
开发者ID:SayCV,项目名称:wireshark,代码行数:101,代码来源:packet-xmpp-core.c
示例5: dissect_nbd_tcp_pdu
static void
dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
guint32 magic, error, packet;
guint32 handle[2];
guint64 from;
int offset=0;
proto_tree *tree=NULL;
proto_item *item=NULL;
conversation_t *conversation;
nbd_conv_info_t *nbd_info;
nbd_transaction_t *nbd_trans=NULL;
emem_tree_key_t hkey[3];
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NBD");
col_clear(pinfo->cinfo, COL_INFO);
item = proto_tree_add_item(parent_tree, proto_nbd, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_nbd);
magic=tvb_get_ntohl(tvb, offset);
proto_tree_add_item(tree, hf_nbd_magic, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
/* grab what we need to do the request/response matching */
switch(magic){
case NBD_REQUEST_MAGIC:
case NBD_RESPONSE_MAGIC:
handle[0]=tvb_get_ntohl(tvb, offset+4);
handle[1]=tvb_get_ntohl(tvb, offset+8);
break;
default:
return;
}
conversation = find_or_create_conversation(pinfo);
/*
* Do we already have a state structure for this conv
*/
nbd_info = conversation_get_proto_data(conversation, proto_nbd);
if (!nbd_info) {
/* No. Attach that information to the conversation, and add
* it to the list of information structures.
*/
nbd_info = se_alloc(sizeof(nbd_conv_info_t));
nbd_info->unacked_pdus=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "nbd_unacked_pdus");
nbd_info->acked_pdus=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "nbd_acked_pdus");
conversation_add_proto_data(conversation, proto_nbd, nbd_info);
}
if(!pinfo->fd->flags.visited){
if(magic==NBD_REQUEST_MAGIC){
/* This is a request */
nbd_trans=se_alloc(sizeof(nbd_transaction_t));
nbd_trans->req_frame=pinfo->fd->num;
nbd_trans->rep_frame=0;
nbd_trans->req_time=pinfo->fd->abs_ts;
nbd_trans->type=tvb_get_ntohl(tvb, offset);
nbd_trans->datalen=tvb_get_ntohl(tvb, offset+20);
hkey[0].length=2;
hkey[0].key=handle;
hkey[1].length=0;
se_tree_insert32_array(nbd_info->unacked_pdus, hkey, (void *)nbd_trans);
} else if(magic==NBD_RESPONSE_MAGIC){
hkey[0].length=2;
hkey[0].key=handle;
hkey[1].length=0;
nbd_trans=se_tree_lookup32_array(nbd_info->unacked_pdus, hkey);
if(nbd_trans){
nbd_trans->rep_frame=pinfo->fd->num;
hkey[0].length=1;
hkey[0].key=&nbd_trans->rep_frame;
hkey[1].length=2;
hkey[1].key=handle;
hkey[2].length=0;
se_tree_insert32_array(nbd_info->acked_pdus, hkey, (void *)nbd_trans);
hkey[0].length=1;
hkey[0].key=&nbd_trans->req_frame;
hkey[1].length=2;
hkey[1].key=handle;
hkey[2].length=0;
se_tree_insert32_array(nbd_info->acked_pdus, hkey, (void *)nbd_trans);
}
}
} else {
packet=pinfo->fd->num;
hkey[0].length=1;
hkey[0].key=&packet;
hkey[1].length=2;
hkey[1].key=handle;
hkey[2].length=0;
//.........这里部分代码省略.........
开发者ID:dogphilly,项目名称:wireshark,代码行数:101,代码来源:packet-nbd.c
示例6: dissect_ax25_nol3
static void
dissect_ax25_nol3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree )
{
proto_item *ti;
proto_tree *ax25_nol3_tree;
char *info_buffer;
int offset;
tvbuff_t *next_tvb = NULL;
guint8 dti = 0;
gboolean dissected;
info_buffer = (char *)wmem_alloc( wmem_packet_scope(), STRLEN );
info_buffer[0] = '\0';
col_set_str( pinfo->cinfo, COL_PROTOCOL, "AX.25-NoL3");
col_clear( pinfo->cinfo, COL_INFO);
offset = 0;
g_snprintf( info_buffer, STRLEN, "Text" );
if ( gPREF_APRS )
{
dti = tvb_get_guint8( tvb, offset );
if ( isaprs( dti ) )
g_snprintf( info_buffer, STRLEN, "APRS" );
}
if ( gPREF_DX )
{
if ( tvb_get_guint8( tvb, offset ) == 'D' && tvb_get_guint8( tvb, offset + 1 ) == 'X' )
g_snprintf( info_buffer, STRLEN, "DX cluster" );
}
col_add_str( pinfo->cinfo, COL_INFO, info_buffer );
/* Call sub-dissectors here */
if ( parent_tree )
{
/* create display subtree for the protocol */
ti = proto_tree_add_protocol_format( parent_tree,
proto_ax25_nol3,
tvb,
0,
-1,
"AX.25 No Layer 3 - (%s)", info_buffer );
ax25_nol3_tree = proto_item_add_subtree( ti, ett_ax25_nol3 );
next_tvb = tvb_new_subset_remaining(tvb, offset);
dissected = FALSE;
if ( gPREF_APRS )
{
if ( isaprs( dti ) )
{
dissected = TRUE;
call_dissector( aprs_handle , next_tvb, pinfo, ax25_nol3_tree );
}
}
if ( gPREF_DX )
{
if ( tvb_get_guint8( tvb, offset ) == 'D' && tvb_get_guint8( tvb, offset + 1 ) == 'X' )
{
dissected = TRUE;
dissect_dx( next_tvb, pinfo, ax25_nol3_tree );
}
}
if ( ! dissected )
call_dissector( default_handle , next_tvb, pinfo, ax25_nol3_tree );
}
}
开发者ID:bearxiong99,项目名称:wireshark,代码行数:71,代码来源:packet-ax25-nol3.c
示例7: dissect_ipvs_syncd
static void
dissect_ipvs_syncd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
proto_tree *tree;
proto_item *item;
int offset = 0;
guint8 cnt = 0;
int conn = 0;
item = proto_tree_add_item(parent_tree, proto_ipvs_syncd, tvb, offset, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_ipvs_syncd);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPVS");
col_clear(pinfo->cinfo, COL_INFO);
cnt = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_conn_count, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_syncid, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_size, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
for (conn = 0; conn < cnt; conn++)
{
proto_tree *ctree, *ti;
proto_tree *ftree, *fi;
guint16 flags;
ti = proto_tree_add_text(tree, tvb, offset, 24, "Connection #%d", conn+1);
ctree = proto_item_add_subtree(ti, ett_conn);
proto_tree_add_item(ctree, hf_resv8, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(ctree, hf_proto, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(ctree, hf_cport, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(ctree, hf_vport, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(ctree, hf_dport, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(ctree, hf_caddr, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ctree, hf_vaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ctree, hf_daddr, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
flags = tvb_get_ntohs(tvb, offset);
fi = proto_tree_add_item(ctree, hf_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
ftree = proto_item_add_subtree(fi, ett_flags);
proto_tree_add_item(ftree, hf_flags_conn_type, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ftree, hf_flags_hashed_entry, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ftree, hf_flags_no_output_packets, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ftree, hf_flags_conn_not_established, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ftree, hf_flags_adjust_output_seq, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ftree, hf_flags_adjust_input_seq, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ftree, hf_flags_no_client_port_set, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(ctree, hf_state, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* we have full connection info */
if ( flags & IP_VS_CONN_F_SEQ_MASK )
{
proto_tree_add_item(ctree, hf_in_seq_init, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ctree, hf_in_seq_delta, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ctree, hf_in_seq_pdelta, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ctree, hf_out_seq_init, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ctree, hf_out_seq_delta, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ctree, hf_out_seq_pdelta, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
}
}
}
开发者ID:AndresVelasco,项目名称:wireshark,代码行数:99,代码来源:packet-ipvs-syncd.c
示例8: dissect_ipxsap
static void
dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *sap_tree, *s_tree;
proto_item *ti, *hidden_item;
int cursor;
struct sap_query query;
guint16 server_type;
gchar *server_name;
guint16 server_port;
guint16 intermediate_network;
static const char *sap_type[4] = { "General Query", "General Response",
"Nearest Query", "Nearest Response" };
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPX SAP");
col_clear(pinfo->cinfo, COL_INFO);
query.query_type = tvb_get_ntohs(tvb, 0);
query.server_type = tvb_get_ntohs(tvb, 2);
if (check_col(pinfo->cinfo, COL_INFO)) {
if (query.query_type >= 1 && query.query_type <= 4) {
col_set_str(pinfo->cinfo, COL_INFO, sap_type[query.query_type - 1]);
}
else {
col_set_str(pinfo->cinfo, COL_INFO, "Unknown Packet Type");
}
}
if (tree) {
ti = proto_tree_add_item(tree, proto_sap, tvb, 0, -1, ENC_NA);
sap_tree = proto_item_add_subtree(ti, ett_ipxsap);
if (query.query_type >= 1 && query.query_type <= 4) {
proto_tree_add_text(sap_tree, tvb, 0, 2, "%s", sap_type[query.query_type - 1]);
if ((query.query_type - 1) % 2) {
hidden_item = proto_tree_add_boolean(sap_tree,
hf_sap_response,
tvb, 0, 2, 1);
} else {
hidden_item = proto_tree_add_boolean(sap_tree,
hf_sap_request,
tvb, 0, 2, 1);
}
PROTO_ITEM_SET_HIDDEN(hidden_item);
}
else {
proto_tree_add_text(sap_tree, tvb, 0, 2,
"Unknown SAP Packet Type %d", query.query_type);
}
if (query.query_type == IPX_SAP_GENERAL_RESPONSE ||
query.query_type == IPX_SAP_NEAREST_RESPONSE) { /* responses */
int available_length = tvb_reported_length(tvb);
for (cursor = 2; (cursor + 64) <= available_length; cursor += 64) {
server_type = tvb_get_ntohs(tvb, cursor);
server_name = tvb_format_stringzpad(tvb, cursor+2, 48);
ti = proto_tree_add_text(sap_tree, tvb, cursor+2, 48,
"Server Name: %s", server_name);
s_tree = proto_item_add_subtree(ti, ett_ipxsap_server);
proto_tree_add_text(s_tree, tvb, cursor, 2, "Server Type: %s (0x%04X)",
val_to_str_ext_const(server_type, &novell_server_vals_ext, "Unknown"),
server_type);
proto_tree_add_text(s_tree, tvb, cursor+50, 4, "Network: %s",
ipxnet_to_string(tvb_get_ptr(tvb, cursor+50, 4)));
proto_tree_add_text(s_tree, tvb, cursor+54, 6, "Node: %s",
tvb_ether_to_str(tvb, cursor+54));
server_port = tvb_get_ntohs(tvb, cursor+60);
proto_tree_add_text(s_tree, tvb, cursor+60, 2, "Socket: %s (0x%04x)",
socket_text(server_port),
server_port);
intermediate_network = tvb_get_ntohs(tvb, cursor+62);
proto_tree_add_text(s_tree, tvb, cursor+62, 2,
"Intermediate Networks: %d",
intermediate_network);
}
}
else { /* queries */
proto_tree_add_text(sap_tree, tvb, 2, 2, "Server Type: %s (0x%04X)",
val_to_str_ext_const(query.server_type, &novell_server_vals_ext, "Unknown"),
query.server_type);
}
}
}
开发者ID:zonquan,项目名称:dumphttp,代码行数:88,代码来源:packet-ipx.c
示例9: dissect_ipx
static void
dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
tvbuff_t *next_tvb;
proto_tree *ipx_tree = NULL;
proto_item *ti = NULL, *hidden_item;
const guint8 *src_net_node, *dst_net_node;
guint8 ipx_hops;
char *str;
guint16 first_socket, second_socket;
guint32 ipx_snet, ipx_dnet;
static ipxhdr_t ipxh_arr[4];
static int ipx_current=0;
ipxhdr_t *ipxh;
ipx_current++;
if(ipx_current==4){
ipx_current=0;
}
ipxh=&ipxh_arr[ipx_current];
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPX");
col_clear(pinfo->cinfo, COL_INFO);
/* Calculate here for use in pinfo and in tree */
ipxh->ipx_dsocket = tvb_get_ntohs(tvb, 16);
ipxh->ipx_ssocket = tvb_get_ntohs(tvb, 28);
ipxh->ipx_type = tvb_get_guint8(tvb, 5);
ipxh->ipx_length = tvb_get_ntohs(tvb, 2);
pinfo->ptype = PT_IPX;
pinfo->srcport = ipxh->ipx_ssocket;
pinfo->destport = ipxh->ipx_dsocket;
/* Adjust the tvbuff length to include only the IPX datagram. */
set_actual_length(tvb, ipxh->ipx_length);
src_net_node = tvb_get_ptr(tvb, 18, 10);
dst_net_node = tvb_get_ptr(tvb, 6, 10);
SET_ADDRESS(&pinfo->net_src, AT_IPX, 10, src_net_node);
SET_ADDRESS(&pinfo->src, AT_IPX, 10, src_net_node);
SET_ADDRESS(&ipxh->ipx_src, AT_IPX, 10, src_net_node);
SET_ADDRESS(&pinfo->net_dst, AT_IPX, 10, dst_net_node);
SET_ADDRESS(&pinfo->dst, AT_IPX, 10, dst_net_node);
SET_ADDRESS(&ipxh->ipx_dst, AT_IPX, 10, dst_net_node);
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%04x)",
socket_text(ipxh->ipx_dsocket), ipxh->ipx_dsocket);
if (tree) {
ti = proto_tree_add_item(tree, proto_ipx, tvb, 0, IPX_HEADER_LEN, ENC_NA);
ipx_tree = proto_item_add_subtree(ti, ett_ipx);
}
str=ep_address_to_str(&pinfo->net_src);
hidden_item = proto_tree_add_string(ipx_tree, hf_ipx_src, tvb, 0, 0, str);
PROTO_ITEM_SET_HIDDEN(hidden_item);
hidden_item = proto_tree_add_string(ipx_tree, hf_ipx_addr, tvb, 0, 0, str);
PROTO_ITEM_SET_HIDDEN(hidden_item);
str=ep_address_to_str(&pinfo->net_dst);
hidden_item = proto_tree_add_string(ipx_tree, hf_ipx_dst, tvb, 0, 0, str);
PROTO_ITEM_SET_HIDDEN(hidden_item);
hidden_item = proto_tree_add_string(ipx_tree, hf_ipx_addr, tvb, 0, 0, str);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_item(ipx_tree, hf_ipx_checksum, tvb, 0, 2, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(ipx_tree, hf_ipx_len, tvb, 2, 2, ipxh->ipx_length,
"Length: %d bytes", ipxh->ipx_length);
ipx_hops = tvb_get_guint8(tvb, 4);
proto_tree_add_uint_format(ipx_tree, hf_ipx_hops, tvb, 4, 1, ipx_hops,
"Transport Control: %d hops", ipx_hops);
proto_tree_add_uint(ipx_tree, hf_ipx_packet_type, tvb, 5, 1, ipxh->ipx_type);
/* Destination */
ipx_dnet = tvb_get_ntohl(tvb, 6);
proto_tree_add_ipxnet(ipx_tree, hf_ipx_dnet, tvb, 6, 4,
ipx_dnet);
hidden_item = proto_tree_add_ipxnet(ipx_tree, hf_ipx_net, tvb, 6, 4,
ipx_dnet);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_item(ipx_tree, hf_ipx_dnode, tvb, 10, 6, ENC_NA);
hidden_item = proto_tree_add_item(ipx_tree, hf_ipx_node, tvb, 10, 6, ENC_NA);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_uint(ipx_tree, hf_ipx_dsocket, tvb, 16, 2,
ipxh->ipx_dsocket);
hidden_item = proto_tree_add_uint(ipx_tree, hf_ipx_socket, tvb, 16, 2,
ipxh->ipx_dsocket);
PROTO_ITEM_SET_HIDDEN(hidden_item);
/* Source */
ipx_snet = tvb_get_ntohl(tvb, 18);
proto_tree_add_ipxnet(ipx_tree, hf_ipx_snet, tvb, 18, 4,
ipx_snet);
//.........这里部分代码省略.........
开发者ID:zonquan,项目名称:dumphttp,代码行数:101,代码来源:packet-ipx.c
示例10: dissect_sdlc
static void
dissect_sdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *sdlc_tree;
proto_item *sdlc_ti;
guint8 addr;
guint16 control;
int sdlc_header_len;
gboolean is_response;
tvbuff_t *next_tvb;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SDLC");
col_clear(pinfo->cinfo, COL_INFO);
addr = tvb_get_guint8(tvb, 0);
sdlc_header_len = 1; /* address */
/*
* XXX - is there something in the SDLC header that indicates
* how to interpret "command vs. response" based on the
* direction?
*/
if (pinfo->p2p_dir == P2P_DIR_SENT) {
is_response = FALSE;
col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DCE");
col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DTE");
}
else {
/* XXX - what if the direction is unknown? */
is_response = TRUE;
col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DTE");
col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DCE");
}
if (tree) {
sdlc_ti = proto_tree_add_item(tree, proto_sdlc, tvb, 0, -1,
ENC_NA);
sdlc_tree = proto_item_add_subtree(sdlc_ti, ett_sdlc);
proto_tree_add_uint(sdlc_tree, hf_sdlc_address, tvb, 0, 1,
addr);
} else {
sdlc_ti = NULL;
sdlc_tree = NULL;
}
/*
* XXX - SDLC has a mod-128 mode as well as a mod-7 mode.
* We can infer the mode from an SNRM/SRME frame, but if
* we don't see one of them, we may have to have a preference
* to control what to use.
*/
control = dissect_xdlc_control(tvb, 1, pinfo, sdlc_tree, hf_sdlc_control,
ett_sdlc_control, &sdlc_cf_items, NULL, NULL, NULL,
is_response, FALSE, FALSE);
sdlc_header_len += XDLC_CONTROL_LEN(control, FALSE);
if (tree)
proto_item_set_len(sdlc_ti, sdlc_header_len);
/*
* XXX - is there an FCS at the end, at least in Sniffer
* captures? (There doesn't appear to be.)
*/
next_tvb = tvb_new_subset_remaining(tvb, sdlc_header_len);
if (XDLC_IS_INFORMATION(control)) {
/* call the SNA dissector */
call_dissector(sna_handle, next_tvb, pinfo, tree);
} else
call_dissector(data_handle, next_tvb, pinfo, tree);
}
开发者ID:pvons,项目名称:wireshark,代码行数:71,代码来源:packet-sdlc.c
示例11: dissect_dsp
/*
* Dissect X518 PDUs inside a ROS PDUs
*/
static void
dissect_dsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
int offset = 0;
int old_offset;
proto_item *item=NULL;
proto_tree *tree=NULL;
int (*dsp_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) = NULL;
const char *dsp_op_name;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
/* do we have operation information from the ROS dissector? */
if( !pinfo->private_data ){
if(parent_tree){
proto_tree_add_text(parent_tree, tvb, offset, -1,
"Internal error: can't get operation information from ROS dissector.");
}
return ;
} else {
session = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) );
}
if(parent_tree){
item = proto_tree_add_item(parent_tree, proto_dsp, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_dsp);
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DAP");
col_clear(pinfo->cinfo, COL_INFO);
switch(session->ros_op & ROS_OP_MASK) {
case (ROS_OP_BIND | ROS_OP_ARGUMENT): /* BindInvoke */
dsp_dissector = dissect_dsp_DSASystemBindArgument;
dsp_op_name = "System-Bind-Argument";
break;
case (ROS_OP_BIND | ROS_OP_RESULT): /* BindResult */
dsp_dissector = dissect_dsp_DSASystemBindResult;
dsp_op_name = "System-Bind-Result";
break;
case (ROS_OP_BIND | ROS_OP_ERROR): /* BindError */
dsp_dissector = dissect_dsp_DSASystemBindError;
dsp_op_name = "System-Bind-Error";
break;
case (ROS_OP_INVOKE | ROS_OP_ARGUMENT): /* Invoke Argument */
switch(session->ros_op & ROS_OP_OPCODE_MASK) {
case 1: /* read */
dsp_dissector = dissect_dsp_ChainedReadArgument;
dsp_op_name = "Chained-Read-Argument";
break;
case 2: /* compare */
dsp_dissector = dissect_dsp_ChainedCompareArgument;
dsp_op_name = "Chained-Compare-Argument";
break;
case 3: /* abandon */
dsp_dissector = dissect_dsp_ChainedAbandonArgument;
dsp_op_name = "Chained-Abandon-Argument";
break;
case 4: /* list */
dsp_dissector = dissect_dsp_ChainedListArgument;
dsp_op_name = "Chained-List-Argument";
break;
case 5: /* search */
dsp_dissector = dissect_dsp_ChainedSearchArgument;
dsp_op_name = "Chained-Search-Argument";
break;
case 6: /* addEntry */
dsp_dissector = dissect_dsp_ChainedAddEntryArgument;
dsp_op_name = "Chained-Add-Entry-Argument";
break;
case 7: /* removeEntry */
dsp_dissector = dissect_dsp_ChainedRemoveEntryArgument;
dsp_op_name = "Chained-Remove-Entry-Argument";
break;
case 8: /* modifyEntry */
dsp_dissector = dissect_dsp_ChainedModifyEntryArgument;
dsp_op_name = "ChainedModify-Entry-Argument";
break;
case 9: /* modifyDN */
dsp_dissector = dissect_dsp_ChainedModifyDNArgument;
dsp_op_name = "ChainedModify-DN-Argument";
break;
default:
proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DSP opcode (%d)",
session->ros_op & ROS_OP_OPCODE_MASK);
break;
}
break;
case (ROS_OP_INVOKE | ROS_OP_RESULT): /* Return Result */
switch(session->ros_op & ROS_OP_OPCODE_MASK) {
case 1: /* read */
dsp_dissector = dissect_dsp_ChainedReadResult;
dsp_op_name = "Chained-Read-Result";
break;
case 2: /* compare */
dsp_dissector = dissect_dsp_ChainedCompareResult;
dsp_op_name = "Chained-Compare-Result";
//.........这里部分代码省略.........
开发者ID:LucaBongiorni,项目名称:LTE_monitor_c2xx,代码行数:101,代码来源:packet-dsp-template.c
示例12: dissect_tzsp
static void
dissect_tzsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *tzsp_tree = NULL;
proto_item *ti = NULL;
int pos = 0;
tvbuff_t *next_tvb;
guint16 encapsulation = 0;
int wtap_encap;
dissector_handle_t encap_dissector;
const char *encap_name;
const char *info;
guint8 type;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TZSP");
col_clear(pinfo->cinfo, COL_INFO);
type = tvb_get_guint8(tvb, 1);
/* Find the dissector. */
encapsulation = tvb_get_ntohs(tvb, 2);
if (encapsulation != 0) {
wtap_encap = tzsp_encap_to_wtap_encap(encapsulation);
if ((wtap_encap != -1) &&
(encap_dissector = dissector_get_uint_handle(encap_dissector_table, wtap_encap))) {
encap_name = dissector_handle_get_short_name(encap_dissector);
}
else {
encap_name = "Unknown";
}
info = encap_name;
}
else {
wtap_encap = -1;
encap_name = "Nothing";
info = val_to_str(type, tzsp_type, "Unknown (%u)");
}
col_add_str(pinfo->cinfo, COL_INFO, info);
if (tree) {
/* Adding TZSP item and subtree */
ti = proto_tree_add_protocol_format(tree, proto_tzsp, tvb, 0,
-1, "TZSP: %s: ", info);
tzsp_tree = proto_item_add_subtree(ti, ett_tzsp);
proto_tree_add_item (tzsp_tree, hf_tzsp_version, tvb, 0, 1,
ENC_BIG_ENDIAN);
proto_tree_add_uint (tzsp_tree, hf_tzsp_type, tvb, 1, 1,
type);
proto_tree_add_uint_format (tzsp_tree, hf_tzsp_encap, tvb, 2, 2,
encapsulation, "Encapsulates: %s (%d)",
encap_name, encapsulation);
}
/*
* XXX - what about TZSP_CONFIG frames?
*
* The MIB at
*
* http://web.archive.org/web/20021221195733/http://www.networkchemistry.com/support/appnotes/SENSOR-MIB
*
* seems to indicate that you can configure the probe using SNMP;
* does TZSP_CONFIG also support that? An old version of Kismet
* included code to control a Network Chemistry WSP100 sensor:
*
* https://www.kismetwireless.net/code-old/svn/tags/kismet-2004-02-R1/wsp100source.cc
*
* and it used SNMP to configure the probe.
*/
if ((type != TZSP_NULL) && (type != TZSP_PORT)) {
pos = add_option_info(tvb, 4, tzsp_tree, ti);
if (tree)
proto_item_set_end(ti, tvb, pos);
next_tvb = tvb_new_subset_remaining(tvb, pos);
if ((encapsulation != 0)
&& ((wtap_encap == -1)
|| !dissector_try_uint(encap_dissector_table, wtap_encap,
next_tvb, pinfo, tree))) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN");
col_add_fstr(pinfo->cinfo, COL_INFO, "TZSP_ENCAP = %u",
encapsulation);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
}
}
开发者ID:hashbrowncipher,项目名称:wireshark,代码行数:88,代码来源:packet-tzsp.c
示例13: dissect_interlink
static void
dissect_interlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset = 0;
proto_tree *il_tree = NULL;
proto_tree *ilh_tree = NULL;
proto_tree *ilb_tree = NULL;
guint8 ilb_type;
guint8 ilb_version;
guint16 type_version = 0;
dissector_handle_t handle;
tvbuff_t *next_tvb;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "INTERLINK");
col_clear(pinfo->cinfo, COL_INFO);
if (tree) {
proto_item *il_item;
il_item = proto_tree_add_item(tree, proto_interlink,
tvb, 0, 16, FALSE);
if (il_item)
il_tree = proto_item_add_subtree(il_item, ett_interlink);
}
if (il_tree) {
proto_item *ilh_item = NULL;
ilh_item = proto_tree_add_text(il_tree, tvb, 0, 12, "Interlink Header");
if (ilh_item)
ilh_tree = proto_item_add_subtree(ilh_item, ett_interlink_header);
}
if (ilh_tree) {
proto_tree_add_item(ilh_tree, hf_interlink_id, tvb, offset, 4, FALSE);
offset += 4;
proto_tree_add_item(ilh_tree, hf_interlink_version, tvb, offset, 2, TRUE);
offset += 2;
proto_tree_add_item(ilh_tree, hf_interlink_cmd, tvb, offset, 2, TRUE);
offset += 2;
proto_tree_add_item(ilh_tree, hf_interlink_seq, tvb, offset, 2, TRUE);
offset += 2;
} else {
offset += 10;
}
if (ilh_tree) {
proto_item *flags_item;
proto_tree *flags_tree = NULL;
flags_item = proto_tree_add_item(ilh_tree, hf_interlink_flags,
tvb, offset, 2, TRUE);
if (flags_item) {
flags_tree = proto_item_add_subtree(flags_item, ett_interlink_flags);
}
if (flags_tree) {
guint16 il_flags;
il_flags = tvb_get_letohs(tvb, offset);
proto_tree_add_boolean(flags_tree, hf_interlink_flags_req_ack, tvb, offset, 2, il_flags);
proto_tree_add_boolean(flags_tree, hf_interlink_flags_inc_ack_port, tvb, offset, 2, il_flags);
}
}
offset += 2;
if (tree) {
proto_item *ilb_item;
ilb_item = proto_tree_add_text(il_tree, tvb, offset, 4, "Block Header");
if (ilb_item)
ilb_tree = proto_item_add_subtree(ilb_item, ett_interlink_block);
}
ilb_type = tvb_get_guint8(tvb, offset);
ilb_version = tvb_get_guint8(tvb, offset + 1);
type_version = ilb_type << 8 | ilb_version;
col_append_fstr(pinfo->cinfo, COL_INFO, "Type: 0x%02x, Version: %d",
ilb_type, ilb_version);
if (ilb_tree) {
proto_tree_add_item(ilb_tree, hf_interlink_block_type, tvb, offset, 1, FALSE);
offset += 1;
proto_tree_add_item(ilb_tree, hf_interlink_block_version, tvb, offset, 1, FALSE);
offset += 1;
proto_tree_add_item(ilb_tree, hf_interlink_block_length, tvb, offset, 2, TRUE);
offset += 2;
} else {
offset += 4;
}
/* Generate a new tvb for the rest. */
next_tvb = tvb_new_subset_remaining(tvb, offset);
/* Probably a sub-dissector exists for this type/version combination. */
handle = dissector_get_port_handle(subdissector_table, type_version);
/* Without a proper sub-dissector, we use "data". */
if (handle == NULL) handle = data_handle;
/* Call the sub-dissector. */
call_dissector(handle, next_tvb, pinfo, tree);
}
开发者ID:AkhilaAG,项目名称:gluster-wireshark-1.4,代码行数:98,代码来源:packet-interlink.c
示例14: dissect_omapi
static void
dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ti;
proto_tree *omapi_tree;
ptvcursor_t* cursor;
guint32 authlength;
guint32 msglength;
guint32 objlength;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "OMAPI");
col_clear(pinfo->cinfo, COL_INFO);
ti = proto_tree_add_item(tree, proto_omapi, tvb, 0, -1, ENC_NA);
omapi_tree = proto_item_add_subtree(ti, ett_omapi);
cursor = ptvcursor_new(omapi_tree, tvb, 0);
if (tvb_reported_length_remaining(tvb, 0) < 8)
{
/* Payload too small for OMAPI */
DISSECTOR_ASSERT_NOT_REACHED();
}
else if (tvb_reported_length_remaining(tvb, 0) < 24)
{
/* This is a startup message */
ptvcursor_add(cursor, hf_omapi_version, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_omapi_hlength, 4, ENC_BIG_ENDIAN);
col_set_str(pinfo->cinfo, COL_INFO, "Status message");
proto_item_append_text(ti, ", Status message");
return;
}
else if ( !(tvb_get_ntohl(tvb, 8) || tvb_get_ntohl(tvb, 12)) )
{
/* This is a startup message, and more */
ptvcursor_add(cursor, hf_omapi_version, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_omap
|
请发表评论