#include "config.h"
#endif
-#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
-#include <string.h>
#include <glib.h>
#include <epan/packet.h>
static int ett_pcli = -1;
-/*
+/*
* Here are the global variables associated with the preferences
* for pcli
*/
/* A static handle for the ip dissector */
static dissector_handle_t ip_handle;
-static void
+static void
dissect_pcli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
-
+
guint32 cccid;
proto_tree *ti,*pcli_tree;
tvbuff_t * next_tvb;
/* Set the protocol column */
- if(check_col(pinfo->cinfo,COL_PROTOCOL)){
- col_add_str(pinfo->cinfo,COL_PROTOCOL,"PCLI");
- }
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "PCLI");
/* Get the CCCID */
cccid = tvb_get_ntohl(tvb,0);
col_add_fstr(pinfo->cinfo, COL_INFO, "CCCID: %u",cccid);
}
- /*
+ /*
*If we have a non-null tree (ie we are building the proto_tree
* instead of just filling out the columns ), then add a PLCI
* tree node and put a CCCID header element under it.
*/
if(tree) {
- ti = proto_tree_add_item(tree,proto_pcli,tvb,0,0,FALSE);
+ ti = proto_tree_add_item(tree,proto_pcli,tvb,0,0,ENC_NA);
pcli_tree = proto_item_add_subtree(ti,ett_pcli);
proto_tree_add_uint(pcli_tree,hf_pcli_cccid,tvb,
0,4,cccid);
/*
* Hand off to the IP dissector.
*/
- next_tvb = tvb_new_subset(tvb,4,-1,-1);
+ next_tvb = tvb_new_subset_remaining(tvb,4);
call_dissector(ip_handle,next_tvb,pinfo,tree);
}
-void
+void
proto_register_pcli(void) {
static hf_register_info hf[] = {
{ &hf_pcli_cccid,
ip_handle = find_dissector("ip");
pcli_initialized = TRUE;
} else {
- dissector_delete("udp.port",udp_port_pcli,pcli_handle);
+ dissector_delete_uint("udp.port",udp_port_pcli,pcli_handle);
}
udp_port_pcli = global_udp_port_pcli;
-
- dissector_add("udp.port",global_udp_port_pcli,pcli_handle);
+
+ dissector_add_uint("udp.port",global_udp_port_pcli,pcli_handle);
}