827c6a78690ac6094f04093b56d5ae5513e1c329
[obnox/wireshark/wip.git] / plugins / docsis / packet-bpkmattr.c
1 /* packet-bpkmattr.c
2  * Routines for Baseline Privacy Key Management Attributes dissection
3  * Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
4  *
5  * $Id: packet-bpkmattr.c,v 1.6 2003/09/09 07:17:00 guy Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
29
30 #include "plugins/plugin_api.h"
31 #include "plugins/plugin_api_defs.h"
32 #include "moduleinfo.h"
33
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <string.h>
37
38 #include <gmodule.h>
39
40 #include <epan/packet.h>
41
42 /* BPKM Attributes defined in:
43  * http://www.cablemodem.com/downloads/specs/SP-BPI+_I10-030730.pdf
44  */
45 #define BPKM_RESERVED 0
46 #define BPKM_SERIAL_NUM 1
47 #define BPKM_MANUFACTURER_ID 2
48 #define BPKM_MAC_ADDR 3
49 #define BPKM_RSA_PUB_KEY 4
50 #define BPKM_CM_ID 5
51 #define BPKM_DISPLAY_STR 6
52 #define BPKM_AUTH_KEY 7
53 #define BPKM_TEK 8
54 #define BPKM_KEY_LIFETIME 9
55 #define BPKM_KEY_SEQ_NUM 10
56 #define BPKM_HMAC_DIGEST 11
57 #define BPKM_SAID 12
58 #define BPKM_TEK_PARAM 13
59 #define BPKM_OBSOLETED 14
60 #define BPKM_CBC_IV 15
61 #define BPKM_ERROR_CODE 16
62 #define BPKM_CA_CERT 17
63 #define BPKM_CM_CERT 18
64 #define BPKM_SEC_CAPABILITIES 19
65 #define BPKM_CRYPTO_SUITE 20
66 #define BPKM_CRYPTO_SUITE_LIST 21
67 #define BPKM_BPI_VERSION 22
68 #define BPKM_SA_DESCRIPTOR 23
69 #define BPKM_SA_TYPE 24
70 #define BPKM_SA_QUERY 25
71 #define BPKM_SA_QUERY_TYPE 26
72 #define BPKM_IP_ADDRESS 27
73 #define BPKM_DNLD_PARAMS 28
74 #define BPKM_VENDOR_DEFINED 127
75
76 /* Initialize the protocol and registered fields */
77 static int proto_docsis_bpkmattr = -1;
78 static int hf_docsis_bpkmattr = -1;
79 static int hf_docsis_bpkmattr_serial_num = -1;
80 static int hf_docsis_bpkmattr_manf_id = -1;
81 static int hf_docsis_bpkmattr_mac_addr = -1;
82 static int hf_docsis_bpkmattr_rsa_pub_key = -1;
83 static int hf_docsis_bpkmattr_cm_id = -1;
84 static int hf_docsis_bpkmattr_display_str = -1;
85 static int hf_docsis_bpkmattr_auth_key = -1;
86 static int hf_docsis_bpkmattr_tek = -1;
87 static int hf_docsis_bpkmattr_key_life = -1;
88 static int hf_docsis_bpkmattr_key_seq = -1;
89 static int hf_docsis_bpkmattr_hmac_digest = -1;
90 static int hf_docsis_bpkmattr_said = -1;
91 static int hf_docsis_bpkmattr_tek_params = -1;
92 static int hf_docsis_bpkmattr_cbc_iv = -1;
93 static int hf_docsis_bpkmattr_error_code = -1;
94 static int hf_docsis_bpkmattr_vendor_def = -1;
95 static int hf_docsis_bpkmattr_ca_cert = -1;
96 static int hf_docsis_bpkmattr_cm_cert = -1;
97 static int hf_docsis_bpkmattr_security_cap = -1;
98 static int hf_docsis_bpkmattr_crypto_suite = -1;
99 static int hf_docsis_bpkmattr_crypto_suite_list = -1;
100 static int hf_docsis_bpkmattr_bpi_version = -1;
101 static int hf_docsis_bpkmattr_sa_descr = -1;
102 static int hf_docsis_bpkmattr_sa_type = -1;
103 static int hf_docsis_bpkmattr_sa_query = -1;
104 static int hf_docsis_bpkmattr_sa_query_type = -1;
105 static int hf_docsis_bpkmattr_ip_address = -1;
106 static int hf_docsis_bpkmattr_download_param = -1;
107
108
109
110 /* Initialize the subtree pointers */
111 static gint ett_docsis_bpkmattr = -1;
112 static gint ett_docsis_bpkmattr_cmid = -1;
113 static gint ett_docsis_bpkmattr_scap = -1;
114 static gint ett_docsis_bpkmattr_tekp = -1;
115 static gint ett_docsis_bpkmattr_sadsc = -1;
116 static gint ett_docsis_bpkmattr_saqry = -1;
117 static gint ett_docsis_bpkmattr_dnld = -1;
118
119
120 static const value_string error_code_vals[] = {
121   {0, "no information"},
122   {1, "Unauthorized CM"},
123   {2, "Unauthorized SAID"},
124   {3, "Unsolicited"},
125   {4, "Invalid Key Sequence Number"},
126   {5, "Key Request authentication failure"},
127   {6, "Permanent Authorization Failure"},
128   {7, "Not authorized for requested downstream traffic flow"},
129   {8, "Downstream traffic flow not mapped to BPI+ SAID"},
130   {9, "Time of day not acquired"},
131   {0, NULL},
132 };
133
134 static const value_string crypto_suite_attr_vals[] = {
135   {0x0100, "CBC Mode, 56 Bit DES & no Data Authentication"},
136   {0x0200, "CBC Mode, 40 Bit DES & no Data Authentication"},
137   {0, NULL},
138 };
139
140 static const value_string bpi_ver_vals[] = {
141   {0, "Reserved"},
142   {1, "BPI+"},
143   {0, NULL},
144 };
145
146 /* Code to actually dissect the packets */
147
148 /* The dissect_attrs() function does the actual work to dissect the
149  * attributes.  It's called recursively, to dissect embedded attributes
150  */
151 static void
152 dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
153 {
154   guint8 type;
155   guint16 length;
156   guint16 pos = 0;
157   guint16 total_len;
158   proto_item *cmid_it, *tekp_it, *scap_it;
159   proto_item *saqry_it, *dnld_it, *sadsc_it;
160   proto_tree *cmid_tree, *tekp_tree, *scap_tree;
161   proto_tree *saqry_tree, *dnld_tree, *sadsc_tree;
162   tvbuff_t *cmid_tvb, *tekp_tvb, *scap_tvb;
163   tvbuff_t *saqry_tvb, *dnld_tvb, *sadsc_tvb;
164
165   total_len = tvb_length_remaining (tvb, 0);
166   while (pos < total_len)
167     {
168       type = tvb_get_guint8 (tvb, pos++);
169       length = tvb_get_ntohs (tvb, pos);
170       pos += 2;
171       switch (type)
172         {
173         case BPKM_RESERVED:
174           break;
175         case BPKM_SERIAL_NUM:
176           proto_tree_add_item (tree, hf_docsis_bpkmattr_serial_num, tvb, pos,
177                                length, FALSE);
178           break;
179         case BPKM_MANUFACTURER_ID:
180           if (length == 3)
181             proto_tree_add_item (tree, hf_docsis_bpkmattr_manf_id, tvb, pos,
182                                  length, FALSE);
183           else
184             THROW (ReportedBoundsError);
185           break;
186         case BPKM_MAC_ADDR:
187           if (length == 6)
188             proto_tree_add_item (tree, hf_docsis_bpkmattr_mac_addr, tvb, pos,
189                                  length, FALSE);
190           else
191             THROW (ReportedBoundsError);
192           break;
193         case BPKM_RSA_PUB_KEY:
194           proto_tree_add_item (tree, hf_docsis_bpkmattr_rsa_pub_key, tvb, pos,
195                                length, FALSE);
196           break;
197         case BPKM_CM_ID:
198           cmid_it =
199             proto_tree_add_text (tree, tvb, pos, length,
200                                  "5 CM Identification");
201           cmid_tree =
202             proto_item_add_subtree (cmid_it, ett_docsis_bpkmattr_cmid);
203           cmid_tvb = tvb_new_subset (tvb, pos, length, length);
204           dissect_attrs (cmid_tvb, pinfo, cmid_tree);
205           break;
206         case BPKM_DISPLAY_STR:
207           proto_tree_add_item (tree, hf_docsis_bpkmattr_display_str, tvb, pos,
208                                length, FALSE);
209           break;
210         case BPKM_AUTH_KEY:
211           if ((length == 96) || (length == 128))
212             proto_tree_add_item (tree, hf_docsis_bpkmattr_auth_key, tvb, pos,
213                                  length, FALSE);
214           else
215             THROW (ReportedBoundsError);
216           break;
217         case BPKM_TEK:
218           if (length == 8)
219             proto_tree_add_item (tree, hf_docsis_bpkmattr_tek, tvb, pos,
220                                  length, FALSE);
221           else
222             THROW (ReportedBoundsError);
223           break;
224         case BPKM_KEY_LIFETIME:
225           if (length == 4)
226             proto_tree_add_item (tree, hf_docsis_bpkmattr_key_life, tvb, pos,
227                                  length, FALSE);
228           else
229             THROW (ReportedBoundsError);
230           break;
231         case BPKM_KEY_SEQ_NUM:
232           if (length == 1)
233             proto_tree_add_item (tree, hf_docsis_bpkmattr_key_seq, tvb, pos,
234                                  length, FALSE);
235           else
236             THROW (ReportedBoundsError);
237           break;
238         case BPKM_HMAC_DIGEST:
239           if (length == 20)
240             proto_tree_add_item (tree, hf_docsis_bpkmattr_hmac_digest, tvb,
241                                  pos, length, FALSE);
242           else
243             THROW (ReportedBoundsError);
244           break;
245         case BPKM_SAID:
246           if (length == 2)
247             proto_tree_add_item (tree, hf_docsis_bpkmattr_said, tvb, pos,
248                                  length, FALSE);
249           else
250             THROW (ReportedBoundsError);
251           break;
252         case BPKM_TEK_PARAM:
253           tekp_it =
254             proto_tree_add_text (tree, tvb, pos, length, "13 TEK Parameters");
255           tekp_tree =
256             proto_item_add_subtree (tekp_it, ett_docsis_bpkmattr_tekp);
257           tekp_tvb = tvb_new_subset (tvb, pos, length, length);
258           dissect_attrs (tekp_tvb, pinfo, tekp_tree);
259           break;
260         case BPKM_OBSOLETED:
261           break;
262         case BPKM_CBC_IV:
263           if (length == 8)
264             proto_tree_add_item (tree, hf_docsis_bpkmattr_cbc_iv, tvb, pos,
265                                  length, FALSE);
266           else
267             THROW (ReportedBoundsError);
268           break;
269         case BPKM_ERROR_CODE:
270           if (length == 1)
271             proto_tree_add_item (tree, hf_docsis_bpkmattr_error_code, tvb,
272                                  pos, length, FALSE);
273           else
274             THROW (ReportedBoundsError);
275           break;
276         case BPKM_CA_CERT:
277           proto_tree_add_item (tree, hf_docsis_bpkmattr_ca_cert, tvb, pos,
278                                length, FALSE);
279           break;
280         case BPKM_CM_CERT:
281           proto_tree_add_item (tree, hf_docsis_bpkmattr_cm_cert, tvb, pos,
282                                length, FALSE);
283           break;
284         case BPKM_SEC_CAPABILITIES:
285           scap_it =
286             proto_tree_add_text (tree, tvb, pos, length,
287                                  "19 Security Capabilities");
288           scap_tree =
289             proto_item_add_subtree (scap_it, ett_docsis_bpkmattr_scap);
290           scap_tvb = tvb_new_subset (tvb, pos, length, length);
291           dissect_attrs (scap_tvb, pinfo, scap_tree);
292           break;
293         case BPKM_CRYPTO_SUITE:
294           if (length == 2)
295             proto_tree_add_item (tree, hf_docsis_bpkmattr_crypto_suite, tvb,
296                                  pos, length, FALSE);
297           else
298             THROW (ReportedBoundsError);
299           break;
300         case BPKM_CRYPTO_SUITE_LIST:
301           proto_tree_add_item (tree, hf_docsis_bpkmattr_crypto_suite_list,
302                                tvb, pos, length, FALSE);
303           break;
304         case BPKM_BPI_VERSION:
305           if (length == 1)
306             proto_tree_add_item (tree, hf_docsis_bpkmattr_bpi_version, tvb,
307                                  pos, length, FALSE);
308           else
309             THROW (ReportedBoundsError);
310           break;
311         case BPKM_SA_DESCRIPTOR:
312           sadsc_it =
313             proto_tree_add_text (tree, tvb, pos, length, "23 SA Descriptor");
314           sadsc_tree =
315             proto_item_add_subtree (sadsc_it, ett_docsis_bpkmattr_sadsc);
316           sadsc_tvb = tvb_new_subset (tvb, pos, length, length);
317           dissect_attrs (sadsc_tvb, pinfo, sadsc_tree);
318           break;
319         case BPKM_SA_TYPE:
320           if (length == 1)
321             proto_tree_add_item (tree, hf_docsis_bpkmattr_sa_type, tvb, pos,
322                                  length, FALSE);
323           else
324             THROW (ReportedBoundsError);
325           break;
326         case BPKM_SA_QUERY:
327           saqry_it =
328             proto_tree_add_text (tree, tvb, pos, length, "25 SA Query");
329           saqry_tree =
330             proto_item_add_subtree (saqry_it, ett_docsis_bpkmattr_saqry);
331           saqry_tvb = tvb_new_subset (tvb, pos, length, length);
332           dissect_attrs (saqry_tvb, pinfo, saqry_tree);
333           break;
334         case BPKM_SA_QUERY_TYPE:
335           if (length == 1)
336             proto_tree_add_item (tree, hf_docsis_bpkmattr_sa_query_type, tvb,
337                                  pos, length, FALSE);
338           else
339             THROW (ReportedBoundsError);
340           break;
341         case BPKM_IP_ADDRESS:
342           if (length == 4)
343             proto_tree_add_item (tree, hf_docsis_bpkmattr_ip_address, tvb,
344                                  pos, length, FALSE);
345           else
346             THROW (ReportedBoundsError);
347           break;
348         case BPKM_VENDOR_DEFINED:
349           proto_tree_add_item (tree, hf_docsis_bpkmattr_vendor_def, tvb, pos,
350                                length, FALSE);
351         case BPKM_DNLD_PARAMS:
352           dnld_it =
353             proto_tree_add_text (tree, tvb, pos, length,
354                                  "28 Download Parameters");
355           dnld_tree =
356             proto_item_add_subtree (dnld_it, ett_docsis_bpkmattr_dnld);
357           dnld_tvb = tvb_new_subset (tvb, pos, length, length);
358           dissect_attrs (dnld_tvb, pinfo, dnld_tree);
359           break;
360         default:
361           proto_tree_add_item (tree, hf_docsis_bpkmattr_vendor_def, tvb, pos,
362                                length, FALSE);
363           break;
364         }
365       pos += length;            /* switch */
366     }                           /* while */
367 }
368
369 static void
370 dissect_bpkmattr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
371 {
372
373   proto_item *it;
374   proto_tree *bpkmattr_tree;
375
376   if (tree)
377     {
378       it =
379         proto_tree_add_protocol_format (tree, proto_docsis_bpkmattr, tvb, 0,
380                                         tvb_length_remaining (tvb, 0),
381                                         "BPKM Attributes");
382       bpkmattr_tree = proto_item_add_subtree (it, ett_docsis_bpkmattr);
383       dissect_attrs (tvb, pinfo, bpkmattr_tree);
384     }
385
386 }
387
388
389
390 /* Register the protocol with Ethereal */
391
392 /* this format is require because a script is used to build the C function
393    that calls all the protocol registration.
394 */
395
396
397 void
398 proto_register_docsis_bpkmattr (void)
399 {
400
401 /* Setup list of header fields  See Section 1.6.1 for details*/
402   static hf_register_info hf[] = {
403     {&hf_docsis_bpkmattr,
404      {"BPKM Attributes", "docsis.bpkmattr",
405       FT_BYTES, BASE_HEX, NULL, 0x0,
406       "BPKM Attributes", HFILL}
407      },
408     {&hf_docsis_bpkmattr_serial_num,
409      {"1 Serial Number", "docsis.bpkmattr.serialnum",
410       FT_STRING, BASE_DEC, NULL, 0x0,
411       "Serial Number", HFILL}
412      },
413     {&hf_docsis_bpkmattr_manf_id,
414      {"2 Manufacturer Id", "docsis.bpkmattr.manfid",
415       FT_BYTES, BASE_HEX, NULL, 0x0,
416       "Manufacturer Id", HFILL}
417      },
418     {&hf_docsis_bpkmattr_mac_addr,
419      {"3 Mac Address", "docsis.bpkmattr.macaddr",
420       FT_ETHER, BASE_HEX, NULL, 0x0,
421       "Mac Address", HFILL}
422      },
423     {&hf_docsis_bpkmattr_rsa_pub_key,
424      {"4 RSA Public Key", "docsis.bpkmattr.rsa_pub_key",
425       FT_BYTES, BASE_HEX, NULL, 0x0,
426       "RSA Public Key", HFILL}
427      },
428     {&hf_docsis_bpkmattr_cm_id,
429      {"5 CM Identification", "docsis.bpkmattr.cmid",
430       FT_BYTES, BASE_HEX, NULL, 0x0,
431       "CM Identification", HFILL}
432      },
433     {&hf_docsis_bpkmattr_display_str,
434      {"6 Display String", "docsis.bpkmattr.dispstr",
435       FT_STRING, BASE_DEC, NULL, 0x0,
436       "Display String", HFILL}
437      },
438     {&hf_docsis_bpkmattr_auth_key,
439      {"7 Auth Key", "docsis.bpkmattr.auth_key",
440       FT_BYTES, BASE_HEX, NULL, 0x0,
441       "Auth Key", HFILL}
442      },
443     {&hf_docsis_bpkmattr_tek,
444      {"8 Traffic Encryption Key", "docsis.bpkmattr.tek",
445       FT_BYTES, BASE_HEX, NULL, 0x0,
446       "Traffic Encryption Key", HFILL}
447      },
448     {&hf_docsis_bpkmattr_key_life,
449      {"9 Key Lifetime (s)", "docsis.bpkmattr.keylife",
450       FT_UINT32, BASE_DEC, NULL, 0x0,
451       "Key Lifetime (s)", HFILL}
452      },
453     {&hf_docsis_bpkmattr_key_seq,
454      {"10 Key Sequence Number", "docsis.bpkmattr.keyseq",
455       FT_UINT8, BASE_DEC, NULL, 0x0,
456       "Key Sequence Number", HFILL}
457      },
458     {&hf_docsis_bpkmattr_hmac_digest,
459      {"11 HMAC Digest", "docsis.bpkmattr.hmacdigest",
460       FT_BYTES, BASE_HEX, NULL, 0x0,
461       "HMAC Digest", HFILL}
462      },
463     {&hf_docsis_bpkmattr_said,
464      {"12 SAID", "docsis.bpkmattr.said",
465       FT_UINT16, BASE_DEC, NULL, 0x0,
466       "Security Association ID", HFILL}
467      },
468     {&hf_docsis_bpkmattr_tek_params,
469      {"13 TEK Parameters", "docsis.bpkmattr.tekparams",
470       FT_BYTES, BASE_HEX, NULL, 0x0,
471       "TEK Parameters", HFILL}
472      },
473     {&hf_docsis_bpkmattr_cbc_iv,
474      {"14 CBC IV", "docsis.bpkmattr.cbciv",
475       FT_BYTES, BASE_HEX, NULL, 0x0,
476       "Cypher Block Chaining", HFILL}
477      },
478     {&hf_docsis_bpkmattr_error_code,
479      {"16 Error Code", "docsis.bpkmattr.errcode",
480       FT_UINT8, BASE_DEC, VALS (error_code_vals), 0x0,
481       "Error Code", HFILL}
482      },
483     {&hf_docsis_bpkmattr_vendor_def,
484      {"127 Vendor Defined", "docsis.bpkmattr.vendordef",
485       FT_BYTES, BASE_HEX, NULL, 0x0,
486       "Vendor Defined", HFILL}
487      },
488     {&hf_docsis_bpkmattr_ca_cert,
489      {"17 CA Certificate", "docsis.bpkmattr.cacert",
490       FT_BYTES, BASE_HEX, NULL, 0x0,
491       "CA Certificate", HFILL}
492      },
493     {&hf_docsis_bpkmattr_cm_cert,
494      {"18 CM Certificate", "docsis.bpkmattr.cmcert",
495       FT_BYTES, BASE_HEX, NULL, 0x0,
496       "CM Certificate", HFILL}
497      },
498     {&hf_docsis_bpkmattr_security_cap,
499      {"19 Security Capabilities", "docsis.bpkmattr.seccap",
500       FT_BYTES, BASE_HEX, NULL, 0x0,
501       "Security Capabilities", HFILL}
502      },
503     {&hf_docsis_bpkmattr_crypto_suite,
504      {"20 Cryptographic Suite", "docsis.bpkmattr.cryptosuite",
505       FT_UINT16, BASE_HEX, VALS(crypto_suite_attr_vals), 0x0,
506       "Cryptographic Suite", HFILL}
507      },
508     {&hf_docsis_bpkmattr_crypto_suite_list,
509      {"21 Cryptographic Suite List", "docsis.bpkmattr.crypto_suite_lst",
510       FT_BYTES, BASE_HEX, NULL, 0x0,
511       "Cryptographic Suite", HFILL}
512      },
513     {&hf_docsis_bpkmattr_bpi_version,
514      {"22 BPI Version", "docsis.bpkmattr.bpiver",
515       FT_UINT8, BASE_DEC, VALS (bpi_ver_vals), 0x0,
516       "BPKM Attributes", HFILL}
517      },
518     {&hf_docsis_bpkmattr_sa_descr,
519      {"23 SA Descriptor", "docsis.bpkmattr.sadescr",
520       FT_BYTES, BASE_HEX, NULL, 0x0,
521       "SA Descriptor", HFILL}
522      },
523     {&hf_docsis_bpkmattr_sa_type,
524      {"24 SA Type", "docsis.bpkmattr.satype",
525       FT_UINT8, BASE_DEC, NULL, 0x0,
526       "SA Type", HFILL}
527      },
528     {&hf_docsis_bpkmattr_sa_query,
529      {"25 SA Query", "docsis.bpkmattr.saquery",
530       FT_BYTES, BASE_HEX, NULL, 0x0,
531       "SA Query", HFILL}
532      },
533     {&hf_docsis_bpkmattr_sa_query_type,
534      {"26 SA Query Type", "docsis.bpkmattr.saquery_type",
535       FT_UINT8, BASE_HEX, NULL, 0x0,
536       "SA Query Type", HFILL}
537      },
538     {&hf_docsis_bpkmattr_ip_address,
539      {"27 IP Address", "docsis.bpkmattr.ipaddr",
540       FT_IPv4, BASE_DEC, NULL, 0x0,
541       "IP Address", HFILL}
542      },
543     {&hf_docsis_bpkmattr_download_param,
544      {"28 Download Parameters", "docsis.bpkmattr.dnld_params",
545       FT_BYTES, BASE_HEX, NULL, 0x0,
546       "Download Parameters", HFILL}
547      },
548   };
549
550 /* Setup protocol subtree array */
551   static gint *ett[] = {
552     &ett_docsis_bpkmattr,
553     &ett_docsis_bpkmattr_cmid,
554     &ett_docsis_bpkmattr_scap,
555     &ett_docsis_bpkmattr_tekp,
556     &ett_docsis_bpkmattr_sadsc,
557     &ett_docsis_bpkmattr_saqry,
558     &ett_docsis_bpkmattr_dnld
559   };
560
561 /* Register the protocol name and description */
562   proto_docsis_bpkmattr =
563     proto_register_protocol
564     ("DOCSIS Baseline Privacy Key Management Attributes", "DOCSIS BPKM-ATTR",
565      "docsis_bpkmattr");
566
567 /* Required function calls to register the header fields and subtrees used */
568   proto_register_field_array (proto_docsis_bpkmattr, hf, array_length (hf));
569   proto_register_subtree_array (ett, array_length (ett));
570
571   register_dissector ("docsis_bpkmattr", dissect_bpkmattr,
572                       proto_docsis_bpkmattr);
573 }
574
575
576 /* If this dissector uses sub-dissector registration add a registration routine.
577    This format is required because a script is used to find these routines and
578    create the code that calls these routines.
579 */
580 void
581 proto_reg_handoff_docsis_bpkmattr (void)
582 {
583   dissector_handle_t docsis_bpkmattr_handle;
584
585   docsis_bpkmattr_handle = find_dissector ("docsis_bpkmattr");
586   dissector_add ("docsis", 0xFE, docsis_bpkmattr_handle);
587
588 }