2 * Routines for Packet Cable Lawful Intercept packet disassembly
3 * Packet Cable Lawful Intercept is detailed at
4 * http://www.cablelabs.com/specifications/archives/PKT-SP-ESP-I01-991229.pdf
5 * Chapter 4 ( Call Content Connection Interface )
9 * Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1999 Gerald Combs
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
38 #include <epan/packet.h>
39 #include <epan/addr_resolv.h>
40 #include <epan/prefs.h>
41 #include <epan/strutil.h>
43 /* Define udp_port for lawful intercept */
45 #define UDP_PORT_PCLI 9000
47 void proto_reg_handoff_pcli(void);
49 /* Define the pcli proto */
51 static int proto_pcli = -1;
53 /* Define headers for pcli */
55 static int hf_pcli_cccid = -1;
57 /* Define the tree for pcli */
59 static int ett_pcli = -1;
62 * Here are the global variables associated with the preferences
66 static guint global_udp_port_pcli = UDP_PORT_PCLI;
68 /* A static handle for the ip dissector */
69 static dissector_handle_t ip_handle;
72 dissect_pcli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
75 proto_tree *ti,*pcli_tree;
78 /* Set the protocol column */
79 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PCLI");
82 cccid = tvb_get_ntohl(tvb,0);
84 /* Set the info column */
85 if(check_col(pinfo->cinfo,COL_INFO)){
86 col_add_fstr(pinfo->cinfo, COL_INFO, "CCCID: %u",cccid);
90 *If we have a non-null tree (ie we are building the proto_tree
91 * instead of just filling out the columns ), then add a PLCI
92 * tree node and put a CCCID header element under it.
95 ti = proto_tree_add_item(tree,proto_pcli,tvb,0,0,ENC_NA);
96 pcli_tree = proto_item_add_subtree(ti,ett_pcli);
97 proto_tree_add_uint(pcli_tree,hf_pcli_cccid,tvb,
102 * Hand off to the IP dissector.
104 next_tvb = tvb_new_subset_remaining(tvb,4);
105 call_dissector(ip_handle,next_tvb,pinfo,tree);
109 proto_register_pcli(void) {
110 static hf_register_info hf[] = {
112 { "CCCID", "pcli.cccid", FT_UINT32, BASE_DEC, NULL, 0x0,
113 "Call Content Connection Identifier", HFILL }},
116 static gint *ett[] = {
120 module_t *pcli_module;
122 proto_pcli = proto_register_protocol("Packet Cable Lawful Intercept",
124 proto_register_field_array(proto_pcli,hf,array_length(hf));
125 proto_register_subtree_array(ett,array_length(ett));
127 pcli_module = prefs_register_protocol(proto_pcli,
128 proto_reg_handoff_pcli);
129 prefs_register_uint_preference(pcli_module, "udp_port",
131 "The UDP port on which "
132 "Packet Cable Lawful Intercept "
133 "packets will be sent",
134 10,&global_udp_port_pcli);
138 /* The registration hand-off routing */
141 proto_reg_handoff_pcli(void) {
142 static gboolean pcli_initialized = FALSE;
143 static dissector_handle_t pcli_handle;
144 static guint udp_port_pcli;
146 if(!pcli_initialized) {
147 pcli_handle = create_dissector_handle(dissect_pcli,proto_pcli);
148 ip_handle = find_dissector("ip");
149 pcli_initialized = TRUE;
151 dissector_delete_uint("udp.port",udp_port_pcli,pcli_handle);
154 udp_port_pcli = global_udp_port_pcli;
156 dissector_add_uint("udp.port",global_udp_port_pcli,pcli_handle);