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 )
7 * Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1999 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 #include <epan/packet.h>
35 #include <epan/addr_resolv.h>
36 #include <epan/prefs.h>
37 #include <epan/strutil.h>
39 void proto_register_pcli(void);
40 void proto_reg_handoff_pcli(void);
42 /* Define udp_port for lawful intercept */
44 #define UDP_PORT_PCLI 9000
46 /* Define the pcli proto */
48 static int proto_pcli = -1;
50 /* Define headers for pcli */
52 static int hf_pcli_cccid = -1;
54 /* Define the tree for pcli */
56 static int ett_pcli = -1;
59 * Here are the global variables associated with the preferences
63 static guint global_udp_port_pcli = UDP_PORT_PCLI;
65 /* A static handle for the ip dissector */
66 static dissector_handle_t ip_handle;
69 dissect_pcli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
72 proto_tree *ti,*pcli_tree;
75 /* Set the protocol column */
76 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PCLI");
79 cccid = tvb_get_ntohl(tvb,0);
81 /* Set the info column */
82 col_add_fstr(pinfo->cinfo, COL_INFO, "CCCID: %u",cccid);
85 *If we have a non-null tree (ie we are building the proto_tree
86 * instead of just filling out the columns ), then add a PLCI
87 * tree node and put a CCCID header element under it.
90 ti = proto_tree_add_item(tree, proto_pcli, tvb, 0, 0, ENC_NA);
91 pcli_tree = proto_item_add_subtree(ti,ett_pcli);
92 proto_tree_add_uint(pcli_tree, hf_pcli_cccid, tvb, 0, 4, cccid);
96 * Hand off to the IP dissector.
98 next_tvb = tvb_new_subset_remaining(tvb,4);
99 call_dissector(ip_handle,next_tvb,pinfo,tree);
103 proto_register_pcli(void) {
104 static hf_register_info hf[] = {
106 { "CCCID", "pcli.cccid", FT_UINT32, BASE_DEC, NULL, 0x0,
107 "Call Content Connection Identifier", HFILL }},
110 static gint *ett[] = {
114 module_t *pcli_module;
116 proto_pcli = proto_register_protocol("Packet Cable Lawful Intercept",
118 proto_register_field_array(proto_pcli,hf,array_length(hf));
119 proto_register_subtree_array(ett,array_length(ett));
121 pcli_module = prefs_register_protocol(proto_pcli, proto_reg_handoff_pcli);
122 prefs_register_uint_preference(pcli_module, "udp_port",
124 "The UDP port on which "
125 "Packet Cable Lawful Intercept "
126 "packets will be sent",
127 10,&global_udp_port_pcli);
131 /* The registration hand-off routing */
134 proto_reg_handoff_pcli(void) {
135 static gboolean pcli_initialized = FALSE;
136 static dissector_handle_t pcli_handle;
137 static guint udp_port_pcli;
139 if(!pcli_initialized) {
140 pcli_handle = create_dissector_handle(dissect_pcli,proto_pcli);
141 ip_handle = find_dissector("ip");
142 pcli_initialized = TRUE;
144 dissector_delete_uint("udp.port",udp_port_pcli,pcli_handle);
147 udp_port_pcli = global_udp_port_pcli;
149 dissector_add_uint("udp.port",global_udp_port_pcli,pcli_handle);
153 * Editor modelines - http://www.wireshark.org/tools/modelines.html
158 * indent-tabs-mode: nil
161 * vi: set shiftwidth=4 tabstop=8 expandtab:
162 * :indentSize=4:tabSize=8:noTabs=true: