2 * Routines for the COPS (Common Open Policy Service) protocol dissection
3 * RFC2748 & COPS-PR extension RFC3084
5 * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
7 * Added PacketCable D-QoS specifications by Dick Gooris <gooris@lucent.com>
9 * Taken from PacketCable specifications :
10 * PacketCable Dynamic Quality-of-Service Specification
11 * Based on PKT-SP-DQOS-I09-040402 (April 2, 2004)
13 * PacketCable Multimedia Specification
14 * Based on PKT-SP-MM-I02-040930
18 * Implemented in ethereal at April 7-8, 2004
22 * Ethereal - Network traffic analyzer
23 * By Gerald Combs <gerald@ethereal.com>
24 * Copyright 1998 Gerald Combs
26 * This program is free software; you can redistribute it and/or
27 * modify it under the terms of the GNU General Public License
28 * as published by the Free Software Foundation; either version 2
29 * of the License, or (at your option) any later version.
31 * This program is distributed in the hope that it will be useful,
32 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 * GNU General Public License for more details.
36 * You should have received a copy of the GNU General Public License
37 * along with this program; if not, write to the Free Software
38 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
42 * Some of the development of the COPS protocol decoder was sponsored by
43 * Cable Television Laboratories, Inc. ("CableLabs") based upon proprietary
44 * CableLabs' specifications. Your license and use of this protocol decoder
45 * does not mean that you are licensed to use the CableLabs'
46 * specifications. If you have questions about this protocol, contact
47 * jf.mule [AT] cablelabs.com or c.stuart [AT] cablelabs.com for additional
65 #include <epan/packet.h>
66 #include "packet-ipv6.h"
67 #include "packet-tcp.h"
71 # include <net-snmp/net-snmp-config.h>
72 # include <net-snmp/mib_api.h>
73 # include <net-snmp/library/default_store.h>
74 # include <net-snmp/config_api.h>
75 #else /* HAVE_NET_SNMP */
76 # include <ucd-snmp/ucd-snmp-config.h>
77 # include <ucd-snmp/asn1.h>
78 # include <ucd-snmp/snmp_api.h>
79 # include <ucd-snmp/snmp_impl.h>
80 # include <ucd-snmp/mib.h>
81 # include <ucd-snmp/default_store.h>
82 # include <ucd-snmp/read_config.h>
83 # include <ucd-snmp/tools.h>
84 #endif /* HAVE_NET_SNMP */
85 #endif /* HAVE_SOME_SNMP */
87 #include <epan/asn1.h>
88 #include "format-oid.h"
89 #include <epan/prefs.h>
90 #include <epan/emem.h>
92 /* XXX - The "plain" COPS port (3288) can be overridden in the prefs.
93 The PacketCable port cannot - should this be the case? */
94 #define TCP_PORT_COPS 3288
95 #define TCP_PORT_PKTCABLE_COPS 2126
96 #define TCP_PORT_PKTCABLE_MM_COPS 3918
98 /* Preference: Variable to hold the tcp port preference */
99 static guint global_cops_tcp_port = TCP_PORT_COPS;
101 /* Preference: desegmentation of COPS */
102 static gboolean cops_desegment = TRUE;
104 /* Variable to allow for proper deletion of dissector registration
105 * when the user changes port from the gui
108 static guint cops_tcp_port = 0;
110 /*Some local globals needed to read COPS-PR ASN.1 Types from PIB-MIBs */
111 /*MAX_OID_LEN from NET-SNMP's asn1.h*/
114 static subid_t last_decoded_prid_oid[MAX_OID_LEN]={0};
115 static subid_t last_decoded_prid_oid_length=0;
116 extern struct tree *tree_head;
118 /* Preference: COPS-PR ASN.1 type decoding based on PIB/MIB or data in packet */
119 static gboolean cops_typefrommib = FALSE;
121 #endif /* HAVE_NET_SNMP */
123 #define COPS_OBJECT_HDR_SIZE 4
125 /* Null string of type "guchar[]". */
126 static const guchar nullstring[] = "";
128 #define SAFE_STRING(s) (((s) != NULL) ? (s) : nullstring)
132 #define COPS_IPA 0 /* IP Address */
133 #define COPS_U32 2 /* Unsigned 32*/
134 #define COPS_TIT 3 /* TimeTicks */
135 #define COPS_OPQ 4 /* Opaque */
136 #define COPS_I64 10 /* Integer64 */
137 #define COPS_U64 11 /* Uinteger64 */
142 #define COPS_INTEGER 1 /* l */
143 #define COPS_OCTETSTR 2 /* c */
144 #define COPS_OBJECTID 3 /* ul */
145 #define COPS_IPADDR 4 /* uc */
146 #define COPS_UNSIGNED32 5 /* ul */
147 #define COPS_TIMETICKS 7 /* ul */
148 #define COPS_OPAQUE 8 /* c */
149 #define COPS_INTEGER64 10 /* ll */
150 #define COPS_UNSIGNED64 11 /* ull */
153 typedef struct _COPS_CNV COPS_CNV;
163 static COPS_CNV CopsCnv [] =
165 {ASN1_UNI, ASN1_NUL, COPS_NULL, "NULL"},
166 {ASN1_UNI, ASN1_INT, COPS_INTEGER, "INTEGER"},
167 {ASN1_UNI, ASN1_OTS, COPS_OCTETSTR, "OCTET STRING"},
168 {ASN1_UNI, ASN1_OJI, COPS_OBJECTID, "OBJECTID"},
169 {ASN1_APL, COPS_IPA, COPS_IPADDR, "IPADDR"},
170 {ASN1_APL, COPS_U32, COPS_UNSIGNED32,"UNSIGNED32"},
171 {ASN1_APL, COPS_TIT, COPS_TIMETICKS, "TIMETICKS"},
172 {ASN1_APL, COPS_OPQ, COPS_OPAQUE, "OPAQUE"},
173 {ASN1_APL, COPS_I64, COPS_INTEGER64, "INTEGER64"},
174 {ASN1_APL, COPS_U64, COPS_UNSIGNED64, "UNSIGNED64"},
179 cops_tag_cls2syntax ( guint tag, guint cls, gushort *syntax)
184 while (cnv->syntax != -1)
186 if (cnv->tag == tag && cnv->class == cls)
188 *syntax = cnv->syntax;
196 static const value_string cops_flags_vals[] = {
198 { 0x01, "Solicited Message Flag Bit" },
202 /* The different COPS message types */
204 COPS_NO_MSG, /* Not a COPS Message type */
206 COPS_MSG_REQ, /* Request (REQ) */
207 COPS_MSG_DEC, /* Decision (DEC) */
208 COPS_MSG_RPT, /* Report State (RPT) */
209 COPS_MSG_DRQ, /* Delete Request State (DRQ) */
210 COPS_MSG_SSQ, /* Synchronize State Req (SSQ) */
211 COPS_MSG_OPN, /* Client-Open (OPN) */
212 COPS_MSG_CAT, /* Client-Accept (CAT) */
213 COPS_MSG_CC, /* Client-Close (CC) */
214 COPS_MSG_KA, /* Keep-Alive (KA) */
215 COPS_MSG_SSC, /* Synchronize Complete (SSC) */
217 COPS_LAST_OP_CODE /* For error checking */
220 static const value_string cops_op_code_vals[] = {
221 { COPS_MSG_REQ, "Request (REQ)" },
222 { COPS_MSG_DEC, "Decision (DEC)" },
223 { COPS_MSG_RPT, "Report State (RPT)" },
224 { COPS_MSG_DRQ, "Delete Request State (DRQ)" },
225 { COPS_MSG_SSQ, "Synchronize State Req (SSQ)" },
226 { COPS_MSG_OPN, "Client-Open (OPN)" },
227 { COPS_MSG_CAT, "Client-Accept (CAT)" },
228 { COPS_MSG_CC, "Client-Close (CC)" },
229 { COPS_MSG_KA, "Keep-Alive (KA)" },
230 { COPS_MSG_SSC, "Synchronize Complete (SSC)" },
235 /* The different objects in COPS messages */
237 COPS_NO_OBJECT, /* Not a COPS Object type */
239 COPS_OBJ_HANDLE, /* Handle Object (Handle) */
240 COPS_OBJ_CONTEXT, /* Context Object (Context) */
241 COPS_OBJ_IN_INT, /* In-Interface Object (IN-Int) */
242 COPS_OBJ_OUT_INT, /* Out-Interface Object (OUT-Int) */
243 COPS_OBJ_REASON, /* Reason Object (Reason) */
244 COPS_OBJ_DECISION, /* Decision Object (Decision) */
245 COPS_OBJ_LPDPDECISION, /* LPDP Decision Object (LPDPDecision) */
246 COPS_OBJ_ERROR, /* Error Object (Error) */
247 COPS_OBJ_CLIENTSI, /* Client Specific Information Object (ClientSI) */
248 COPS_OBJ_KATIMER, /* Keep-Alive Timer Object (KATimer) */
249 COPS_OBJ_PEPID, /* PEP Identification Object (PEPID) */
250 COPS_OBJ_REPORT_TYPE, /* Report-Type Object (Report-Type) */
251 COPS_OBJ_PDPREDIRADDR, /* PDP Redirect Address Object (PDPRedirAddr) */
252 COPS_OBJ_LASTPDPADDR, /* Last PDP Address (LastPDPaddr) */
253 COPS_OBJ_ACCTTIMER, /* Accounting Timer Object (AcctTimer) */
254 COPS_OBJ_INTEGRITY, /* Message Integrity Object (Integrity) */
255 COPS_LAST_C_NUM /* For error checking */
258 static const value_string cops_c_num_vals[] = {
259 { COPS_OBJ_HANDLE, "Handle Object (Handle)" },
260 { COPS_OBJ_CONTEXT, "Context Object (Context)" },
261 { COPS_OBJ_IN_INT, "In-Interface Object (IN-Int)" },
262 { COPS_OBJ_OUT_INT, "Out-Interface Object (OUT-Int)" },
263 { COPS_OBJ_REASON, "Reason Object (Reason)" },
264 { COPS_OBJ_DECISION, "Decision Object (Decision)" },
265 { COPS_OBJ_LPDPDECISION, "LPDP Decision Object (LPDPDecision)" },
266 { COPS_OBJ_ERROR, "Error Object (Error)" },
267 { COPS_OBJ_CLIENTSI, "Client Specific Information Object (ClientSI)" },
268 { COPS_OBJ_KATIMER, "Keep-Alive Timer Object (KATimer)" },
269 { COPS_OBJ_PEPID, "PEP Identification Object (PEPID)" },
270 { COPS_OBJ_REPORT_TYPE, "Report-Type Object (Report-Type)" },
271 { COPS_OBJ_PDPREDIRADDR, "PDP Redirect Address Object (PDPRedirAddr)" },
272 { COPS_OBJ_LASTPDPADDR, "Last PDP Address (LastPDPaddr)" },
273 { COPS_OBJ_ACCTTIMER, "Accounting Timer Object (AcctTimer)" },
274 { COPS_OBJ_INTEGRITY, "Message Integrity Object (Integrity)" },
279 /* The different objects in COPS-PR messages */
281 COPS_NO_PR_OBJECT, /* Not a COPS-PR Object type */
282 COPS_OBJ_PRID, /* Provisioning Instance Identifier (PRID) */
283 COPS_OBJ_PPRID, /* Prefix Provisioning Instance Identifier (PPRID) */
284 COPS_OBJ_EPD, /* Encoded Provisioning Instance Data (EPD) */
285 COPS_OBJ_GPERR, /* Global Provisioning Error Object (GPERR) */
286 COPS_OBJ_CPERR, /* PRC Class Provisioning Error Object (CPERR) */
287 COPS_OBJ_ERRPRID, /* Error Provisioning Instance Identifier (ErrorPRID)*/
289 COPS_LAST_S_NUM /* For error checking */
293 static const value_string cops_s_num_vals[] = {
294 { COPS_OBJ_PRID, "Provisioning Instance Identifier (PRID)" },
295 { COPS_OBJ_PPRID, "Prefix Provisioning Instance Identifier (PPRID)" },
296 { COPS_OBJ_EPD, "Encoded Provisioning Instance Data (EPD)" },
297 { COPS_OBJ_GPERR, "Global Provisioning Error Object (GPERR)" },
298 { COPS_OBJ_CPERR, "PRC Class Provisioning Error Object (CPERR)" },
299 { COPS_OBJ_ERRPRID, "Error Provisioning Instance Identifier (ErrorPRID)" },
304 /* R-Type is carried within the Context Object */
305 static const value_string cops_r_type_vals[] = {
306 { 0x01, "Incoming-Message/Admission Control request" },
307 { 0x02, "Resource-Allocation request" },
308 { 0x04, "Outgoing-Message request" },
309 { 0x08, "Configuration request" },
312 /* S-Type is carried within the ClientSI Object for COPS-PR*/
313 static const value_string cops_s_type_vals[] = {
318 /* Reason-Code is carried within the Reason object */
319 static const value_string cops_reason_vals[] = {
320 { 1, "Unspecified" },
322 { 3, "Preempted (Another request state takes precedence)" },
323 { 4, "Tear (Used to communicate a signaled state removal)" },
324 { 5, "Timeout (Local state has timed-out)" },
325 { 6, "Route Change (Change invalidates request state)" },
326 { 7, "Insufficient Resources (No local resource available)" },
327 { 8, "PDP's Directive (PDP decision caused the delete)" },
328 { 9, "Unsupported decision (PDP decision not supported)" },
329 { 10, "Synchronize Handle Unknown" },
330 { 11, "Transient Handle (stateless event)" },
331 { 12, "Malformed Decision (could not recover)" },
332 { 13, "Unknown COPS Object from PDP" },
336 /* Command-Code is carried within the Decision object if C-Type is 1 */
337 static const value_string cops_dec_cmd_code_vals[] = {
338 { 0, "NULL Decision (No configuration data available)" },
339 { 1, "Install (Admit request/Install configuration)" },
340 { 2, "Remove (Remove request/Remove configuration)" },
344 /* Decision flags are also carried with the Decision object if C-Type is 1 */
345 static const value_string cops_dec_cmd_flag_vals[] = {
346 { 0x00, "<None set>" },
347 { 0x01, "Trigger Error (Trigger error message if set)" },
351 /* Error-Code from Error object */
352 static const value_string cops_error_vals[] = {
354 {2, "Invalid handle reference" },
355 {3, "Bad message format (Malformed Message)" },
356 {4, "Unable to process (server gives up on query)" },
357 {5, "Mandatory client-specific info missing" },
358 {6, "Unsupported client" },
359 {7, "Mandatory COPS object missing" },
360 {8, "Client Failure" },
361 {9, "Communication Failure" },
362 {10, "Unspecified" },
363 {11, "Shutting down" },
364 {12, "Redirect to Preferred Server" },
365 {13, "Unknown COPS Object" },
366 {14, "Authentication Failure" },
367 {15, "Authentication Required" },
370 /* Error-Code from GPERR object */
371 static const value_string cops_gperror_vals[] = {
373 {2, "AvailMemExhausted" },
374 {3, "unknownASN.1Tag" },
375 {4, "maxMsgSizeExceeded" },
376 {5, "unknownError" },
377 {6, "maxRequestStatesOpen" },
378 {7, "invalidASN.1Length" },
379 {8, "invalidObjectPad" },
380 {9, "unknownPIBData" },
381 {10, "unknownCOPSPRObject" },
382 {11, "malformedDecision" },
386 /* Error-Code from CPERR object */
387 static const value_string cops_cperror_vals[] = {
388 {1, "priSpaceExhausted" },
389 {2, "priInstanceInvalid" },
390 {3, "attrValueInvalid" },
391 {4, "attrValueSupLimited" },
392 {5, "attrEnumSupLimited" },
393 {6, "attrMaxLengthExceeded" },
394 {7, "attrReferenceUnknown" },
395 {8, "priNotifyOnly" },
397 {10, "tooFewAttrs" },
398 {11, "invalidAttrType" },
399 {12, "deletedInRef" },
400 {13, "priSpecificError" },
405 /* Report-Type from Report-Type object */
406 static const value_string cops_report_type_vals[] = {
407 {1, " Success : Decision was successful at the PEP" },
408 {2, " Failure : Decision could not be completed by PEP" },
409 {3, " Accounting: Accounting update for an installed state" },
414 /* Client-type descriptions */
415 /* http://www.iana.org/assignments/cops-parameters */
417 /* PacketCable Types */
419 /* static dissector_handle_t sdp_handle; */
421 #define COPS_CLIENT_PC_DQOS 0x8008
422 #define COPS_CLIENT_PC_MM 0x800a
424 static const value_string cops_client_type_vals[] = {
428 {0x8001, "IP Highway"},
429 {0x8002, "IP Highway"},
430 {0x8003, "IP Highway"},
431 {0x8004, "IP Highway"},
433 {0x8006, "HP OpenView PolicyXpert"},
434 {0x8007, "HP OpenView PolicyXpert"},
435 {COPS_CLIENT_PC_DQOS, "PacketCable Dynamic Quality-of-Service"},
437 {COPS_CLIENT_PC_MM, "PacketCable Multimedia"},
441 /* The next tables are for PacketCable */
443 /* Transaction ID table */
444 static const value_string table_cops_dqos_transaction_id[] =
446 { 0x1, "Gate Alloc" },
447 { 0x2, "Gate Alloc Ack" },
448 { 0x3, "Gate Alloc Err" },
450 { 0x5, "Gate Set Ack" },
451 { 0x6, "Gate Set Err" },
452 { 0x7, "Gate Info" },
453 { 0x8, "Gate Info Ack" },
454 { 0x9, "Gate Info Err" },
455 { 0xa, "Gate Delete" },
456 { 0xb, "Gate Delete Ack" },
457 { 0xc, "Gate Delete Err" },
458 { 0xd, "Gate Open" },
459 { 0xe, "Gate Close" },
464 static const value_string table_cops_direction[] =
466 { 0x0, "Downstream gate" },
467 { 0x1, "Upstream gate" },
472 static const value_string table_cops_session_class[] =
474 { 0x0, "Unspecified" },
475 { 0x1, "Normal priority VoIP session" },
476 { 0x2, "High priority VoIP session" },
482 static const value_string table_cops_reason_code[] =
484 { 0x0, "Gate Delete Operation" },
485 { 0x1, "Gate Close Operation" },
489 /* Reason Sub Code - Delete */
490 static const value_string table_cops_reason_subcode_delete[] =
492 { 0x0, "Normal Operation" },
493 { 0x1, "Local Gate-coordination not completed" },
494 { 0x2, "Remote Gate-coordination not completed" },
495 { 0x3, "Authorization revoked" },
496 { 0x4, "Unexpected Gate-Open" },
497 { 0x5, "Local Gate-Close failure" },
498 { 0x127,"Unspecified error" },
502 /* Reason Sub Code - Close */
503 static const value_string table_cops_reason_subcode_close[] =
505 { 0x0, "Client initiated release (normal operation)" },
506 { 0x1, "Reservation reassignment (e.g., for priority session)" },
507 { 0x2, "Lack of reservation maintenance (e.g., RSVP refreshes)" },
508 { 0x3, "Lack of Docsis Mac-layer responses (e.g., station maintenance)" },
509 { 0x4, "Timer T0 expiration; no Gate-Set received from CMS" },
510 { 0x5, "Timer T1 expiration; no Commit received from MTA" },
511 { 0x6, "Timer T7 expiration; Service Flow reservation timeout" },
512 { 0x7, "Timer T8 expiration; Service Flow inactivity in the upstream direction" },
513 { 0x127,"Unspecified error" },
517 /* PacketCable Error */
518 static const value_string table_cops_packetcable_error[] =
520 { 0x1, "No gates urrently available" },
521 { 0x2, "Unknown Gate ID" },
522 { 0x3, "Illegal Session Class value" },
523 { 0x4, "Subscriber exceeded gate limit" },
524 { 0x5, "Gate already set" },
525 { 0x6, "Missing Required Object" },
526 { 0x7, "Invalid Object" },
527 { 0x127,"Unspecified error" },
532 /* PacketCable Multimedia */
534 static const value_string table_cops_mm_transaction_id[] = {
542 {8, "Gate Info Ack"},
543 {9, "Gate Info Err"},
545 {11, "Gate Delete Ack"},
546 {12, "Gate Delete Err"},
549 {15, "Gate Report State"},
553 static const value_string pcmm_flow_spec_service_vals[] = {
554 {2, "Guaranteed Rate"},
555 {5, "Controlled Load"},
559 static const value_string pcmm_packetcable_error_code[] = {
560 {1, "Insufficient Resources"},
561 {2, "Unknown GateID"},
562 {6, "Missing Required Object"},
563 {7, "Invalid Object"},
564 {8, "Volume-Based Usage Limit Exceeded"},
565 {9, "Time-Based Usage Limit Exceeded"},
566 {10, "Session Class Limit Exceeded"},
567 {11, "Undefined Service Class Name"},
568 {12, "Incompatible Envelope"},
569 {13, "Invalid SubscriberID"},
570 {14, "Unauthorized AMID"},
571 {15, "Number of Classifiers Not Supported"},
572 {127, "Other, Unspecified Error"},
576 static const value_string pcmm_gate_state[] = {
581 {5, "Committed-Recovery"},
585 static const value_string pcmm_gate_state_reason[] = {
586 {1, "Close initiated by CMTS due to reservation reassignment"},
587 {2, "Close initiated by CMTS due to lack of DOCSIS MAC-layer responses"},
588 {3, "Close initiated by CMTS due to timer T1 expiration"},
589 {4, "Close initiated by CMTS due to timer T2 expiration"},
590 {5, "Inactivity timer expired due to Service Flow inactivity (timer T3 expiration)"},
591 {6, "Close initiated by CMTS due to lack of Reservation Maintenance"},
592 {7, "Gate state unchanged, but volume limit reached"},
593 {8, "Close initiated by CMTS due to timer T4 expiration"},
594 {9, "Gate state unchanged, but timer T2 expiration caused reservation reduction"},
600 /* End of PacketCable Tables */
603 /* Initialize the protocol and registered fields */
604 static gint proto_cops = -1;
605 static gint hf_cops_ver_flags = -1;
606 static gint hf_cops_version = -1;
607 static gint hf_cops_flags = -1;
609 static gint hf_cops_op_code = -1;
610 static gint hf_cops_client_type = -1;
611 static gint hf_cops_msg_len = -1;
613 static gint hf_cops_obj_len = -1;
614 static gint hf_cops_obj_c_num = -1;
615 static gint hf_cops_obj_c_type = -1;
617 static gint hf_cops_obj_s_num = -1;
618 static gint hf_cops_obj_s_type = -1;
620 static gint hf_cops_r_type_flags = -1;
621 static gint hf_cops_m_type_flags = -1;
623 static gint hf_cops_in_int_ipv4 = -1;
624 static gint hf_cops_in_int_ipv6 = -1;
625 static gint hf_cops_out_int_ipv4 = -1;
626 static gint hf_cops_out_int_ipv6 = -1;
627 static gint hf_cops_int_ifindex = -1;
629 static gint hf_cops_reason = -1;
630 static gint hf_cops_reason_sub = -1;
632 static gint hf_cops_dec_cmd_code = -1;
633 static gint hf_cops_dec_flags = -1;
635 static gint hf_cops_error = -1;
636 static gint hf_cops_error_sub = -1;
638 static gint hf_cops_gperror = -1;
639 static gint hf_cops_gperror_sub = -1;
641 static gint hf_cops_cperror = -1;
642 static gint hf_cops_cperror_sub = -1;
644 static gint hf_cops_katimer = -1;
646 static gint hf_cops_pepid = -1;
648 static gint hf_cops_report_type = -1;
650 static gint hf_cops_pdprediraddr_ipv4 = -1;
651 static gint hf_cops_pdprediraddr_ipv6 = -1;
652 static gint hf_cops_lastpdpaddr_ipv4 = -1;
653 static gint hf_cops_lastpdpaddr_ipv6 = -1;
654 static gint hf_cops_pdp_tcp_port = -1;
656 static gint hf_cops_accttimer = -1;
658 static gint hf_cops_key_id = -1;
659 static gint hf_cops_seq_num = -1;
661 /* For PacketCable D-QoS */
662 static gint hf_cops_subtree = -1;
663 static gint hf_cops_pc_activity_count = -1;
664 static gint hf_cops_pc_algorithm = -1;
665 static gint hf_cops_pc_close_subcode = -1;
666 static gint hf_cops_pc_cmts_ip = -1;
667 static gint hf_cops_pc_cmts_ip_port = -1;
668 static gint hf_cops_pc_prks_ip = -1;
669 static gint hf_cops_pc_prks_ip_port = -1;
670 static gint hf_cops_pc_srks_ip = -1;
671 static gint hf_cops_pc_srks_ip_port = -1;
672 static gint hf_cops_pc_delete_subcode = -1;
673 static gint hf_cops_pc_dest_ip = -1;
674 static gint hf_cops_pc_dest_port = -1;
675 static gint hf_cops_pc_direction = -1;
676 static gint hf_cops_pc_ds_field = -1;
677 static gint hf_cops_pc_gate_id = -1;
678 static gint hf_cops_pc_gate_spec_flags = -1;
679 static gint hf_cops_pc_gate_command_type = -1;
680 static gint hf_cops_pc_key = -1;
681 static gint hf_cops_pc_max_packet_size = -1;
682 static gint hf_cops_pc_min_policed_unit = -1;
683 static gint hf_cops_pc_packetcable_err_code = -1;
684 static gint hf_cops_pc_packetcable_sub_code = -1;
685 static gint hf_cops_pc_peak_data_rate = -1;
686 static gint hf_cops_pc_protocol_id = -1;
687 static gint hf_cops_pc_reason_code = -1;
688 static gint hf_cops_pc_remote_flags = -1;
689 static gint hf_cops_pc_remote_gate_id = -1;
690 static gint hf_cops_pc_reserved = -1;
691 static gint hf_cops_pc_session_class = -1;
692 static gint hf_cops_pc_slack_term = -1;
693 static gint hf_cops_pc_spec_rate = -1;
694 static gint hf_cops_pc_src_ip = -1;
695 static gint hf_cops_pc_src_port = -1;
696 static gint hf_cops_pc_subscriber_id_ipv4 = -1;
697 static gint hf_cops_pc_subscriber_id_ipv6 = -1;
698 static gint hf_cops_pc_t1_value = -1;
699 static gint hf_cops_pc_t7_value = -1;
700 static gint hf_cops_pc_t8_value = -1;
701 static gint hf_cops_pc_token_bucket_rate = -1;
702 static gint hf_cops_pc_token_bucket_size = -1;
703 static gint hf_cops_pc_transaction_id = -1;
704 static gint hf_cops_pc_bcid_ts = -1;
705 static gint hf_cops_pc_bcid = -1;
706 static gint hf_cops_pc_bcid_ev = -1;
707 static gint hf_cops_pc_dfcdc_ip = -1;
708 static gint hf_cops_pc_dfccc_ip = -1;
709 static gint hf_cops_pc_dfcdc_ip_port = -1;
710 static gint hf_cops_pc_dfccc_ip_port = -1;
711 static gint hf_cops_pc_dfccc_id = -1;
713 /* PacketCable Multimedia */
714 static gint hf_cops_pcmm_amid = -1;
715 static gint hf_cops_pcmm_gate_spec_flags = -1;
716 static gint hf_cops_pcmm_gate_spec_dscp_tos_field = -1;
717 static gint hf_cops_pcmm_gate_spec_dscp_tos_mask = -1;
718 static gint hf_cops_pcmm_gate_spec_session_class_id = -1;
719 static gint hf_cops_pcmm_gate_spec_session_class_id_priority = -1;
720 static gint hf_cops_pcmm_gate_spec_session_class_id_preemption = -1;
721 static gint hf_cops_pcmm_gate_spec_session_class_id_configurable = -1;
722 static gint hf_cops_pcmm_gate_spec_timer_t1 = -1;
723 static gint hf_cops_pcmm_gate_spec_timer_t2 = -1;
724 static gint hf_cops_pcmm_gate_spec_timer_t3 = -1;
725 static gint hf_cops_pcmm_gate_spec_timer_t4 = -1;
726 static gint hf_cops_pcmm_classifier_protocol_id = -1;
727 static gint hf_cops_pcmm_classifier_dscp_tos_field = -1;
728 static gint hf_cops_pcmm_classifier_dscp_tos_mask = -1;
729 static gint hf_cops_pcmm_classifier_src_addr = -1;
730 static gint hf_cops_pcmm_classifier_dst_addr = -1;
731 static gint hf_cops_pcmm_classifier_src_port = -1;
732 static gint hf_cops_pcmm_classifier_dst_port = -1;
733 static gint hf_cops_pcmm_classifier_priority = -1;
734 static gint hf_cops_pcmm_flow_spec_envelope = -1;
735 static gint hf_cops_pcmm_flow_spec_service_number = -1;
736 static gint hf_cops_pcmm_docsis_scn = -1;
737 static gint hf_cops_pcmm_envelope = -1;
738 static gint hf_cops_pcmm_traffic_priority = -1;
739 static gint hf_cops_pcmm_request_transmission_policy = -1;
740 static gint hf_cops_pcmm_max_sustained_traffic_rate = -1;
741 static gint hf_cops_pcmm_max_traffic_burst = -1;
742 static gint hf_cops_pcmm_min_reserved_traffic_rate = -1;
743 static gint hf_cops_pcmm_ass_min_rtr_packet_size = -1;
744 static gint hf_cops_pcmm_nominal_polling_interval = -1;
745 static gint hf_cops_pcmm_tolerated_poll_jitter = -1;
746 static gint hf_cops_pcmm_unsolicited_grant_size = -1;
747 static gint hf_cops_pcmm_grants_per_interval = -1;
748 static gint hf_cops_pcmm_nominal_grant_interval = -1;
749 static gint hf_cops_pcmm_tolerated_grant_jitter = -1;
750 static gint hf_cops_pcmm_max_downstream_latency = -1;
751 static gint hf_cops_pcmm_volume_based_usage_limit = -1;
752 static gint hf_cops_pcmm_time_based_usage_limit = -1;
753 static gint hf_cops_pcmm_gate_time_info = -1;
754 static gint hf_cops_pcmm_gate_usage_info = -1;
755 static gint hf_cops_pcmm_packetcable_error_code = -1;
756 static gint hf_cops_pcmm_packetcable_error_subcode = -1;
757 static gint hf_cops_pcmm_packetcable_gate_state = -1;
758 static gint hf_cops_pcmm_packetcable_gate_state_reason = -1;
759 static gint hf_cops_pcmm_packetcable_version_info_major = -1;
760 static gint hf_cops_pcmm_packetcable_version_info_minor = -1;
763 /* Initialize the subtree pointers */
764 static gint ett_cops = -1;
765 static gint ett_cops_ver_flags = -1;
766 static gint ett_cops_obj = -1;
767 static gint ett_cops_pr_obj = -1;
768 static gint ett_cops_obj_data = -1;
769 static gint ett_cops_r_type_flags = -1;
770 static gint ett_cops_itf = -1;
771 static gint ett_cops_reason = -1;
772 static gint ett_cops_decision = -1;
773 static gint ett_cops_error = -1;
774 static gint ett_cops_clientsi = -1;
775 static gint ett_cops_asn1 = -1;
776 static gint ett_cops_gperror = -1;
777 static gint ett_cops_cperror = -1;
778 static gint ett_cops_pdp = -1;
780 /* For PacketCable */
781 static gint ett_cops_subtree = -1;
783 static gint ett_docsis_request_transmission_policy = -1;
786 void proto_reg_handoff_cops(void);
788 static guint get_cops_pdu_len(tvbuff_t *tvb, int offset);
789 static void dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
791 static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, guint8 op_code, guint32 offset, proto_tree *tree, guint16 client_type);
792 static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, proto_tree *tree,
793 guint8 op_code, guint16 client_type, guint8 c_num, guint8 c_type, int len);
795 static void dissect_cops_pr_objects(tvbuff_t *tvb, guint32 offset, proto_tree *tree, int pr_len);
796 static int dissect_cops_pr_object_data(tvbuff_t *tvb, guint32 offset, proto_tree *tree,
797 guint8 s_num, guint8 s_type, int len);
799 /* Added for PacketCable */
800 static proto_tree *info_to_cops_subtree(tvbuff_t *, proto_tree *, int, int, const char *);
801 static proto_item *info_to_display(tvbuff_t *, proto_item *, int, int, const char *, const value_string *, int, gint *);
803 static void cops_transaction_id(tvbuff_t *, packet_info *, proto_tree *, guint8, guint, guint32);
804 static void cops_subscriber_id_v4(tvbuff_t *, proto_tree *, guint, guint32);
805 static void cops_subscriber_id_v6(tvbuff_t *, proto_tree *, guint, guint32);
806 static void cops_gate_id(tvbuff_t *, proto_tree *, guint, guint32);
807 static void cops_activity_count(tvbuff_t *, proto_tree *, guint, guint32);
808 static void cops_gate_specs(tvbuff_t *, proto_tree *, guint, guint32);
809 static void cops_remote_gate_info(tvbuff_t *, proto_tree *, guint, guint32);
810 static void cops_packetcable_reason(tvbuff_t *, proto_tree *, guint, guint32);
811 static void cops_packetcable_error(tvbuff_t *, proto_tree *, guint, guint32);
812 static void cops_event_generation_info(tvbuff_t *, proto_tree *, guint, guint32);
813 static void cops_surveillance_parameters(tvbuff_t *, proto_tree *, guint, guint32);
815 static void cops_amid(tvbuff_t *, proto_tree *, guint, guint32);
817 static void decode_docsis_request_transmission_policy(tvbuff_t *tvb, guint32 offset, proto_tree *tree, gint hf);
819 static void cops_analyze_packetcable_dqos_obj(tvbuff_t *, packet_info *, proto_tree *, guint8, guint32);
820 static void cops_analyze_packetcable_mm_obj(tvbuff_t *, packet_info *, proto_tree *, guint8, guint32);
822 static gboolean cops_packetcable = TRUE;
824 /* End of addition for PacketCable */
827 /* Code to actually dissect the packets */
829 dissect_cops(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
831 tcp_dissect_pdus(tvb, pinfo, tree, cops_desegment, 8,
832 get_cops_pdu_len, dissect_cops_pdu);
836 get_cops_pdu_len(tvbuff_t *tvb, int offset)
839 * Get the length of the COPS message.
841 return tvb_get_ntohl(tvb, offset + 4);
845 dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
851 if (check_col(pinfo->cinfo, COL_PROTOCOL))
852 col_set_str(pinfo->cinfo, COL_PROTOCOL, "COPS");
853 if (check_col(pinfo->cinfo, COL_INFO))
854 col_clear(pinfo->cinfo, COL_INFO);
856 op_code = tvb_get_guint8(tvb, 1);
857 if (check_col(pinfo->cinfo, COL_INFO))
858 col_add_fstr(pinfo->cinfo, COL_INFO, "COPS %s",
859 val_to_str(op_code, cops_op_code_vals, "Unknown Op Code"));
861 /* Currently used by PacketCable */
862 client_type = tvb_get_ntohs(tvb, 2);
866 proto_tree *cops_tree, *ver_flags_tree;
872 ti = proto_tree_add_item(tree, proto_cops, tvb, offset, -1, FALSE);
873 cops_tree = proto_item_add_subtree(ti, ett_cops);
875 /* Version and flags share the same byte, put them in a subtree */
876 ver_flags = tvb_get_guint8(tvb, offset);
877 tv = proto_tree_add_uint_format(cops_tree, hf_cops_ver_flags, tvb, offset, 1,
878 ver_flags, "Version: %u, Flags: %s",
879 hi_nibble(ver_flags),
880 val_to_str(lo_nibble(ver_flags), cops_flags_vals, "Unknown"));
881 ver_flags_tree = proto_item_add_subtree(tv, ett_cops_ver_flags);
882 proto_tree_add_uint(ver_flags_tree, hf_cops_version, tvb, offset, 1, ver_flags);
883 proto_tree_add_uint(ver_flags_tree, hf_cops_flags, tvb, offset, 1, ver_flags);
886 proto_tree_add_item(cops_tree, hf_cops_op_code, tvb, offset, 1, FALSE);
888 proto_tree_add_item(cops_tree, hf_cops_client_type, tvb, offset, 2, FALSE);
891 msg_len = tvb_get_ntohl(tvb, offset);
892 proto_tree_add_uint(cops_tree, hf_cops_msg_len, tvb, offset, 4, msg_len);
895 while (tvb_reported_length_remaining(tvb, offset) >= COPS_OBJECT_HDR_SIZE) {
896 object_len = dissect_cops_object(tvb, pinfo, op_code, offset, cops_tree, client_type);
899 offset += object_len;
902 garbage = tvb_length_remaining(tvb, offset);
904 proto_tree_add_text(cops_tree, tvb, offset, garbage,
905 "Trailing garbage: %d byte%s", garbage,
906 plurality(garbage, "", "s"));
910 static const char *cops_c_type_to_str(guint8 c_num, guint8 c_type)
913 case COPS_OBJ_HANDLE:
915 return "Client Handle";
917 case COPS_OBJ_IN_INT:
918 case COPS_OBJ_OUT_INT:
920 return "IPv4 Address + Interface";
921 else if (c_type == 2)
922 return "IPv6 Address + Interface";
924 case COPS_OBJ_DECISION:
925 case COPS_OBJ_LPDPDECISION:
927 return "Decision Flags (Mandatory)";
928 else if (c_type == 2)
929 return "Stateless Data";
930 else if (c_type == 3)
931 return "Replacement Data";
932 else if (c_type == 4)
933 return "Client Specific Decision Data";
934 else if (c_type == 5)
935 return "Named Decision Data";
937 case COPS_OBJ_CLIENTSI:
939 return "Signaled ClientSI";
940 else if (c_type == 2)
941 return "Named ClientSI";
943 case COPS_OBJ_KATIMER:
945 return "Keep-alive timer value";
947 case COPS_OBJ_PDPREDIRADDR:
948 case COPS_OBJ_LASTPDPADDR:
950 return "IPv4 Address + TCP Port";
951 else if (c_type == 2)
952 return "IPv6 Address + TCP Port";
954 case COPS_OBJ_ACCTTIMER:
956 return "Accounting timer value";
958 case COPS_OBJ_INTEGRITY:
960 return "HMAC digest";
967 static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, guint8 op_code, guint32 offset, proto_tree *tree, guint16 client_type)
969 int object_len, contents_len;
970 guint8 c_num, c_type;
972 proto_tree *obj_tree;
973 const char *type_str;
975 object_len = tvb_get_ntohs(tvb, offset);
976 if (object_len < COPS_OBJECT_HDR_SIZE) {
978 proto_tree_add_text(tree, tvb, offset, 2,
979 "Bad COPS object length: %u, should be at least %u",
980 object_len, COPS_OBJECT_HDR_SIZE);
983 c_num = tvb_get_guint8(tvb, offset + 2);
984 c_type = tvb_get_guint8(tvb, offset + 3);
986 ti = proto_tree_add_uint_format(tree, hf_cops_obj_c_num, tvb, offset, object_len, c_num,
987 "%s: %s", val_to_str(c_num, cops_c_num_vals, "Unknown"),
988 cops_c_type_to_str(c_num, c_type));
989 obj_tree = proto_item_add_subtree(ti, ett_cops_obj);
991 proto_tree_add_uint(obj_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
994 proto_tree_add_uint(obj_tree, hf_cops_obj_c_num, tvb, offset, 1, c_num);
997 type_str = cops_c_type_to_str(c_num, c_type);
998 proto_tree_add_text(obj_tree, tvb, offset, 1, "C-Type: %s%s%u%s",
1000 strlen(type_str) ? " (" : "",
1002 strlen(type_str) ? ")" : "");
1005 contents_len = object_len - COPS_OBJECT_HDR_SIZE;
1006 dissect_cops_object_data(tvb, pinfo, offset, obj_tree, op_code, client_type, c_num, c_type, contents_len);
1008 /* Pad to 32bit boundary */
1009 if (object_len % sizeof (guint32))
1010 object_len += (sizeof (guint32) - object_len % sizeof (guint32));
1015 static void dissect_cops_pr_objects(tvbuff_t *tvb, guint32 offset, proto_tree *tree, int pr_len)
1017 int object_len, contents_len;
1018 guint8 s_num, s_type;
1019 const char *type_str;
1021 proto_tree *cops_pr_tree, *obj_tree;
1024 cops_pr_tree = proto_item_add_subtree(tree, ett_cops_pr_obj);
1026 while (pr_len >= COPS_OBJECT_HDR_SIZE) {
1027 object_len = tvb_get_ntohs(tvb, offset);
1028 if (object_len < COPS_OBJECT_HDR_SIZE) {
1030 proto_tree_add_text(tree, tvb, offset, 2,
1031 "Bad COPS PR object length: %u, should be at least %u",
1032 object_len, COPS_OBJECT_HDR_SIZE);
1035 s_num = tvb_get_guint8(tvb, offset + 2);
1037 ti = proto_tree_add_uint_format(cops_pr_tree, hf_cops_obj_s_num, tvb, offset, object_len, s_num,
1038 "%s", val_to_str(s_num, cops_s_num_vals, "Unknown"));
1039 obj_tree = proto_item_add_subtree(cops_pr_tree, ett_cops_pr_obj);
1041 proto_tree_add_uint(obj_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1045 proto_tree_add_uint(obj_tree, hf_cops_obj_s_num, tvb, offset, 1, s_num);
1049 s_type = tvb_get_guint8(tvb, offset);
1050 type_str = val_to_str(s_type, cops_s_type_vals, "Unknown");
1051 proto_tree_add_text(obj_tree, tvb, offset, 1, "S-Type: %s%s%u%s",
1053 strlen(type_str) ? " (" : "",
1055 strlen(type_str) ? ")" : "");
1059 contents_len = object_len - COPS_OBJECT_HDR_SIZE;
1060 ret = dissect_cops_pr_object_data(tvb, offset, obj_tree, s_num, s_type, contents_len);
1064 /*Pad to 32bit boundary */
1065 if (object_len % sizeof (guint32))
1066 object_len += (sizeof (guint32) - object_len % sizeof (guint32));
1068 pr_len -= object_len - COPS_OBJECT_HDR_SIZE;
1069 offset += object_len - COPS_OBJECT_HDR_SIZE;
1073 static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, proto_tree *tree,
1074 guint8 op_code, guint16 client_type, guint8 c_num, guint8 c_type, int len)
1077 proto_tree *r_type_tree, *itf_tree, *reason_tree, *dec_tree, *error_tree, *clientsi_tree, *pdp_tree;
1078 guint16 r_type, m_type, reason, reason_sub, cmd_code, cmd_flags, error, error_sub, tcp_port;
1079 guint32 ipv4addr, ifindex;
1080 struct e_in6_addr ipv6addr;
1083 case COPS_OBJ_CONTEXT:
1084 r_type = tvb_get_ntohs(tvb, offset);
1085 m_type = tvb_get_ntohs(tvb, offset + 2);
1086 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: R-Type: %s, M-Type: %u",
1087 val_to_str(r_type, cops_r_type_vals, "Unknown"),
1090 r_type_tree = proto_item_add_subtree(ti, ett_cops_r_type_flags);
1091 proto_tree_add_uint(r_type_tree, hf_cops_r_type_flags, tvb, offset, 2, r_type);
1093 proto_tree_add_uint(r_type_tree, hf_cops_m_type_flags, tvb, offset, 2, m_type);
1096 case COPS_OBJ_IN_INT:
1097 case COPS_OBJ_OUT_INT:
1098 if (c_type == 1) { /* IPv4 */
1099 ipv4addr = tvb_get_ipv4(tvb, offset);
1100 ifindex = tvb_get_ntohl(tvb, offset + 4);
1101 ti = proto_tree_add_text(tree, tvb, offset, 8, "Contents: IPv4 address %s, ifIndex: %u",
1102 ip_to_str((guint8 *)&ipv4addr), ifindex);
1103 itf_tree = proto_item_add_subtree(ti, ett_cops_itf);
1104 proto_tree_add_ipv4(itf_tree,
1105 (c_num == COPS_OBJ_IN_INT) ? hf_cops_in_int_ipv4 : hf_cops_out_int_ipv4,
1106 tvb, offset, 4, ipv4addr);
1108 } else if (c_type == 2) { /* IPv6 */
1109 tvb_get_ipv6(tvb, offset, &ipv6addr);
1110 ifindex = tvb_get_ntohl(tvb, offset + sizeof ipv6addr);
1111 ti = proto_tree_add_text(tree, tvb, offset, 20, "Contents: IPv6 address %s, ifIndex: %u",
1112 ip6_to_str(&ipv6addr), ifindex);
1113 itf_tree = proto_item_add_subtree(ti, ett_cops_itf);
1114 proto_tree_add_ipv6(itf_tree,
1115 (c_num == COPS_OBJ_IN_INT) ? hf_cops_in_int_ipv6 : hf_cops_out_int_ipv6,
1116 tvb, offset, 16, (guint8 *)&ipv6addr);
1121 proto_tree_add_uint(itf_tree, hf_cops_int_ifindex, tvb, offset, 4, ifindex);
1124 case COPS_OBJ_REASON:
1125 reason = tvb_get_ntohs(tvb, offset);
1126 reason_sub = tvb_get_ntohs(tvb, offset + 2);
1127 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Reason-Code: %s, Reason Sub-code: 0x%04x",
1128 val_to_str(reason, cops_reason_vals, "<Unknown value>"), reason_sub);
1129 reason_tree = proto_item_add_subtree(ti, ett_cops_reason);
1130 proto_tree_add_uint(reason_tree, hf_cops_reason, tvb, offset, 2, reason);
1133 proto_tree_add_text(reason_tree, tvb, offset, 2, "Reason Sub-code: "
1134 "Unknown object's C-Num %u, C-Type %u",
1135 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
1137 proto_tree_add_uint(reason_tree, hf_cops_reason_sub, tvb, offset, 2, reason_sub);
1140 case COPS_OBJ_DECISION:
1141 case COPS_OBJ_LPDPDECISION:
1143 cmd_code = tvb_get_ntohs(tvb, offset);
1144 cmd_flags = tvb_get_ntohs(tvb, offset + 2);
1145 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Command-Code: %s, Flags: %s",
1146 val_to_str(cmd_code, cops_dec_cmd_code_vals, "<Unknown value>"),
1147 val_to_str(cmd_flags, cops_dec_cmd_flag_vals, "<Unknown flag>"));
1148 dec_tree = proto_item_add_subtree(ti, ett_cops_decision);
1149 proto_tree_add_uint(dec_tree, hf_cops_dec_cmd_code, tvb, offset, 2, cmd_code);
1151 proto_tree_add_uint(dec_tree, hf_cops_dec_flags, tvb, offset, 2, cmd_flags);
1152 } else if (c_type == 5) { /*COPS-PR Data*/
1153 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: %d bytes", len);
1154 dec_tree = proto_item_add_subtree(ti, ett_cops_decision);
1155 dissect_cops_pr_objects(tvb, offset, dec_tree, len);
1158 /* PacketCable : Analyze the remaining data if available */
1159 if (client_type == COPS_CLIENT_PC_DQOS && c_type == 4) {
1160 cops_analyze_packetcable_dqos_obj(tvb, pinfo, tree, op_code, offset);
1161 } else if (client_type == COPS_CLIENT_PC_MM && c_type == 4) {
1162 cops_analyze_packetcable_mm_obj(tvb, pinfo, tree, op_code, offset);
1166 case COPS_OBJ_ERROR:
1170 error = tvb_get_ntohs(tvb, offset);
1171 error_sub = tvb_get_ntohs(tvb, offset + 2);
1172 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1173 val_to_str(error, cops_error_vals, "<Unknown value>"), error_sub);
1174 error_tree = proto_item_add_subtree(ti, ett_cops_error);
1175 proto_tree_add_uint(error_tree, hf_cops_error, tvb, offset, 2, error);
1178 proto_tree_add_text(error_tree, tvb, offset, 2, "Error Sub-code: "
1179 "Unknown object's C-Num %u, C-Type %u",
1180 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
1182 proto_tree_add_uint(error_tree, hf_cops_error_sub, tvb, offset, 2, error_sub);
1185 case COPS_OBJ_CLIENTSI:
1187 /* For PacketCable */
1188 if (client_type == COPS_CLIENT_PC_DQOS && c_type == 1) {
1189 cops_analyze_packetcable_dqos_obj(tvb, pinfo, tree, op_code, offset);
1191 } else if (client_type == COPS_CLIENT_PC_MM && c_type == 1) {
1192 cops_analyze_packetcable_mm_obj(tvb, pinfo, tree, op_code, offset);
1196 if (c_type != 2) /*Not COPS-PR data*/
1199 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: %d bytes", len);
1200 clientsi_tree = proto_item_add_subtree(ti, ett_cops_clientsi);
1202 dissect_cops_pr_objects(tvb, offset, clientsi_tree, len);
1205 case COPS_OBJ_KATIMER:
1209 proto_tree_add_item(tree, hf_cops_katimer, tvb, offset + 2, 2, FALSE);
1210 if (tvb_get_ntohs(tvb, offset + 2) == 0)
1211 proto_tree_add_text(tree, tvb, offset, 0, "Value of zero implies infinity.");
1214 case COPS_OBJ_PEPID:
1218 if (tvb_strnlen(tvb, offset, len) == -1)
1219 proto_tree_add_text(tree, tvb, offset, len, "<PEP Id is not a NUL terminated ASCII string>");
1221 proto_tree_add_item(tree, hf_cops_pepid, tvb, offset,
1222 tvb_strnlen(tvb, offset, len) + 1, FALSE);
1225 case COPS_OBJ_REPORT_TYPE:
1229 proto_tree_add_item(tree, hf_cops_report_type, tvb, offset, 2, FALSE);
1232 case COPS_OBJ_PDPREDIRADDR:
1233 case COPS_OBJ_LASTPDPADDR:
1234 if (c_type == 1) { /* IPv4 */
1235 ipv4addr = tvb_get_ipv4(tvb, offset);
1236 tcp_port = tvb_get_ntohs(tvb, offset + 4 + 2);
1237 ti = proto_tree_add_text(tree, tvb, offset, 8, "Contents: IPv4 address %s, TCP Port Number: %u",
1238 ip_to_str((guint8 *)&ipv4addr), tcp_port);
1239 pdp_tree = proto_item_add_subtree(ti, ett_cops_pdp);
1240 proto_tree_add_ipv4(pdp_tree,
1241 (c_num == COPS_OBJ_PDPREDIRADDR) ? hf_cops_pdprediraddr_ipv4 : hf_cops_lastpdpaddr_ipv4,
1242 tvb, offset, 4, ipv4addr);
1244 } else if (c_type == 2) { /* IPv6 */
1245 tvb_get_ipv6(tvb, offset, &ipv6addr);
1246 tcp_port = tvb_get_ntohs(tvb, offset + sizeof ipv6addr + 2);
1247 ti = proto_tree_add_text(tree, tvb, offset, 20, "Contents: IPv6 address %s, TCP Port Number: %u",
1248 ip6_to_str(&ipv6addr), tcp_port);
1249 pdp_tree = proto_item_add_subtree(ti, ett_cops_pdp);
1250 proto_tree_add_ipv6(pdp_tree,
1251 (c_num == COPS_OBJ_PDPREDIRADDR) ? hf_cops_pdprediraddr_ipv6 : hf_cops_lastpdpaddr_ipv6,
1252 tvb, offset, 16, (guint8 *)&ipv6addr);
1258 proto_tree_add_uint(pdp_tree, hf_cops_pdp_tcp_port, tvb, offset, 2, tcp_port);
1261 case COPS_OBJ_ACCTTIMER:
1265 proto_tree_add_item(tree, hf_cops_accttimer, tvb, offset + 2, 2, FALSE);
1266 if (tvb_get_ntohs(tvb, offset + 2) == 0)
1267 proto_tree_add_text(tree, tvb, offset, 0, "Value of zero means "
1268 "there SHOULD be no unsolicited accounting updates.");
1271 case COPS_OBJ_INTEGRITY:
1273 break; /* Not HMAC digest */
1275 proto_tree_add_item(tree, hf_cops_key_id, tvb, offset, 4, FALSE);
1276 proto_tree_add_item(tree, hf_cops_seq_num, tvb, offset + 4, 4, FALSE);
1277 proto_tree_add_text(tree, tvb, offset + 8 , len - 8, "Contents: Keyed Message Digest");
1281 proto_tree_add_text(tree, tvb, offset, len, "Contents: %d bytes", len);
1287 #ifdef HAVE_NET_SNMP
1288 static guchar*format_asn_value (struct variable_list *variable, subid_t *variable_oid,
1289 guint variable_oid_length, u_char type_from_packet)
1291 struct tree *subtree=tree_head;
1297 /*Get the ASN.1 type etc. from the PIB-MIB. If unsuccessful use the type from packet*/
1298 subtree = get_tree(variable_oid,variable_oid_length, subtree);
1300 if (subtree->type == 0)
1301 variable->type= type_from_packet;
1303 buf_len = SPRINT_MAX_LEN; /*defined in NET-SNMP's snmp-impl.h*/
1304 buf = ep_alloc(buf_len);
1308 /*If the ASN.1 type was found from PIB-MIB, use it for decoding*/
1309 if (!variable->type)
1310 variable->type=mib_to_asn_type(subtree->type);
1312 if (!sprint_realloc_by_type(&buf, &buf_len, &out_len, TRUE, variable, subtree->enums, subtree->hint, NULL))
1313 g_snprintf(buf,SPRINT_MAX_LEN,"%s","sprint_realloc_by_type failed");
1317 #endif /* HAVE_NET_SNMP */
1319 static int decode_cops_pr_asn1_data(tvbuff_t *tvb, guint32 offset,
1320 proto_tree *tree, guint asnlen, guint8 cops_pr_obj
1321 #ifndef HAVE_NET_SNMP
1333 const gchar *vb_type_name;
1336 guint cls, con, tag;
1337 subid_t epd_attribute_index=0;
1339 gint32 vb_integer_value;
1340 guint32 vb_uinteger_value;
1342 guint8 *vb_octet_string;
1345 guint vb_oid_length;
1347 gchar *vb_display_string;
1348 gchar *vb_display_string2;
1350 #ifdef HAVE_NET_SNMP
1351 struct variable_list variable;
1353 #endif /* HAVE_NET_SNMP */
1358 while (asnlen > 0) { /*while there is ASN stuff to be decoded*/
1360 epd_attribute_index++;
1361 #ifdef HAVE_NET_SNMP
1362 last_decoded_prid_oid[last_decoded_prid_oid_length-1]=epd_attribute_index;
1363 #endif /* HAVE_NET_SNMP */
1364 asn1_open(&asn1, tvb, offset);
1366 /* parse the type of the object */
1368 start = asn1.offset;
1370 ret = asn1_header_decode (&asn1, &cls, &con, &tag, &def, &vb_length);
1371 if (ret != ASN1_ERR_NOERROR)
1374 return ASN1_ERR_LENGTH_NOT_DEFINITE;
1376 /* Convert the class, constructed flag, and tag to a type. */
1377 vb_type_name = cops_tag_cls2syntax(tag, cls, &vb_type);
1378 if (vb_type_name == NULL) {
1381 * Dissect the value as an opaque string of octets.
1383 vb_type_name = "unsupported type";
1384 vb_type = COPS_OPAQUE;
1387 /* parse the value */
1392 ret = asn1_int32_value_decode(&asn1, vb_length, &vb_integer_value);
1393 if (ret != ASN1_ERR_NOERROR)
1395 length = asn1.offset - start;
1397 #ifdef HAVE_NET_SNMP
1398 if (cops_typefrommib == TRUE)
1401 value = vb_integer_value;
1402 variable.val.integer = &value;
1403 variable.val_len = vb_length ;
1404 vb_display_string=format_asn_value(&variable,
1405 last_decoded_prid_oid,last_decoded_prid_oid_length,ASN_INTEGER);
1407 proto_tree_add_text(tree, asn1.tvb, offset, length,
1408 "Value: %s", vb_display_string);
1411 #endif /* HAVE_NET_SNMP */
1412 proto_tree_add_text(tree, asn1.tvb, offset, length,
1413 "Value: %s: %d (%#x)", vb_type_name,
1414 vb_integer_value, vb_integer_value);
1418 case COPS_UNSIGNED32:
1419 case COPS_TIMETICKS:
1420 ret = asn1_uint32_value_decode(&asn1, vb_length, &vb_uinteger_value);
1421 if (ret != ASN1_ERR_NOERROR)
1423 length = asn1.offset - start;
1425 #ifdef HAVE_NET_SNMP
1426 if (cops_typefrommib == TRUE)
1429 value = vb_uinteger_value;
1430 variable.val.integer = &value;
1431 variable.val_len = vb_length;
1433 vb_display_string=format_asn_value(&variable,
1434 last_decoded_prid_oid,last_decoded_prid_oid_length,ASN_UINTEGER);
1436 proto_tree_add_text(tree, asn1.tvb, offset, length, "Value %s: %s",vb_type_name, vb_display_string);
1440 #endif /* HAVE_NET_SNMP */
1441 proto_tree_add_text(tree, asn1.tvb, offset, length,
1442 "Value: %s: %u (%#x)", vb_type_name,
1443 vb_uinteger_value, vb_uinteger_value);
1450 case COPS_UNSIGNED64:
1451 case COPS_INTEGER64:
1452 ret = asn1_string_value_decode (&asn1, vb_length, &vb_octet_string);
1453 if (ret != ASN1_ERR_NOERROR)
1455 length = asn1.offset - start;
1457 #ifdef HAVE_NET_SNMP
1458 if (cops_typefrommib == TRUE)
1461 variable.val.string = vb_octet_string;
1462 variable.val_len = vb_length;
1463 vb_display_string = format_asn_value(&variable,
1464 last_decoded_prid_oid,last_decoded_prid_oid_length,ASN_OCTET_STR);
1465 proto_tree_add_text(tree, asn1.tvb, offset, length,
1466 "Value: %s (ASN.1 type from packet: %s)", vb_display_string, vb_type_name);
1471 #endif /* HAVE_NET_SNMP */
1472 for (i = 0; i < vb_length; i++) {
1473 if (!(isprint(vb_octet_string[i]) ||isspace(vb_octet_string[i])))
1478 * If some characters are not printable, display the string as bytes.
1480 if (i < vb_length) {
1482 * We stopped, due to a non-printable character, before we got
1483 * to the end of the string.
1485 vb_display_string = ep_alloc(4*vb_length);
1486 buf = vb_display_string;
1487 buf += g_snprintf(buf, 4*vb_length, "%03u", vb_octet_string[0]);
1488 for (i = 1; i < vb_length; i++) {
1489 buf += g_snprintf(buf, 4*vb_length-(buf-vb_display_string), ".%03u", vb_octet_string[i]);
1491 proto_tree_add_text(tree, asn1.tvb, offset, length,
1492 "Value: %s: %s", vb_type_name, vb_display_string);
1494 proto_tree_add_text(tree, asn1.tvb, offset, length,
1495 "Value: %s: %.*s", vb_type_name, (int)vb_length,
1496 SAFE_STRING(vb_octet_string));
1498 #ifdef HAVE_NET_SNMP
1500 #endif /* HAVE_NET_SNMP */
1502 g_free(vb_octet_string);
1506 ret = asn1_null_decode (&asn1, vb_length);
1507 if (ret != ASN1_ERR_NOERROR)
1509 length = asn1.offset - start;
1511 proto_tree_add_text(tree, asn1.tvb, offset, length, "Value: %s", vb_type_name);
1515 ret = asn1_oid_value_decode (&asn1, vb_length, &vb_oid, &vb_oid_length);
1516 if (ret != ASN1_ERR_NOERROR)
1518 length = asn1.offset - start;
1521 if (cops_pr_obj == COPS_OBJ_PPRID){
1522 /*we're decoding Prefix PRID, that doesn't have a instance Id,
1523 *Use full length of the OID when decoding it.
1525 new_format_oid(vb_oid,vb_oid_length,&vb_display_string,&vb_display_string2);
1527 if (!vb_display_string2) /*if OID couldn't be decoded, print only numeric format*/
1528 proto_tree_add_text(tree, asn1.tvb, offset, length,
1529 "Value: %s: %s", vb_type_name, vb_display_string);
1531 proto_tree_add_text(tree, asn1.tvb, offset, length,
1532 "Value: %s: %s (%s)", vb_type_name,
1534 vb_display_string2);
1536 else { /*we're decoding PRID, Error PRID or EPD*/
1537 /*strip the instance Id from the OIDs before decoding and paste it back during printing*/
1538 new_format_oid(vb_oid,vb_oid_length-1,&vb_display_string,&vb_display_string2);
1540 if (!vb_display_string2) /*if OID couldn't be decoded, print only numeric format*/
1541 proto_tree_add_text(tree, asn1.tvb, offset, length,
1542 "Value: %s: %s.%lu", vb_type_name,
1544 (unsigned long)vb_oid[vb_oid_length-1]);
1546 proto_tree_add_text(tree, asn1.tvb, offset, length,
1547 "Value: %s: %s.%lu (%s.%lu)", vb_type_name,
1549 (unsigned long)vb_oid[vb_oid_length-1],
1551 (unsigned long)vb_oid[vb_oid_length-1]);
1553 #ifdef HAVE_NET_SNMP
1554 if (cops_pr_obj != COPS_OBJ_EPD) {
1555 /* we're not decoding EPD, so let's store the OID of the PRID so that later
1556 when we're decoding this PRID's EPD we can finetune the output.*/
1557 memcpy(last_decoded_prid_oid,vb_oid,vb_oid_length*sizeof(subid_t));
1558 last_decoded_prid_oid_length=vb_oid_length;
1560 #endif /* HAVE_NET_SNMP */
1566 DISSECTOR_ASSERT_NOT_REACHED();
1567 return ASN1_ERR_WRONG_TYPE;
1570 asn1_close(&asn1,&offset);
1574 epd_attribute_index=0;
1578 static int dissect_cops_pr_object_data(tvbuff_t *tvb, guint32 offset, proto_tree *tree,
1579 guint8 s_num, guint8 s_type, int len)
1582 proto_tree *asn1_object_tree, *gperror_tree, *cperror_tree;
1583 guint16 gperror=0, gperror_sub=0, cperror=0, cperror_sub=0;
1587 if (s_type != 1) /* Not Provisioning Instance Identifier (PRID) */
1590 ti=proto_tree_add_text(tree, tvb, offset, len, "Contents:");
1591 asn1_object_tree = proto_item_add_subtree(ti, ett_cops_asn1);
1593 decode_cops_pr_asn1_data(tvb, offset, asn1_object_tree, len, COPS_OBJ_PRID);
1596 case COPS_OBJ_PPRID:
1597 if (s_type != 1) /* Not Prefix Provisioning Instance Identifier (PPRID) */
1600 ti = proto_tree_add_text(tree, tvb, offset, len, "Contents:");
1601 asn1_object_tree = proto_item_add_subtree(ti, ett_cops_asn1);
1603 decode_cops_pr_asn1_data(tvb, offset, asn1_object_tree, len, COPS_OBJ_PPRID);
1607 if (s_type != 1) /* Not Encoded Provisioning Instance Data (EPD) */
1610 ti = proto_tree_add_text(tree, tvb, offset, len, "Contents:");
1611 asn1_object_tree = proto_item_add_subtree(ti, ett_cops_asn1);
1613 decode_cops_pr_asn1_data(tvb, offset, asn1_object_tree, len, COPS_OBJ_EPD);
1616 case COPS_OBJ_GPERR:
1617 if (s_type != 1) /* Not Global Provisioning Error Object (GPERR) */
1620 gperror = tvb_get_ntohs(tvb, offset);
1621 gperror_sub = tvb_get_ntohs(tvb, offset + 2);
1622 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1623 val_to_str(gperror, cops_gperror_vals, "<Unknown value>"), gperror_sub);
1624 gperror_tree = proto_item_add_subtree(ti, ett_cops_gperror);
1625 proto_tree_add_uint(gperror_tree, hf_cops_gperror, tvb, offset, 2, gperror);
1627 if (cperror == 13) {
1628 proto_tree_add_text(gperror_tree, tvb, offset, 2, "Error Sub-code: "
1629 "Unknown object's C-Num %u, C-Type %u",
1630 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
1632 proto_tree_add_uint(gperror_tree, hf_cops_gperror_sub, tvb, offset, 2, gperror_sub);
1635 case COPS_OBJ_CPERR:
1636 if (s_type != 1) /*Not PRC Class Provisioning Error Object (CPERR) */
1641 cperror = tvb_get_ntohs(tvb, offset);
1642 cperror_sub = tvb_get_ntohs(tvb, offset + 2);
1643 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1644 val_to_str(cperror, cops_cperror_vals, "<Unknown value>"), cperror_sub);
1645 cperror_tree = proto_item_add_subtree(ti, ett_cops_cperror);
1646 proto_tree_add_uint(cperror_tree, hf_cops_cperror, tvb, offset, 2, cperror);
1648 if (cperror == 13) {
1649 proto_tree_add_text(cperror_tree, tvb, offset, 2, "Error Sub-code: "
1650 "Unknown object's S-Num %u, C-Type %u",
1651 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
1653 proto_tree_add_uint(cperror_tree, hf_cops_cperror_sub, tvb, offset, 2, cperror_sub);
1656 case COPS_OBJ_ERRPRID:
1657 if (s_type != 1) /*Not Error Provisioning Instance Identifier (ErrorPRID)*/
1660 ti = proto_tree_add_text(tree, tvb, offset, len, "Contents:");
1661 asn1_object_tree = proto_item_add_subtree(ti, ett_cops_asn1);
1663 decode_cops_pr_asn1_data(tvb, offset, asn1_object_tree, len, COPS_OBJ_ERRPRID);
1667 proto_tree_add_text(tree, tvb, offset, len, "Contents: %d bytes", len);
1675 /* Register the protocol with Ethereal */
1676 void proto_register_cops(void)
1678 /* Setup list of header fields */
1679 static hf_register_info hf[] = {
1680 { &hf_cops_ver_flags,
1681 { "Version and Flags", "cops.ver_flags",
1682 FT_UINT8, BASE_HEX, NULL, 0x0,
1683 "Version and Flags in COPS Common Header", HFILL }
1686 { "Version", "cops.version",
1687 FT_UINT8, BASE_DEC, NULL, 0xF0,
1688 "Version in COPS Common Header", HFILL }
1691 { "Flags", "cops.flags",
1692 FT_UINT8, BASE_HEX, VALS(cops_flags_vals), 0x0F,
1693 "Flags in COPS Common Header", HFILL }
1696 { "Op Code", "cops.op_code",
1697 FT_UINT8, BASE_DEC, VALS(cops_op_code_vals), 0x0,
1698 "Op Code in COPS Common Header", HFILL }
1700 { &hf_cops_client_type,
1701 { "Client Type", "cops.client_type",
1702 FT_UINT16, BASE_DEC, VALS(cops_client_type_vals), 0x0,
1703 "Client Type in COPS Common Header", HFILL }
1706 { "Message Length", "cops.msg_len",
1707 FT_UINT32, BASE_DEC, NULL, 0x0,
1708 "Message Length in COPS Common Header", HFILL }
1711 { "Object Length", "cops.obj.len",
1712 FT_UINT32, BASE_DEC, NULL, 0x0,
1713 "Object Length in COPS Object Header", HFILL }
1715 { &hf_cops_obj_c_num,
1716 { "C-Num", "cops.c_num",
1717 FT_UINT8, BASE_DEC, VALS(cops_c_num_vals), 0x0,
1718 "C-Num in COPS Object Header", HFILL }
1720 { &hf_cops_obj_c_type,
1721 { "C-Type", "cops.c_type",
1722 FT_UINT8, BASE_DEC, NULL, 0x0,
1723 "C-Type in COPS Object Header", HFILL }
1726 { &hf_cops_obj_s_num,
1727 { "S-Num", "cops.s_num",
1728 FT_UINT8, BASE_DEC, VALS(cops_s_num_vals), 0x0,
1729 "S-Num in COPS-PR Object Header", HFILL }
1731 { &hf_cops_obj_s_type,
1732 { "S-Type", "cops.s_type",
1733 FT_UINT8, BASE_DEC, NULL, 0x0,
1734 "S-Type in COPS-PR Object Header", HFILL }
1737 { &hf_cops_r_type_flags,
1738 { "R-Type", "cops.context.r_type",
1739 FT_UINT16, BASE_HEX, VALS(cops_r_type_vals), 0xFFFF,
1740 "R-Type in COPS Context Object", HFILL }
1742 { &hf_cops_m_type_flags,
1743 { "M-Type", "cops.context.m_type",
1744 FT_UINT16, BASE_HEX, NULL, 0xFFFF,
1745 "M-Type in COPS Context Object", HFILL }
1747 { &hf_cops_in_int_ipv4,
1748 { "IPv4 address", "cops.in-int.ipv4",
1749 FT_IPv4, 0, NULL, 0,
1750 "IPv4 address in COPS IN-Int object", HFILL }
1752 { &hf_cops_in_int_ipv6,
1753 { "IPv6 address", "cops.in-int.ipv6",
1754 FT_IPv6, 0, NULL, 0,
1755 "IPv6 address in COPS IN-Int object", HFILL }
1757 { &hf_cops_out_int_ipv4,
1758 { "IPv4 address", "cops.out-int.ipv4",
1759 FT_IPv4, 0, NULL, 0,
1760 "IPv4 address in COPS OUT-Int object", HFILL }
1762 { &hf_cops_out_int_ipv6,
1763 { "IPv6 address", "cops.out-int.ipv6",
1764 FT_IPv6, 0, NULL, 0,
1765 "IPv6 address in COPS OUT-Int", HFILL }
1767 { &hf_cops_int_ifindex,
1768 { "ifIndex", "cops.in-out-int.ifindex",
1769 FT_UINT32, BASE_DEC, NULL, 0x0,
1770 "If SNMP is supported, corresponds to MIB-II ifIndex", HFILL }
1773 { "Reason", "cops.reason",
1774 FT_UINT16, BASE_DEC, VALS(cops_reason_vals), 0,
1775 "Reason in Reason object", HFILL }
1777 { &hf_cops_reason_sub,
1778 { "Reason Sub-code", "cops.reason_sub",
1779 FT_UINT16, BASE_HEX, NULL, 0,
1780 "Reason Sub-code in Reason object", HFILL }
1782 { &hf_cops_dec_cmd_code,
1783 { "Command-Code", "cops.decision.cmd",
1784 FT_UINT16, BASE_DEC, VALS(cops_dec_cmd_code_vals), 0,
1785 "Command-Code in Decision/LPDP Decision object", HFILL }
1787 { &hf_cops_dec_flags,
1788 { "Flags", "cops.decision.flags",
1789 FT_UINT16, BASE_HEX, VALS(cops_dec_cmd_flag_vals), 0xffff,
1790 "Flags in Decision/LPDP Decision object", HFILL }
1793 { "Error", "cops.error",
1794 FT_UINT16, BASE_DEC, VALS(cops_error_vals), 0,
1795 "Error in Error object", HFILL }
1797 { &hf_cops_error_sub,
1798 { "Error Sub-code", "cops.error_sub",
1799 FT_UINT16, BASE_HEX, NULL, 0,
1800 "Error Sub-code in Error object", HFILL }
1803 { "Contents: KA Timer Value", "cops.katimer.value",
1804 FT_UINT16, BASE_DEC, NULL, 0,
1805 "Keep-Alive Timer Value in KATimer object", HFILL }
1808 { "Contents: PEP Id", "cops.pepid.id",
1809 FT_STRING, BASE_NONE, NULL, 0,
1810 "PEP Id in PEPID object", HFILL }
1812 { &hf_cops_report_type,
1813 { "Contents: Report-Type", "cops.report_type",
1814 FT_UINT16, BASE_DEC, VALS(cops_report_type_vals), 0,
1815 "Report-Type in Report-Type object", HFILL }
1817 { &hf_cops_pdprediraddr_ipv4,
1818 { "IPv4 address", "cops.pdprediraddr.ipv4",
1819 FT_IPv4, 0, NULL, 0,
1820 "IPv4 address in COPS PDPRedirAddr object", HFILL }
1822 { &hf_cops_pdprediraddr_ipv6,
1823 { "IPv6 address", "cops.pdprediraddr.ipv6",
1824 FT_IPv6, 0, NULL, 0,
1825 "IPv6 address in COPS PDPRedirAddr object", HFILL }
1827 { &hf_cops_lastpdpaddr_ipv4,
1828 { "IPv4 address", "cops.lastpdpaddr.ipv4",
1829 FT_IPv4, 0, NULL, 0,
1830 "IPv4 address in COPS LastPDPAddr object", HFILL }
1832 { &hf_cops_lastpdpaddr_ipv6,
1833 { "IPv6 address", "cops.lastpdpaddr.ipv6",
1834 FT_IPv6, 0, NULL, 0,
1835 "IPv6 address in COPS LastPDPAddr object", HFILL }
1837 { &hf_cops_pdp_tcp_port,
1838 { "TCP Port Number", "cops.pdp.tcp_port",
1839 FT_UINT32, BASE_DEC, NULL, 0x0,
1840 "TCP Port Number of PDP in PDPRedirAddr/LastPDPAddr object", HFILL }
1842 { &hf_cops_accttimer,
1843 { "Contents: ACCT Timer Value", "cops.accttimer.value",
1844 FT_UINT16, BASE_DEC, NULL, 0,
1845 "Accounting Timer Value in AcctTimer object", HFILL }
1848 { "Contents: Key ID", "cops.integrity.key_id",
1849 FT_UINT32, BASE_DEC, NULL, 0,
1850 "Key ID in Integrity object", HFILL }
1853 { "Contents: Sequence Number", "cops.integrity.seq_num",
1854 FT_UINT32, BASE_DEC, NULL, 0,
1855 "Sequence Number in Integrity object", HFILL }
1858 { "Error", "cops.gperror",
1859 FT_UINT16, BASE_DEC, VALS(cops_gperror_vals), 0,
1860 "Error in Error object", HFILL }
1862 { &hf_cops_gperror_sub,
1863 { "Error Sub-code", "cops.gperror_sub",
1864 FT_UINT16, BASE_HEX, NULL, 0,
1865 "Error Sub-code in Error object", HFILL }
1868 { "Error", "cops.cperror",
1869 FT_UINT16, BASE_DEC, VALS(cops_cperror_vals), 0,
1870 "Error in Error object", HFILL }
1872 { &hf_cops_cperror_sub,
1873 { "Error Sub-code", "cops.cperror_sub",
1874 FT_UINT16, BASE_HEX, NULL, 0,
1875 "Error Sub-code in Error object", HFILL }
1878 /* Added for PacketCable */
1881 { "Object Subtree", "cops.pc_subtree",
1882 FT_UINT16, BASE_HEX, NULL, 0,
1883 "Object Subtree", HFILL }
1885 { &hf_cops_pc_ds_field,
1886 { "DS Field (DSCP or TOS)", "cops.pc_ds_field",
1887 FT_UINT8, BASE_HEX, NULL, 0x00,
1888 "DS Field (DSCP or TOS)", HFILL }
1890 { &hf_cops_pc_direction,
1891 { "Direction", "cops.pc_direction",
1892 FT_UINT8, BASE_HEX, NULL, 0x00,
1893 "Direction", HFILL }
1895 { &hf_cops_pc_gate_spec_flags,
1896 { "Flags", "cops.pc_gate_spec_flags",
1897 FT_UINT8, BASE_HEX, NULL, 0x00,
1900 { &hf_cops_pc_protocol_id,
1901 { "Protocol ID", "cops.pc_protocol_id",
1902 FT_UINT8, BASE_HEX, NULL, 0x00,
1903 "Protocol ID", HFILL }
1905 { &hf_cops_pc_session_class,
1906 { "Session Class", "cops.pc_session_class",
1907 FT_UINT8, BASE_HEX, NULL, 0x00,
1908 "Session Class", HFILL }
1910 { &hf_cops_pc_algorithm,
1911 { "Algorithm", "cops.pc_algorithm",
1912 FT_UINT16, BASE_HEX, NULL, 0x00,
1913 "Algorithm", HFILL }
1915 { &hf_cops_pc_cmts_ip_port,
1916 { "CMTS IP Port", "cops.pc_cmts_ip_port",
1917 FT_UINT16, BASE_HEX, NULL, 0x00,
1918 "CMTS IP Port", HFILL }
1920 { &hf_cops_pc_prks_ip_port,
1921 { "PRKS IP Port", "cops.pc_prks_ip_port",
1922 FT_UINT16, BASE_HEX, NULL, 0x00,
1923 "PRKS IP Port", HFILL }
1925 { &hf_cops_pc_srks_ip_port,
1926 { "SRKS IP Port", "cops.pc_srks_ip_port",
1927 FT_UINT16, BASE_HEX, NULL, 0x00,
1928 "SRKS IP Port", HFILL }
1930 { &hf_cops_pc_dest_port,
1931 { "Destination IP Port", "cops.pc_dest_port",
1932 FT_UINT16, BASE_HEX, NULL, 0x00,
1933 "Destination IP Port", HFILL }
1935 { &hf_cops_pc_packetcable_err_code,
1936 { "Error Code", "cops.pc_packetcable_err_code",
1937 FT_UINT16, BASE_HEX, NULL, 0x00,
1938 "Error Code", HFILL }
1940 { &hf_cops_pc_packetcable_sub_code,
1941 { "Error Sub Code", "cops.pc_packetcable_sub_code",
1942 FT_UINT16, BASE_HEX, NULL, 0x00,
1943 "Error Sub Code", HFILL }
1945 { &hf_cops_pc_remote_flags,
1946 { "Flags", "cops.pc_remote_flags",
1947 FT_UINT16, BASE_HEX, NULL, 0x00,
1950 { &hf_cops_pc_close_subcode,
1951 { "Reason Sub Code", "cops.pc_close_subcode",
1952 FT_UINT16, BASE_HEX, NULL, 0x00,
1953 "Reason Sub Code", HFILL }
1955 { &hf_cops_pc_gate_command_type,
1956 { "Gate Command Type", "cops.pc_gate_command_type",
1957 FT_UINT16, BASE_HEX, NULL, 0x00,
1958 "Gate Command Type", HFILL }
1960 { &hf_cops_pc_reason_code,
1961 { "Reason Code", "cops.pc_reason_code",
1962 FT_UINT16, BASE_HEX, NULL, 0x00,
1963 "Reason Code", HFILL }
1965 { &hf_cops_pc_delete_subcode,
1966 { "Reason Sub Code", "cops.pc_delete_subcode",
1967 FT_UINT16, BASE_HEX, NULL, 0x00,
1968 "Reason Sub Code", HFILL }
1970 { &hf_cops_pc_src_port,
1971 { "Source IP Port", "cops.pc_src_port",
1972 FT_UINT16, BASE_HEX, NULL, 0x00,
1973 "Source IP Port", HFILL }
1975 { &hf_cops_pc_t1_value,
1976 { "Timer T1 Value (sec)", "cops.pc_t1_value",
1977 FT_UINT16, BASE_HEX, NULL, 0x00,
1978 "Timer T1 Value (sec)", HFILL }
1980 { &hf_cops_pc_t7_value,
1981 { "Timer T7 Value (sec)", "cops.pc_t7_value",
1982 FT_UINT16, BASE_HEX, NULL, 0x00,
1983 "Timer T7 Value (sec)", HFILL }
1985 { &hf_cops_pc_t8_value,
1986 { "Timer T8 Value (sec)", "cops.pc_t8_value",
1987 FT_UINT16, BASE_HEX, NULL, 0x00,
1988 "Timer T8 Value (sec)", HFILL }
1990 { &hf_cops_pc_transaction_id,
1991 { "Transaction Identifier", "cops.pc_transaction_id",
1992 FT_UINT16, BASE_HEX, NULL, 0x00,
1993 "Transaction Identifier", HFILL }
1995 { &hf_cops_pc_cmts_ip,
1996 { "CMTS IP Address", "cops.pc_cmts_ip",
1997 FT_IPv4, BASE_HEX, NULL, 0x00,
1998 "CMTS IP Address", HFILL }
2000 { &hf_cops_pc_prks_ip,
2001 { "PRKS IP Address", "cops.pc_prks_ip",
2002 FT_IPv4, BASE_HEX, NULL, 0x00,
2003 "PRKS IP Address", HFILL }
2005 { &hf_cops_pc_srks_ip,
2006 { "SRKS IP Address", "cops.pc_srks_ip",
2007 FT_IPv4, BASE_HEX, NULL, 0x00,
2008 "SRKS IP Address", HFILL }
2010 { &hf_cops_pc_dfcdc_ip,
2011 { "DF IP Address CDC", "cops.pc_dfcdc_ip",
2012 FT_IPv4, BASE_HEX, NULL, 0x00,
2013 "DF IP Address CDC", HFILL }
2015 { &hf_cops_pc_dfccc_ip,
2016 { "DF IP Address CCC", "cops.pc_dfccc_ip",
2017 FT_IPv4, BASE_HEX, NULL, 0x00,
2018 "DF IP Address CCC", HFILL }
2020 { &hf_cops_pc_dfcdc_ip_port,
2021 { "DF IP Port CDC", "cops.pc_dfcdc_ip_port",
2022 FT_UINT16, BASE_HEX, NULL, 0x00,
2023 "DF IP Port CDC", HFILL }
2025 { &hf_cops_pc_dfccc_ip_port,
2026 { "DF IP Port CCC", "cops.pc_dfccc_ip_port",
2027 FT_UINT16, BASE_HEX, NULL, 0x00,
2028 "DF IP Port CCC", HFILL }
2030 { &hf_cops_pc_dfccc_id,
2031 { "CCC ID", "cops.pc_dfccc_id",
2032 FT_UINT32, BASE_DEC, NULL, 0x00,
2035 { &hf_cops_pc_activity_count,
2036 { "Count", "cops.pc_activity_count",
2037 FT_UINT32, BASE_HEX, NULL, 0x00,
2040 { &hf_cops_pc_dest_ip,
2041 { "Destination IP Address", "cops.pc_dest_ip",
2042 FT_IPv4, BASE_HEX, NULL, 0x00,
2043 "Destination IP Address", HFILL }
2045 { &hf_cops_pc_gate_id,
2046 { "Gate Identifier", "cops.pc_gate_id",
2047 FT_UINT32, BASE_HEX, NULL, 0x00,
2048 "Gate Identifier", HFILL }
2050 { &hf_cops_pc_max_packet_size,
2051 { "Maximum Packet Size", "cops.pc_max_packet_size",
2052 FT_UINT32, BASE_HEX, NULL, 0x00,
2053 "Maximum Packet Size", HFILL }
2055 { &hf_cops_pc_min_policed_unit,
2056 { "Minimum Policed Unit", "cops.pc_min_policed_unit",
2057 FT_UINT32, BASE_HEX, NULL, 0x00,
2058 "Minimum Policed Unit", HFILL }
2060 { &hf_cops_pc_peak_data_rate,
2061 { "Peak Data Rate", "cops.pc_peak_data_rate",
2062 FT_FLOAT, BASE_NONE, NULL, 0x00,
2063 "Peak Data Rate", HFILL }
2065 { &hf_cops_pc_spec_rate,
2066 { "Rate", "cops.pc_spec_rate",
2067 FT_FLOAT, BASE_NONE, NULL, 0x00,
2070 { &hf_cops_pc_remote_gate_id,
2071 { "Remote Gate ID", "cops.pc_remote_gate_id",
2072 FT_UINT32, BASE_HEX, NULL, 0x00,
2073 "Remote Gate ID", HFILL }
2075 { &hf_cops_pc_reserved,
2076 { "Reserved", "cops.pc_reserved",
2077 FT_UINT32, BASE_HEX, NULL, 0x00,
2081 { "Security Key", "cops.pc_key",
2082 FT_UINT32, BASE_HEX, NULL, 0x00,
2083 "Security Key", HFILL }
2085 { &hf_cops_pc_slack_term,
2086 { "Slack Term", "cops.pc_slack_term",
2087 FT_UINT32, BASE_HEX, NULL, 0x00,
2088 "Slack Term", HFILL }
2090 { &hf_cops_pc_src_ip,
2091 { "Source IP Address", "cops.pc_src_ip",
2092 FT_IPv4, BASE_HEX, NULL, 0x00,
2093 "Source IP Address", HFILL }
2095 { &hf_cops_pc_subscriber_id_ipv4,
2096 { "Subscriber Identifier (IPv4)", "cops.pc_subscriber_id4",
2097 FT_IPv4, BASE_HEX, NULL, 0x00,
2098 "Subscriber Identifier (IPv4)", HFILL }
2100 { &hf_cops_pc_subscriber_id_ipv6,
2101 { "Subscriber Identifier (IPv6)", "cops.pc_subscriber_id6",
2102 FT_IPv6, BASE_HEX, NULL, 0x00,
2103 "Subscriber Identifier (IPv6)", HFILL }
2105 { &hf_cops_pc_token_bucket_rate,
2106 { "Token Bucket Rate", "cops.pc_token_bucket_rate",
2107 FT_FLOAT, BASE_NONE, NULL, 0x00,
2108 "Token Bucket Rate", HFILL }
2110 { &hf_cops_pc_token_bucket_size,
2111 { "Token Bucket Size", "cops.pc_token_bucket_size",
2112 FT_FLOAT, BASE_NONE, NULL, 0x00,
2113 "Token Bucket Size", HFILL }
2116 { "Billing Correlation ID", "cops.pc_bcid",
2117 FT_UINT32, BASE_HEX, NULL, 0x00,
2118 "Billing Correlation ID", HFILL }
2120 { &hf_cops_pc_bcid_ts,
2121 { "BDID Timestamp", "cops.pc_bcid_ts",
2122 FT_UINT32, BASE_HEX, NULL, 0x00,
2123 "BCID Timestamp", HFILL }
2125 { &hf_cops_pc_bcid_ev,
2126 { "BDID Event Counter", "cops.pc_bcid_ev",
2127 FT_UINT32, BASE_HEX, NULL, 0x00,
2128 "BCID Event Counter", HFILL }
2131 { &hf_cops_pcmm_amid,
2132 { "AMID", "cops.pc_mm_amid",
2133 FT_UINT32, BASE_DEC, NULL, 0,
2134 "PacketCable Multimedia AMID", HFILL }
2137 { &hf_cops_pcmm_gate_spec_flags,
2138 { "Flags", "cops.pc_mm_gs_flags",
2139 FT_UINT8, BASE_HEX, NULL, 0,
2140 "PacketCable Multimedia GateSpec Flags", HFILL }
2142 { &hf_cops_pcmm_gate_spec_dscp_tos_field,
2143 { "DSCP/TOS Field", "cops.pc_mm_gs_dscp",
2144 FT_UINT8, BASE_HEX, NULL, 0,
2145 "PacketCable Multimedia GateSpec DSCP/TOS Field", HFILL }
2147 { &hf_cops_pcmm_gate_spec_dscp_tos_mask,
2148 { "DSCP/TOS Mask", "cops.pc_mm_gs_dscp_mask",
2149 FT_UINT8, BASE_HEX, NULL, 0,
2150 "PacketCable Multimedia GateSpec DSCP/TOS Mask", HFILL }
2152 { &hf_cops_pcmm_gate_spec_session_class_id,
2153 { "SessionClassID", "cops.pc_mm_gs_scid",
2154 FT_UINT8, BASE_DEC, NULL, 0,
2155 "PacketCable Multimedia GateSpec SessionClassID", HFILL }
2157 { &hf_cops_pcmm_gate_spec_session_class_id_priority,
2158 { "SessionClassID Priority", "cops.pc_mm_gs_scid_prio",
2159 FT_UINT8, BASE_DEC, NULL, 0x07,
2160 "PacketCable Multimedia GateSpec SessionClassID Priority", HFILL }
2162 { &hf_cops_pcmm_gate_spec_session_class_id_preemption,
2163 { "SessionClassID Preemption", "cops.pc_mm_gs_scid_preempt",
2164 FT_UINT8, BASE_DEC, NULL, 0x08,
2165 "PacketCable Multimedia GateSpec SessionClassID Preemption", HFILL }
2167 { &hf_cops_pcmm_gate_spec_session_class_id_configurable,
2168 { "SessionClassID Configurable", "cops.pc_mm_gs_scid_conf",
2169 FT_UINT8, BASE_DEC, NULL, 0xf0,
2170 "PacketCable Multimedia GateSpec SessionClassID Configurable", HFILL }
2172 { &hf_cops_pcmm_gate_spec_timer_t1,
2173 { "Timer T1", "cops.pc_mm_gs_timer_t1",
2174 FT_UINT16, BASE_DEC, NULL, 0,
2175 "PacketCable Multimedia GateSpec Timer T1", HFILL }
2177 { &hf_cops_pcmm_gate_spec_timer_t2,
2178 { "Timer T2", "cops.pc_mm_gs_timer_t2",
2179 FT_UINT16, BASE_DEC, NULL, 0,
2180 "PacketCable Multimedia GateSpec Timer T2", HFILL }
2182 { &hf_cops_pcmm_gate_spec_timer_t3,
2183 { "Timer T3", "cops.pc_mm_gs_timer_t3",
2184 FT_UINT16, BASE_DEC, NULL, 0,
2185 "PacketCable Multimedia GateSpec Timer T3", HFILL }
2187 { &hf_cops_pcmm_gate_spec_timer_t4,
2188 { "Timer T4", "cops.pc_mm_gs_timer_t4",
2189 FT_UINT16, BASE_DEC, NULL, 0,
2190 "PacketCable Multimedia GateSpec Timer T4", HFILL }
2193 { &hf_cops_pcmm_classifier_protocol_id,
2194 { "Protocol ID", "cops.pc_mm_classifier_proto_id",
2195 FT_UINT16, BASE_HEX, NULL, 0,
2196 "PacketCable Multimedia Classifier Protocol ID", HFILL }
2198 { &hf_cops_pcmm_classifier_dscp_tos_field,
2199 { "DSCP/TOS Field", "cops.pc_mm_classifier_dscp",
2200 FT_UINT8, BASE_HEX, NULL, 0,
2201 "PacketCable Multimedia Classifier DSCP/TOS Field", HFILL }
2203 { &hf_cops_pcmm_classifier_dscp_tos_mask,
2204 { "DSCP/TOS Mask", "cops.pc_mm_classifier_dscp_mask",
2205 FT_UINT8, BASE_HEX, NULL, 0,
2206 "PacketCable Multimedia Classifer DSCP/TOS Mask", HFILL }
2208 { &hf_cops_pcmm_classifier_src_addr,
2209 { "Source address", "cops.pc_mm_classifier_src_addr",
2210 FT_IPv4, 0, NULL, 0,
2211 "PacketCable Multimedia Classifier Source IP Address", HFILL }
2213 { &hf_cops_pcmm_classifier_dst_addr,
2214 { "Destination address", "cops.pc_mm_classifier_dst_addr",
2215 FT_IPv4, 0, NULL, 0,
2216 "PacketCable Multimedia Classifier Destination IP Address", HFILL }
2218 { &hf_cops_pcmm_classifier_src_port,
2219 { "Source Port", "cops.pc_mm_classifier_src_port",
2220 FT_UINT16, BASE_DEC, NULL, 0,
2221 "PacketCable Multimedia Classifier Source Port", HFILL }
2223 { &hf_cops_pcmm_classifier_dst_port,
2224 { "Destination Port", "cops.pc_mm_classifier_dst_port",
2225 FT_UINT16, BASE_DEC, NULL, 0,
2226 "PacketCable Multimedia Classifier Source Port", HFILL }
2228 { &hf_cops_pcmm_classifier_priority,
2229 { "Priority", "cops.pc_mm_classifier_priority",
2230 FT_UINT8, BASE_HEX, NULL, 0,
2231 "PacketCable Multimedia Classifier Priority", HFILL }
2234 { &hf_cops_pcmm_flow_spec_envelope,
2235 { "Envelope", "cops.pc_mm_fs_envelope",
2236 FT_UINT8, BASE_DEC, NULL, 0,
2237 "PacketCable Multimedia Flow Spec Envelope", HFILL }
2239 { &hf_cops_pcmm_flow_spec_service_number,
2240 { "Service Number", "cops.pc_mm_fs_svc_num",
2241 FT_UINT8, BASE_DEC, pcmm_flow_spec_service_vals, 0,
2242 "PacketCable Multimedia Flow Spec Service Number", HFILL }
2245 { &hf_cops_pcmm_docsis_scn,
2246 { "Service Class Name", "cops.pc_mm_docsis_scn",
2247 FT_STRINGZ, BASE_DEC, NULL, 0,
2248 "PacketCable Multimedia DOCSIS Service Class Name", HFILL }
2251 { &hf_cops_pcmm_envelope,
2252 { "Envelope", "cops.pc_mm_envelope",
2253 FT_UINT8, BASE_DEC, NULL, 0,
2254 "PacketCable Multimedia Envelope", HFILL }
2257 { &hf_cops_pcmm_traffic_priority,
2258 { "Traffic Priority", "cops.pc_mm_tp",
2259 FT_UINT8, BASE_DEC, NULL, 0,
2260 "PacketCable Multimedia Committed Envelope Traffic Priority", HFILL }
2262 { &hf_cops_pcmm_request_transmission_policy,
2263 { "Request Transmission Policy", "cops.pc_mm_rtp",
2264 FT_UINT32, BASE_HEX, NULL, 0,
2265 "PacketCable Multimedia Committed Envelope Traffic Priority", HFILL }
2267 { &hf_cops_pcmm_max_sustained_traffic_rate,
2268 { "Maximum Sustained Traffic Rate", "cops.pc_mm_mstr",
2269 FT_UINT32, BASE_DEC, NULL, 0,
2270 "PacketCable Multimedia Committed Envelope Maximum Sustained Traffic Rate", HFILL }
2272 { &hf_cops_pcmm_max_traffic_burst,
2273 { "Maximum Traffic Burst", "cops.pc_mm_mtb",
2274 FT_UINT32, BASE_DEC, NULL, 0,
2275 "PacketCable Multimedia Committed Envelope Maximum Traffic Burst", HFILL }
2277 { &hf_cops_pcmm_min_reserved_traffic_rate,
2278 { "Minimum Reserved Traffic Rate", "cops.pc_mm_mrtr",
2279 FT_UINT32, BASE_DEC, NULL, 0,
2280 "PacketCable Multimedia Committed Envelope Minimum Reserved Traffic Rate", HFILL }
2282 { &hf_cops_pcmm_ass_min_rtr_packet_size,
2283 { "Assumed Minimum Reserved Traffic Rate Packet Size", "cops.pc_mm_amrtrps",
2284 FT_UINT16, BASE_DEC, NULL, 0,
2285 "PacketCable Multimedia Committed Envelope Assumed Minimum Reserved Traffic Rate Packet Size", HFILL }
2288 { &hf_cops_pcmm_nominal_polling_interval,
2289 { "Nominal Polling Interval", "cops.pc_mm_npi",
2290 FT_UINT32, BASE_DEC, NULL, 0,
2291 "PacketCable Multimedia Nominal Polling Interval", HFILL }
2294 { &hf_cops_pcmm_tolerated_poll_jitter,
2295 { "Tolerated Poll Jitter", "cops.pc_mm_tpj",
2296 FT_UINT32, BASE_DEC, NULL, 0,
2297 "PacketCable Multimedia Tolerated Poll Jitter", HFILL }
2300 { &hf_cops_pcmm_unsolicited_grant_size,
2301 { "Unsolicited Grant Size", "cops.pc_mm_ugs",
2302 FT_UINT16, BASE_DEC, NULL, 0,
2303 "PacketCable Multimedia Unsolicited Grant Size", HFILL }
2305 { &hf_cops_pcmm_grants_per_interval,
2306 { "Grants Per Interval", "cops.pc_mm_gpi",
2307 FT_UINT8, BASE_DEC, NULL, 0,
2308 "PacketCable Multimedia Grants Per Interval", HFILL }
2310 { &hf_cops_pcmm_nominal_grant_interval,
2311 { "Nominal Grant Interval", "cops.pc_mm_ngi",
2312 FT_UINT32, BASE_DEC, NULL, 0,
2313 "PacketCable Multimedia Nominal Grant Interval", HFILL }
2315 { &hf_cops_pcmm_tolerated_grant_jitter,
2316 { "Tolerated Grant Jitter", "cops.pc_mm_tgj",
2317 FT_UINT32, BASE_DEC, NULL, 0,
2318 "PacketCable Multimedia Tolerated Grant Jitter", HFILL }
2321 { &hf_cops_pcmm_max_downstream_latency,
2322 { "Maximum Downstream Latency", "cops.pc_mm_mdl",
2323 FT_UINT32, BASE_DEC, NULL, 0,
2324 "PacketCable Multimedia Maximum Downstream Latency", HFILL }
2327 { &hf_cops_pcmm_volume_based_usage_limit,
2328 { "Usage Limit", "cops.pc_mm_vbul_ul",
2329 FT_UINT64, BASE_DEC, NULL, 0,
2330 "PacketCable Multimedia Volume-Based Usage Limit", HFILL }
2333 { &hf_cops_pcmm_time_based_usage_limit,
2334 { "Usage Limit", "cops.pc_mm_tbul_ul",
2335 FT_UINT32, BASE_DEC, NULL, 0,
2336 "PacketCable Multimedia Time-Based Usage Limit", HFILL }
2339 { &hf_cops_pcmm_gate_time_info,
2340 { "Gate Time Info", "cops.pc_mm_gti",
2341 FT_UINT32, BASE_DEC, NULL, 0,
2342 "PacketCable Multimedia Gate Time Info", HFILL }
2345 { &hf_cops_pcmm_gate_usage_info,
2346 { "Gate Usage Info", "cops.pc_mm_gui",
2347 FT_UINT32, BASE_DEC, NULL, 0,
2348 "PacketCable Multimedia Gate Usage Info", HFILL }
2351 { &hf_cops_pcmm_packetcable_error_code,
2352 { "Error-Code", "cops.pc_mm_error_ec",
2353 FT_UINT16, BASE_DEC, NULL, 0,
2354 "PacketCable Multimedia PacketCable-Error Error-Code", HFILL }
2356 { &hf_cops_pcmm_packetcable_error_subcode,
2357 { "Error-code", "cops.pc_mm_error_esc",
2358 FT_UINT16, BASE_HEX, NULL, 0,
2359 "PacketCable Multimedia PacketCable-Error Error Sub-code", HFILL }
2362 { &hf_cops_pcmm_packetcable_gate_state,
2363 { "State", "cops.pc_mm_gs_state",
2364 FT_UINT16, BASE_DEC, NULL, 0,
2365 "PacketCable Multimedia Gate State", HFILL }
2367 { &hf_cops_pcmm_packetcable_gate_state_reason,
2368 { "Reason", "cops.pc_mm_gs_reason",
2369 FT_UINT16, BASE_HEX, NULL, 0,
2370 "PacketCable Multimedia Gate State Reason", HFILL }
2372 { &hf_cops_pcmm_packetcable_version_info_major,
2373 { "Major Version Number", "cops.pc_mm_vi_major",
2374 FT_UINT16, BASE_DEC, NULL, 0,
2375 "PacketCable Multimedia Major Version Number", HFILL }
2377 { &hf_cops_pcmm_packetcable_version_info_minor,
2378 { "Minor Version Number", "cops.pc_mm_vi_minor",
2379 FT_UINT16, BASE_DEC, NULL, 0,
2380 "PacketCable Multimedia Minor Version Number", HFILL }
2383 /* End of addition for PacketCable */
2387 /* Setup protocol subtree array */
2388 static gint *ett[] = {
2390 &ett_cops_ver_flags,
2394 &ett_cops_r_type_flags,
2405 &ett_docsis_request_transmission_policy,
2408 module_t* cops_module;
2410 /* Register the protocol name and description */
2411 proto_cops = proto_register_protocol("Common Open Policy Service",
2414 /* Required function calls to register the header fields and subtrees used */
2415 proto_register_field_array(proto_cops, hf, array_length(hf));
2416 proto_register_subtree_array(ett, array_length(ett));
2418 /* Register our configuration options for cops */
2419 cops_module = prefs_register_protocol(proto_cops, proto_reg_handoff_cops);
2420 prefs_register_uint_preference(cops_module,"tcp.cops_port",
2422 "Set the TCP port for COPS messages",
2423 10,&global_cops_tcp_port);
2424 prefs_register_bool_preference(cops_module, "desegment",
2425 "Reassemble COPS messages spanning multiple TCP segments",
2426 "Whether the COPS dissector should reassemble messages spanning multiple TCP segments."
2427 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
2430 /* For PacketCable */
2431 prefs_register_bool_preference(cops_module, "packetcable",
2432 "Decode for PacketCable clients",
2433 "Decode the COPS messages using PacketCable clients. (Select port 2126)",
2436 #ifdef HAVE_NET_SNMP /*enable preference only if compiled with NET-SNMP*/
2437 prefs_register_bool_preference(cops_module, "typefrommib",
2438 "Decode COPS-PR ASN.1 types by reading them\nfrom PIBs (converted to MIBs)",
2439 "Whether the COPS dissector should decode COPS-PR ASN.1 types based on data types read from packet or PIBs (converted to MIBs)",
2441 #endif /*HAVE_NET_SNMP*/
2444 void proto_reg_handoff_cops(void)
2446 static int cops_prefs_initialized = FALSE;
2447 static dissector_handle_t cops_handle;
2449 if (!cops_prefs_initialized) {
2450 cops_handle = create_dissector_handle(dissect_cops, proto_cops);
2451 cops_prefs_initialized = TRUE;
2453 dissector_delete("tcp.port",cops_tcp_port,cops_handle);
2455 /* Set our port numbers for future use */
2456 cops_tcp_port = global_cops_tcp_port;
2458 dissector_add("tcp.port", cops_tcp_port, cops_handle);
2459 dissector_add("tcp.port", TCP_PORT_PKTCABLE_COPS, cops_handle);
2460 dissector_add("tcp.port", TCP_PORT_PKTCABLE_MM_COPS, cops_handle);
2464 /* Additions for PacketCable ( Added by Dick Gooris, Lucent Technologies ) */
2466 /* Definitions for print formatting */
2467 /* XXX - Why don't we just use ftenum types here? */
2474 /* Print the translated information in the display gui in a formatted way
2476 * octets = The number of octets to obtain from the buffer
2478 * vsp = If not a NULL pointer, it points to an array with text
2480 * mode = 0 -> print decimal value
2481 * 1 -> print hexadecimal vaue
2482 * 2 -> print value as an IPv4 address
2483 * 3 -> print value as an IPv6 address
2484 * 4 -> print value as an IEEE float
2486 * This function in combination with the separate function info_to_cops_subtree() for subtrees.
2491 info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, const char *str, const value_string *vsp, int mode,gint *hf_proto_parameter)
2493 proto_item *pi = NULL;
2496 guint32 codeipv4 = 0;
2500 /* Print information elements in the specified way */
2505 code8 = tvb_get_guint8( tvb, offset );
2507 /* Hexadecimal format */
2509 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2510 offset, octets, code8,"%-28s : 0x%02x",str,code8);
2512 /* Print an 8 bits integer */
2513 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2514 offset, octets, code8,"%-28s : %u",str,code8);
2517 /* Hexadecimal format */
2518 pi = proto_tree_add_uint_format(
2519 stt, *hf_proto_parameter,tvb, offset, octets, code8,
2520 "%-28s : %s (0x%02x)",str,val_to_str(code8, vsp, "Unknown"),code8);
2522 /* String table indexed */
2523 pi = proto_tree_add_uint_format(
2524 stt, *hf_proto_parameter,tvb, offset, octets, code8,
2525 "%-28s : %s (%u)",str,val_to_str(code8, vsp, "Unknown"),code8);
2531 /* Get the next two octets */
2532 code16 = tvb_get_ntohs(tvb,offset);
2534 /* Hexadecimal format */
2536 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2537 offset, octets, code16,"%-28s : 0x%04x",str,code16);
2539 /* Print a 16 bits integer */
2540 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2541 offset, octets, code16,"%-28s : %u",str,code16);
2544 /* Hexadecimal format */
2545 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2546 offset, octets, code16,"%-28s : %s (0x%04x)", str,
2547 val_to_str(code16, vsp, "Unknown (0x%04x)"),code16);
2549 /* Print a 16 bits integer */
2550 pi = proto_tree_add_uint_format(
2551 stt, *hf_proto_parameter,tvb, offset, octets, code16,
2552 "%-28s : %s (%u)",str,val_to_str(code16, vsp, "Unknown (0x%04x)"),code16);
2558 /* Get the next four octets */
2560 case FMT_FLT: codefl = tvb_get_ntohieee_float(tvb,offset);
2562 case FMT_IPv4: codeipv4 = tvb_get_ipv4(tvb, offset);
2564 default: code32 = tvb_get_ntohl(tvb,offset);
2568 /* Hexadecimal format */
2569 if (mode==FMT_HEX) {
2570 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2571 offset, octets, code32,"%-28s : 0x%08x",str,code32);
2574 /* Ip address format*/
2575 if (mode==FMT_IPv4) {
2576 pi = proto_tree_add_ipv4(stt, *hf_proto_parameter,tvb, offset, octets, codeipv4);
2579 /* Ieee float format */
2580 if (mode==FMT_FLT) {
2581 pi = proto_tree_add_float_format(stt, *hf_proto_parameter,tvb, offset, octets,
2582 codefl,"%-28s : %.10g",str,codefl);
2585 /* Print a 32 bits integer */
2586 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
2587 code32,"%-28s : %u",str,code32);
2589 /* Hexadecimal format */
2591 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
2592 code32,"%-28s : %s (0x%08x)",str,val_to_str(code32, vsp, "Unknown"),code32);
2594 /* String table indexed */
2595 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
2596 code32,"%-28s : %s (%u)",str,val_to_str(code32, vsp, "Unknown"),code32);
2600 /* In case of more than 4 octets.... */
2602 if (mode==FMT_HEX) {
2603 pi = proto_tree_add_bytes(stt, *hf_proto_parameter,
2604 tvb, offset, octets, tvb_get_ptr(tvb, offset,octets));
2605 } else if (mode==FMT_IPv6 && octets==16) {
2606 pi = proto_tree_add_ipv6(stt, *hf_proto_parameter, tvb, offset, octets,
2607 tvb_get_ptr(tvb, offset, octets));
2609 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,
2610 tvb, offset, octets, code32,"%s",str);
2619 /* Print the subtree information for cops */
2621 info_to_cops_subtree(tvbuff_t *tvb, proto_tree *st, int n, int offset, const char *str) {
2624 tv = proto_tree_add_uint_format( st, hf_cops_subtree, tvb, offset, n, (guint)NULL, str);
2625 return( proto_item_add_subtree( tv, ett_cops_subtree ) );
2628 /* Cops - Section : D-QoS Transaction ID */
2630 cops_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8 op_code, guint n, guint32 offset) {
2636 /* Create a subtree */
2637 stt = info_to_cops_subtree(tvb,st,n,offset,"D-QoS Transaction ID");
2640 /* Transaction Identifier */
2641 info_to_display(tvb,stt,offset,2,"D-QoS Transaction Identifier", NULL,FMT_DEC,&hf_cops_pc_transaction_id);
2644 /* Gate Command Type */
2645 code16 = tvb_get_ntohs(tvb,offset);
2646 proto_tree_add_uint_format(stt, hf_cops_pc_gate_command_type,tvb, offset, 2,
2647 code16,"%-28s : %s (%u)", "Gate Command Type",
2648 val_to_str(code16,table_cops_dqos_transaction_id, "Unknown (0x%04x)"),code16);
2650 /* Write the right data into the 'info field' on the Gui */
2651 g_snprintf(info,sizeof(info),"COPS %-20s - ",val_to_str(op_code,cops_op_code_vals, "Unknown"));
2652 strcat(info,val_to_str(code16,table_cops_dqos_transaction_id, "Unknown"));
2654 if (check_col(pinfo->cinfo, COL_INFO)) {
2655 col_clear(pinfo->cinfo, COL_INFO);
2656 col_add_str(pinfo->cinfo, COL_INFO,info);
2661 /* Cops - Section : Subscriber IDv4 */
2663 cops_subscriber_id_v4(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
2667 /* Create a subtree */
2668 tv = info_to_cops_subtree(tvb,st,n,offset,"Subscriber ID (IPv4)");
2671 /* Subscriber Identifier */
2672 info_to_display(tvb,tv,offset,4,"Subscriber Identifier (IPv4)", NULL,FMT_IPv4,&hf_cops_pc_subscriber_id_ipv4);
2675 /* Cops - Section : Subscriber IDv6 */
2677 cops_subscriber_id_v6(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
2681 /* Create a subtree */
2682 tv = info_to_cops_subtree(tvb,st,n,offset,"Subscriber ID (IPv6)");
2685 /* Subscriber Identifier */
2686 info_to_display(tvb,tv,offset,16,"Subscriber Identifier (IPv6)", NULL,FMT_IPv6,&hf_cops_pc_subscriber_id_ipv6);
2689 /* Cops - Section : Gate ID */
2691 cops_gate_id(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
2695 /* Create a subtree */
2696 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate ID");
2699 /* Gate Identifier */
2700 info_to_display(tvb,stt,offset,4,"Gate Identifier", NULL,FMT_HEX,&hf_cops_pc_gate_id);
2703 /* Cops - Section : Activity Count */
2705 cops_activity_count(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
2709 /* Create a subtree */
2710 stt = info_to_cops_subtree(tvb,st,n,offset,"Activity Count");
2713 /* Activity Count */
2714 info_to_display(tvb,stt,offset,4,"Count", NULL,FMT_DEC,&hf_cops_pc_activity_count);
2717 /* Cops - Section : Gate Specifications */
2719 cops_gate_specs(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
2723 /* Create a subtree */
2724 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Specifications");
2728 info_to_display(tvb,stt,offset,1,"Direction",table_cops_direction,FMT_DEC,&hf_cops_pc_direction);
2732 info_to_display(tvb,stt,offset,1,"Protocol ID",NULL,FMT_DEC,&hf_cops_pc_protocol_id);
2736 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_DEC,&hf_cops_pc_gate_spec_flags);
2740 info_to_display(tvb,stt,offset,1,"Session Class",table_cops_session_class,FMT_DEC,&hf_cops_pc_session_class);
2743 /* Source IP Address */
2744 info_to_display(tvb,stt,offset,4,"Source IP Address",NULL,FMT_IPv4,&hf_cops_pc_src_ip);
2747 /* Destination IP Address */
2748 info_to_display(tvb,stt,offset,4,"Destination IP Address",NULL,FMT_IPv4,&hf_cops_pc_dest_ip);
2751 /* Source IP Port */
2752 info_to_display(tvb,stt,offset,2,"Source IP Port",NULL,FMT_DEC,&hf_cops_pc_src_port);
2755 /* Destination IP Port */
2756 info_to_display(tvb,stt,offset,2,"Destination IP Port",NULL,FMT_DEC,&hf_cops_pc_dest_port);
2759 /* DiffServ Code Point */
2760 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS)",NULL,FMT_HEX,&hf_cops_pc_ds_field);
2763 /* 3 octets Not specified */
2766 /* Timer T1 Value */
2767 info_to_display(tvb,stt,offset,2,"Timer T1 Value (sec)",NULL,FMT_DEC,&hf_cops_pc_t1_value);
2771 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_DEC,&hf_cops_pc_reserved);
2774 /* Timer T7 Value */
2775 info_to_display(tvb,stt,offset,2,"Timer T7 Value (sec)",NULL,FMT_DEC,&hf_cops_pc_t7_value);
2778 /* Timer T8 Value */
2779 info_to_display(tvb,stt,offset,2,"Timer T8 Value (sec)",NULL,FMT_DEC,&hf_cops_pc_t8_value);
2782 /* Token Bucket Rate */
2783 info_to_display(tvb,stt,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
2786 /* Token Bucket Size */
2787 info_to_display(tvb,stt,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
2790 /* Peak Data Rate */
2791 info_to_display(tvb,stt,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
2794 /* Minimum Policed Unit */
2795 info_to_display(tvb,stt,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
2798 /* Maximum Packet Size */
2799 info_to_display(tvb,stt,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
2803 info_to_display(tvb,stt,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
2807 info_to_display(tvb,stt,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
2810 /* Cops - Section : Electronic Surveillance Parameters */
2812 cops_surveillance_parameters(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
2817 /* Create a subtree */
2818 stt = info_to_cops_subtree(tvb,st,n,offset,"Electronic Surveillance Parameters");
2821 /* DF IP Address for CDC */
2822 info_to_display(tvb,stt,offset,4,"DF IP Address for CDC", NULL,FMT_IPv4,&hf_cops_pc_dfcdc_ip);
2825 /* DF IP Port for CDC */
2826 info_to_display(tvb,stt,offset,2,"DF IP Port for CDC",NULL,FMT_DEC,&hf_cops_pc_dfcdc_ip_port);
2830 info_to_display(tvb,stt,offset,2,"Flags",NULL,FMT_HEX,&hf_cops_pc_gate_spec_flags);
2833 /* DF IP Address for CCC */
2834 info_to_display(tvb,stt,offset,4,"DF IP Address for CCC", NULL,FMT_IPv4,&hf_cops_pc_dfccc_ip);
2837 /* DF IP Port for CCC */
2838 info_to_display(tvb,stt,offset,2,"DF IP Port for CCC",NULL,FMT_DEC,&hf_cops_pc_dfccc_ip_port);
2842 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
2846 info_to_display(tvb,stt,offset,4,"CCCID", NULL,FMT_DEC,&hf_cops_pc_dfccc_id);
2849 /* BCID Timestamp */
2850 info_to_display(tvb,stt,offset,4,"BCID - Timestamp",NULL,FMT_HEX,&hf_cops_pc_bcid_ts);
2853 /* BCID Element ID */
2854 bcid_str = tvb_format_text(tvb, offset, 8);
2855 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Element ID",bcid_str);
2858 /* BCID Time Zone */
2859 bcid_str = tvb_format_text(tvb, offset, 8);
2860 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Time Zone",bcid_str);
2863 /* BCID Event Counter */
2864 info_to_display(tvb,stt,offset,4,"BCID - Event Counter",NULL,FMT_DEC,&hf_cops_pc_bcid_ev);
2867 /* Cops - Section : Event Gereration-Info */
2869 cops_event_generation_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
2874 /* Create a subtree */
2875 stt = info_to_cops_subtree(tvb,st,n,offset,"Event Generation Info");
2878 /* Primary Record Keeping Server IP Address */
2879 info_to_display(tvb,stt,offset,4,"PRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_prks_ip);
2882 /* Primary Record Keeping Server IP Port */
2883 info_to_display(tvb,stt,offset,2,"PRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_prks_ip_port);
2887 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_HEX,&hf_cops_pc_gate_spec_flags);
2891 info_to_display(tvb,stt,offset,1,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
2894 /* Secondary Record Keeping Server IP Address */
2895 info_to_display(tvb,stt,offset,4,"SRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_srks_ip);
2898 /* Secondary Record Keeping Server IP Port */
2899 info_to_display(tvb,stt,offset,2,"SRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_srks_ip_port);
2903 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_DEC,&hf_cops_pc_gate_spec_flags);
2907 info_to_display(tvb,stt,offset,1,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
2910 /* BCID Timestamp */
2911 info_to_display(tvb,stt,offset,4,"BCID - Timestamp",NULL,FMT_HEX,&hf_cops_pc_bcid_ts);
2914 /* BCID Element ID */
2915 bcid_str = tvb_format_text(tvb, offset, 8);
2916 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Element ID",bcid_str);
2919 /* BCID Time Zone */
2920 bcid_str = tvb_format_text(tvb, offset, 8);
2921 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Time Zone",bcid_str);
2924 /* BCID Event Counter */
2925 info_to_display(tvb,stt,offset,4,"BCID - Event Counter",NULL,FMT_DEC,&hf_cops_pc_bcid_ev);
2928 /* Cops - Section : Remote Gate */
2930 cops_remote_gate_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
2934 /* Create a subtree */
2935 stt = info_to_cops_subtree(tvb,st,n,offset,"Remote Gate Info");
2938 /* CMTS IP Address */
2939 info_to_display(tvb,stt,offset,4,"CMTS IP Address", NULL,FMT_IPv4,&hf_cops_pc_cmts_ip);
2943 info_to_display(tvb,stt,offset,2,"CMTS IP Port",NULL,FMT_DEC,&hf_cops_pc_cmts_ip_port);
2947 info_to_display(tvb,stt,offset,2,"Flags",NULL,FMT_DEC,&hf_cops_pc_remote_flags);
2950 /* Remote Gate ID */
2951 info_to_display(tvb,stt,offset,4,"Remote Gate ID", NULL,FMT_HEX,&hf_cops_pc_remote_gate_id);
2955 info_to_display(tvb,stt,offset,2,"Algorithm", NULL,FMT_DEC,&hf_cops_pc_algorithm);
2959 info_to_display(tvb,stt,offset,4,"Reserved", NULL,FMT_HEX,&hf_cops_pc_reserved);
2963 info_to_display(tvb,stt,offset,4,"Security Key", NULL,FMT_HEX,&hf_cops_pc_key);
2967 info_to_display(tvb,stt,offset,4,"Security Key (cont)", NULL,FMT_HEX,&hf_cops_pc_key);
2971 info_to_display(tvb,stt,offset,4,"Security Key (cont)", NULL,FMT_HEX,&hf_cops_pc_key);
2975 info_to_display(tvb,stt,offset,4,"Security Key (cont)", NULL,FMT_HEX,&hf_cops_pc_key);
2978 /* Cops - Section : PacketCable reason */
2980 cops_packetcable_reason(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
2985 /* Create a subtree */
2986 stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Reason");
2990 code16 = tvb_get_ntohs(tvb,offset);
2991 proto_tree_add_uint_format(stt, hf_cops_pc_reason_code,tvb, offset, 2,
2992 code16, "%-28s : %s (%u)","Reason Code",
2993 val_to_str(code16, table_cops_reason_code, "Unknown (0x%04x)"),code16);
2996 if ( code16 == 0 ) {
2997 /* Reason Sub Code with Delete */
2998 info_to_display(tvb,stt,offset,2,"Reason Sub Code",table_cops_reason_subcode_delete,FMT_DEC,&hf_cops_pc_delete_subcode);
3000 /* Reason Sub Code with Close */
3001 info_to_display(tvb,stt,offset,2,"Reason Sub Code",table_cops_reason_subcode_close,FMT_DEC,&hf_cops_pc_close_subcode);
3005 /* Cops - Section : PacketCable error */
3007 cops_packetcable_error(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3011 /* Create a subtree */
3012 stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Error");
3016 info_to_display(tvb,stt,offset,2,"Error Code",table_cops_packetcable_error,FMT_DEC,&hf_cops_pc_packetcable_err_code);
3019 /* Error Sub Code */
3020 info_to_display(tvb,stt,offset,2,"Error Sub Code",NULL,FMT_HEX,&hf_cops_pc_packetcable_sub_code);
3024 /* Cops - Section : Multimedia Transaction ID */
3026 cops_mm_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8 op_code, guint n, guint32 offset) {
3032 /* Create a subtree */
3033 stt = info_to_cops_subtree(tvb,st,n,offset,"MM Transaction ID");
3036 /* Transaction Identifier */
3037 info_to_display(tvb,stt,offset,2,"Multimedia Transaction Identifier", NULL,FMT_DEC,&hf_cops_pc_transaction_id);
3040 /* Gate Command Type */
3041 code16 = tvb_get_ntohs(tvb,offset);
3042 proto_tree_add_uint_format(stt, hf_cops_pc_gate_command_type,tvb, offset, 2,
3043 code16,"%-28s : %s (%u)", "Gate Command Type",
3044 val_to_str(code16,table_cops_mm_transaction_id, "Unknown (0x%04x)"),code16);
3046 /* Write the right data into the 'info field' on the Gui */
3047 g_snprintf(info,sizeof(info),"COPS %-20s - ",val_to_str(op_code,cops_op_code_vals, "Unknown"));
3048 strcat(info,val_to_str(code16,table_cops_mm_transaction_id, "Unknown"));
3050 if (check_col(pinfo->cinfo, COL_INFO)) {
3051 col_clear(pinfo->cinfo, COL_INFO);
3052 col_add_str(pinfo->cinfo, COL_INFO,info);
3057 /* Cops - Section : AMID */
3059 cops_amid(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3063 /* Create a subtree */
3064 stt = info_to_cops_subtree(tvb,st,n,offset,"AMID");
3067 /* Gate Identifier */
3068 info_to_display(tvb,stt,offset,4,"Application Manager ID", NULL,FMT_DEC,&hf_cops_pcmm_amid);
3072 /* Cops - Section : Multimedia Gate Specifications */
3074 cops_mm_gate_spec(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3076 proto_tree *stt, *object_tree;
3079 /* Create a subtree */
3080 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Spec");
3084 gs_flags = tvb_get_guint8(tvb, offset);
3085 ti = info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_HEX,&hf_cops_pcmm_gate_spec_flags);
3086 object_tree = proto_item_add_subtree(ti, ett_cops_subtree );
3087 proto_tree_add_text(object_tree, tvb, offset, 1, "%s gate",
3088 decode_boolean_bitfield(gs_flags, 1 << 0, 8,
3089 "Upstream", "Downstream"));
3090 proto_tree_add_text(object_tree, tvb, offset, 1, "%s DSCP/TOS overwrite",
3091 decode_boolean_bitfield(gs_flags, 1 << 1, 8,
3092 "Enable", "Disable"));
3095 /* DiffServ Code Point */
3096 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS)",NULL,FMT_HEX,&hf_cops_pcmm_gate_spec_dscp_tos_field);
3099 /* DiffServ Code Point Mask */
3100 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS) Mask",NULL,FMT_HEX,&hf_cops_pcmm_gate_spec_dscp_tos_mask);
3104 ti = info_to_display(tvb,stt,offset,1,"Session Class",table_cops_session_class,FMT_DEC,&hf_cops_pcmm_gate_spec_session_class_id);
3105 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3106 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_session_class_id_priority, tvb, offset, 1, FALSE);
3107 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_session_class_id_preemption, tvb, offset, 1, FALSE);
3108 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_session_class_id_configurable, tvb, offset, 1, FALSE);
3111 /* Timer T1 Value */
3112 info_to_display(tvb,stt,offset,2,"Timer T1 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t1);
3115 /* Timer T2 Value */
3116 info_to_display(tvb,stt,offset,2,"Timer T2 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t2);
3119 /* Timer T3 Value */
3120 info_to_display(tvb,stt,offset,2,"Timer T3 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t3);
3123 /* Timer T4 Value */
3124 info_to_display(tvb,stt,offset,2,"Timer T4 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t4);
3128 /* Cops - Section : Classifier */
3130 cops_classifier(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3134 /* Create a subtree */
3135 stt = info_to_cops_subtree(tvb,st,n,offset,"Classifier");
3139 info_to_display(tvb,stt,offset,2,"Protocol ID",NULL,FMT_DEC,&hf_cops_pcmm_classifier_protocol_id);
3142 /* DiffServ Code Point */
3143 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS)",NULL,FMT_HEX,&hf_cops_pcmm_classifier_dscp_tos_field);
3146 /* DiffServ Code Point Mask */
3147 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS) Mask",NULL,FMT_HEX,&hf_cops_pcmm_classifier_dscp_tos_mask);
3150 /* Source IP Address */
3151 info_to_display(tvb,stt,offset,4,"Source IP Address",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_src_addr);
3154 /* Destination IP Address */
3155 info_to_display(tvb,stt,offset,4,"Destination IP Address",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_dst_addr);
3158 /* Source IP Port */
3159 info_to_display(tvb,stt,offset,2,"Source IP Port",NULL,FMT_DEC,&hf_cops_pcmm_classifier_src_port);
3162 /* Destination IP Port */
3163 info_to_display(tvb,stt,offset,2,"Destination IP Port",NULL,FMT_DEC,&hf_cops_pcmm_classifier_dst_port);
3167 info_to_display(tvb,stt,offset,1,"Priority",NULL,FMT_HEX,&hf_cops_pcmm_classifier_priority);
3170 /* 3 octets Not specified */
3174 /* Cops - Section : Gate Specifications */
3176 cops_flow_spec(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3178 proto_tree *stt, *object_tree;
3180 /* Create a subtree */
3181 stt = info_to_cops_subtree(tvb,st,n,offset,"Flow Spec");
3185 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_flow_spec_envelope);
3188 /* Service Number */
3189 info_to_display(tvb,stt,offset,1,"Service Number",NULL,FMT_DEC,&hf_cops_pcmm_flow_spec_service_number);
3193 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3196 /* Authorized Envelope */
3197 ti = proto_tree_add_text(stt, tvb, offset, 28, "Authorized Envelope");
3198 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3200 /* Token Bucket Rate */
3201 info_to_display(tvb,object_tree,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3204 /* Token Bucket Size */
3205 info_to_display(tvb,object_tree,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3208 /* Peak Data Rate */
3209 info_to_display(tvb,object_tree,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3212 /* Minimum Policed Unit */
3213 info_to_display(tvb,object_tree,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3216 /* Maximum Packet Size */
3217 info_to_display(tvb,object_tree,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3221 info_to_display(tvb,object_tree,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3225 info_to_display(tvb,object_tree,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3230 /* Reserved Envelope */
3231 ti = proto_tree_add_text(stt, tvb, offset, 28, "Reserved Envelope");
3232 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3234 /* Token Bucket Rate */
3235 info_to_display(tvb,object_tree,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3238 /* Token Bucket Size */
3239 info_to_display(tvb,object_tree,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3242 /* Peak Data Rate */
3243 info_to_display(tvb,object_tree,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3246 /* Minimum Policed Unit */
3247 info_to_display(tvb,object_tree,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3250 /* Maximum Packet Size */
3251 info_to_display(tvb,object_tree,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3255 info_to_display(tvb,object_tree,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3259 info_to_display(tvb,object_tree,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3264 /* Committed Envelope */
3265 ti = proto_tree_add_text(stt, tvb, offset, 28, "Committed Envelope");
3266 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3268 /* Token Bucket Rate */
3269 info_to_display(tvb,object_tree,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3272 /* Token Bucket Size */
3273 info_to_display(tvb,object_tree,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3276 /* Peak Data Rate */
3277 info_to_display(tvb,object_tree,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3280 /* Minimum Policed Unit */
3281 info_to_display(tvb,object_tree,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3284 /* Maximum Packet Size */
3285 info_to_display(tvb,object_tree,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3289 info_to_display(tvb,object_tree,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3293 info_to_display(tvb,object_tree,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3296 /* Cops - Section : DOCSIS Service Class Name */
3298 cops_docsis_service_class_name(tvbuff_t *tvb, proto_tree *st, guint object_len, guint32 offset) {
3302 /* Create a subtree */
3303 stt = info_to_cops_subtree(tvb,st,object_len,offset,"DOCSIS Service Class Name");
3307 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3310 proto_tree_add_text(stt, tvb, offset, 3, "Reserved");
3313 if (object_len >= 12) {
3314 proto_tree_add_item(stt, hf_cops_pcmm_docsis_scn, tvb, offset, object_len - 8, FALSE);
3315 offset += object_len - 8;
3317 proto_tree_add_text(stt, tvb, offset - 8, 2, "Invalid object length: %u", object_len);
3321 /* Cops - Section : Best Effort Service */
3323 cops_best_effort_service(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3325 proto_tree *stt, *object_tree;
3327 /* Create a subtree */
3328 stt = info_to_cops_subtree(tvb,st,n,offset,"Best Effort Service");
3332 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3335 proto_tree_add_text(stt, tvb, offset, 3, "Reserved");
3338 /* Authorized Envelope */
3339 ti = proto_tree_add_text(stt, tvb, offset, 24, "Authorized Envelope");
3340 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3342 /* Traffic Priority */
3343 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3346 proto_tree_add_text(object_tree, tvb, offset, 3, "Reserved");
3349 /* Request Transmission Policy */
3350 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3353 /* Maximum Sustained Traffic Rate */
3354 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3357 /* Maximum Traffic Burst */
3358 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3361 /* Minimum Reserved Traffic Rate */
3362 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3365 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3366 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3370 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3375 /* Reserved Envelope */
3376 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
3377 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3379 /* Traffic Priority */
3380 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3383 proto_tree_add_text(object_tree, tvb, offset, 3, "Reserved");
3386 /* Request Transmission Policy */
3387 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3390 /* Maximum Sustained Traffic Rate */
3391 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3394 /* Maximum Traffic Burst */
3395 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3398 /* Minimum Reserved Traffic Rate */
3399 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3402 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3403 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3407 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3412 /* Committed Envelope */
3413 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
3414 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3416 /* Traffic Priority */
3417 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3420 proto_tree_add_text(object_tree, tvb, offset, 3, "Reserved");
3423 /* Request Transmission Policy */
3424 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3427 /* Maximum Sustained Traffic Rate */
3428 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3431 /* Maximum Traffic Burst */
3432 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3435 /* Minimum Reserved Traffic Rate */
3436 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3439 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3440 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3444 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3448 /* Cops - Section : Non-Real-Time Polling Service */
3450 cops_non_real_time_polling_service(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3452 proto_tree *stt, *object_tree;
3454 /* Create a subtree */
3455 stt = info_to_cops_subtree(tvb,st,n,offset,"Non-Real-Time Polling Service");
3459 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3462 proto_tree_add_text(stt, tvb, offset, 3, "Reserved");
3465 /* Authorized Envelope */
3466 ti = proto_tree_add_text(stt, tvb, offset, 28, "Authorized Envelope");
3467 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3469 /* Traffic Priority */
3470 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3473 proto_tree_add_text(object_tree, tvb, offset, 3, "Reserved");
3476 /* Request Transmission Policy */
3477 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3480 /* Maximum Sustained Traffic Rate */
3481 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3484 /* Maximum Traffic Burst */
3485 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3488 /* Minimum Reserved Traffic Rate */
3489 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3492 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3493 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3497 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3500 /* Nominal Polling Interval */
3501 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
3506 /* Reserved Envelope */
3507 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
3508 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3510 /* Traffic Priority */
3511 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3514 proto_tree_add_text(object_tree, tvb, offset, 3, "Reserved");
3517 /* Request Transmission Policy */
3518 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3521 /* Maximum Sustained Traffic Rate */
3522 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3525 /* Maximum Traffic Burst */
3526 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3529 /* Minimum Reserved Traffic Rate */
3530 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3533 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3534 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3538 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3541 /* Nominal Polling Interval */
3542 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
3547 /* Committed Envelope */
3548 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
3549 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3551 /* Traffic Priority */
3552 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3555 proto_tree_add_text(object_tree, tvb, offset, 3, "Reserved");
3558 /* Request Transmission Policy */
3559 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3562 /* Maximum Sustained Traffic Rate */
3563 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3566 /* Maximum Traffic Burst */
3567 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3570 /* Minimum Reserved Traffic Rate */
3571 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3574 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3575 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3579 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3582 /* Nominal Polling Interval */
3583 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
3587 /* Cops - Section : Real-Time Polling Service */
3589 cops_real_time_polling_service(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3591 proto_tree *stt, *object_tree;
3593 /* Create a subtree */
3594 stt = info_to_cops_subtree(tvb,st,n,offset,"Real-Time Polling Service");
3598 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3601 proto_tree_add_text(stt, tvb, offset, 3, "Reserved");
3604 /* Authorized Envelope */
3605 ti = proto_tree_add_text(stt, tvb, offset, 28, "Authorized Envelope");
3606 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3608 /* Request Transmission Policy */
3609 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3612 /* Maximum Sustained Traffic Rate */
3613 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3616 /* Maximum Traffic Burst */
3617 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3620 /* Minimum Reserved Traffic Rate */
3621 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3624 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3625 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3629 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3632 /* Nominal Polling Interval */
3633 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
3636 /* Tolerated Poll Jitter */
3637 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
3642 /* Reserved Envelope */
3643 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
3644 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3646 /* Request Transmission Policy */
3647 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3650 /* Maximum Sustained Traffic Rate */
3651 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3654 /* Maximum Traffic Burst */
3655 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3658 /* Minimum Reserved Traffic Rate */
3659 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3662 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3663 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3667 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3670 /* Nominal Polling Interval */
3671 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
3674 /* Tolerated Poll Jitter */
3675 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
3680 /* Committed Envelope */
3681 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
3682 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3684 /* Request Transmission Policy */
3685 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3688 /* Maximum Sustained Traffic Rate */
3689 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3692 /* Maximum Traffic Burst */
3693 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3696 /* Minimum Reserved Traffic Rate */
3697 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3700 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3701 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3705 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3708 /* Nominal Polling Interval */
3709 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
3712 /* Tolerated Poll Jitter */
3713 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
3717 /* Cops - Section : Unsolicited Grant Service */
3719 cops_unsolicited_grant_service(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3721 proto_tree *stt, *object_tree;
3723 /* Create a subtree */
3724 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service");
3728 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3731 proto_tree_add_text(stt, tvb, offset, 3, "Reserved");
3734 /* Authorized Envelope */
3735 ti = proto_tree_add_text(stt, tvb, offset, 16, "Authorized Envelope");
3736 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3738 /* Request Transmission Policy */
3739 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3742 /* Unsolicited Grant Size */
3743 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
3746 /* Grants Per Interval */
3747 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
3750 proto_tree_add_text(object_tree, tvb, offset, 1, "Reserved");
3753 /* Nominal Grant Interval */
3754 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
3757 /* Tolerated Grant Jitter */
3758 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
3763 /* Reserved Envelope */
3764 ti = proto_tree_add_text(stt, tvb, offset, 16, "Reserved Envelope");
3765 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3767 /* Request Transmission Policy */
3768 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3771 /* Unsolicited Grant Size */
3772 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
3775 /* Grants Per Interval */
3776 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
3779 proto_tree_add_text(object_tree, tvb, offset, 1, "Reserved");
3782 /* Nominal Grant Interval */
3783 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
3786 /* Tolerated Grant Jitter */
3787 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
3792 /* Committed Envelope */
3793 ti = proto_tree_add_text(stt, tvb, offset, 16, "Committed Envelope");
3794 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3796 /* Request Transmission Policy */
3797 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3800 /* Unsolicited Grant Size */
3801 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
3804 /* Grants Per Interval */
3805 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
3808 proto_tree_add_text(object_tree, tvb, offset, 1, "Reserved");
3811 /* Nominal Grant Interval */
3812 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
3815 /* Tolerated Grant Jitter */
3816 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
3820 /* Cops - Section : Unsolicited Grant Service with Activity Detection */
3822 cops_ugs_with_activity_detection(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3824 proto_tree *stt, *object_tree;
3826 /* Create a subtree */
3827 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service with Activity Detection");
3831 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3834 proto_tree_add_text(stt, tvb, offset, 3, "Reserved");
3837 /* Authorized Envelope */
3838 ti = proto_tree_add_text(stt, tvb, offset, 24, "Authorized Envelope");
3839 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3841 /* Request Transmission Policy */
3842 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3845 /* Unsolicited Grant Size */
3846 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
3849 /* Grants Per Interval */
3850 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
3853 proto_tree_add_text(object_tree, tvb, offset, 1, "Reserved");
3856 /* Nominal Grant Interval */
3857 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
3860 /* Tolerated Grant Jitter */
3861 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
3864 /* Nominal Polling Interval */
3865 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
3868 /* Tolerated Poll Jitter */
3869 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
3874 /* Reserved Envelope */
3875 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
3876 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3878 /* Request Transmission Policy */
3879 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3882 /* Unsolicited Grant Size */
3883 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
3886 /* Grants Per Interval */
3887 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
3890 proto_tree_add_text(object_tree, tvb, offset, 1, "Reserved");
3893 /* Nominal Grant Interval */
3894 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
3897 /* Tolerated Grant Jitter */
3898 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
3901 /* Nominal Polling Interval */
3902 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
3905 /* Tolerated Poll Jitter */
3906 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
3911 /* Committed Envelope */
3912 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
3913 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3915 /* Request Transmission Policy */
3916 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3919 /* Unsolicited Grant Size */
3920 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
3923 /* Grants Per Interval */
3924 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
3927 proto_tree_add_text(object_tree, tvb, offset, 1, "Reserved");
3930 /* Nominal Grant Interval */
3931 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
3934 /* Tolerated Grant Jitter */
3935 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
3938 /* Nominal Polling Interval */
3939 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
3942 /* Tolerated Poll Jitter */
3943 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
3947 /* Cops - Section : Downstream Service */
3949 cops_downstream_service(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3951 proto_tree *stt, *object_tree;
3953 /* Create a subtree */
3954 stt = info_to_cops_subtree(tvb,st,n,offset,"Downstream Service");
3958 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3961 proto_tree_add_text(stt, tvb, offset, 3, "Reserved");
3964 /* Authorized Envelope */
3965 ti = proto_tree_add_text(stt, tvb, offset, 24, "Authorized Envelope");
3966 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3968 /* Traffic Priority */
3969 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3972 proto_tree_add_text(object_tree, tvb, offset, 3, "Reserved");
3975 /* Maximum Sustained Traffic Rate */
3976 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3979 /* Maximum Traffic Burst */
3980 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3983 /* Minimum Reserved Traffic Rate */
3984 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3987 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3988 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
3992 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3995 /* Maximum Downstream Latency */
3996 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
4001 /* Reserved Envelope */
4002 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
4003 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4005 /* Traffic Priority */
4006 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4009 proto_tree_add_text(object_tree, tvb, offset, 3, "Reserved");
4012 /* Maximum Sustained Traffic Rate */
4013 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4016 /* Maximum Traffic Burst */
4017 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4020 /* Minimum Reserved Traffic Rate */
4021 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4024 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4025 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
4029 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4032 /* Maximum Downstream Latency */
4033 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
4038 /* Committed Envelope */
4039 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
4040 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4042 /* Traffic Priority */
4043 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4046 proto_tree_add_text(object_tree, tvb, offset, 3, "Reserved");
4049 /* Maximum Sustained Traffic Rate */
4050 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4053 /* Maximum Traffic Burst */
4054 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4057 /* Minimum Reserved Traffic Rate */
4058 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4061 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4062 info_to_display(tvb,object_tree,offset,2,"Assumed Minimum Reserved Traffic Rate Packet Size",NULL,FMT_DEC,&hf_cops_pcmm_ass_min_rtr_packet_size);
4066 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4069 /* Maximum Downstream Latency */
4070 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
4074 /* Cops - Section : PacketCable Multimedia Event Gereration-Info */
4076 cops_mm_event_generation_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
4081 /* Create a subtree */
4082 stt = info_to_cops_subtree(tvb,st,n,offset,"Event Generation Info");
4085 /* Primary Record Keeping Server IP Address */
4086 info_to_display(tvb,stt,offset,4,"PRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_prks_ip);
4089 /* Primary Record Keeping Server IP Port */
4090 info_to_display(tvb,stt,offset,2,"PRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_prks_ip_port);
4094 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4097 /* Secondary Record Keeping Server IP Address */
4098 info_to_display(tvb,stt,offset,4,"SRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_srks_ip);
4101 /* Secondary Record Keeping Server IP Port */
4102 info_to_display(tvb,stt,offset,2,"SRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_srks_ip_port);
4106 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4109 /* BCID Timestamp */
4110 info_to_display(tvb,stt,offset,4,"BCID - Timestamp",NULL,FMT_HEX,&hf_cops_pc_bcid_ts);
4113 /* BCID Element ID */
4114 bcid_str = tvb_format_text(tvb, offset, 8);
4115 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Element ID",bcid_str);
4118 /* BCID Time Zone */
4119 bcid_str = tvb_format_text(tvb, offset, 8);
4120 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Time Zone",bcid_str);
4123 /* BCID Event Counter */
4124 info_to_display(tvb,stt,offset,4,"BCID - Event Counter",NULL,FMT_DEC,&hf_cops_pc_bcid_ev);
4127 /* Cops - Section : Volume-Based Usage Limit */
4129 cops_volume_based_usage_limit(tvbuff_t *tvb, proto_tree *st, guint object_len, guint32 offset) {
4133 /* Create a subtree */
4134 stt = info_to_cops_subtree(tvb,st,object_len,offset,"Volume-Based Usage Limit");
4138 proto_tree_add_item(stt, hf_cops_pcmm_volume_based_usage_limit, tvb, offset, 8,
4142 /* Cops - Section : Time-Based Usage Limit */
4144 cops_time_based_usage_limit(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
4148 /* Create a subtree */
4149 stt = info_to_cops_subtree(tvb,st,n,offset,"Time-Based Usage Limit");
4153 info_to_display(tvb,stt,offset,4,"Time Limit", NULL,FMT_DEC,&hf_cops_pcmm_time_based_usage_limit);
4157 /* Cops - Section : Opaque Data */
4159 cops_opaque_data(tvbuff_t *tvb, proto_tree *st, guint object_len, guint32 offset) {
4163 /* Create a subtree */
4164 stt = info_to_cops_subtree(tvb,st,object_len,offset,"Opaque Data");
4168 proto_tree_add_text(stt, tvb, offset, 8,"Opaque Data");
4171 /* Cops - Section : Gate Time Info */
4173 cops_gate_time_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
4177 /* Create a subtree */
4178 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Time Info");
4181 /* Gate Time Info */
4182 info_to_display(tvb,stt,offset,4,"Time Committed", NULL,FMT_DEC,&hf_cops_pcmm_gate_time_info);
4186 /* Cops - Section : Gate Usage Info */
4188 cops_gate_usage_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
4192 /* Create a subtree */
4193 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Usage Info");
4196 /* Gate Time Info */
4197 info_to_display(tvb,stt,offset,4,"Octet Count", NULL,FMT_DEC,&hf_cops_pcmm_gate_usage_info);
4201 /* Cops - Section : PacketCable error */
4203 cops_packetcable_mm_error(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
4206 guint16 code, subcode;
4208 /* Create a subtree */
4209 stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Error");
4212 code = tvb_get_ntohs(tvb, offset);
4213 proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_code, tvb, offset, 2, code,
4214 "Error Code: %s (%u)", val_to_str(code, pcmm_packetcable_error_code, "Unknown"),
4218 subcode = tvb_get_ntohs(tvb, offset);
4219 if (code == 6 || code == 7)
4220 proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_subcode,
4221 tvb, offset, 2, code, "Error-Subcode: 0x%02x, S-Num: 0x%02x, S-Type: 0x%02x",
4222 subcode, subcode >> 8, subcode & 0xf);
4224 proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_subcode,
4225 tvb, offset, 2, code, "Error-Subcode: 0x%04x", subcode);
4229 /* Cops - Section : Gate State */
4231 cops_gate_state(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
4235 /* Create a subtree */
4236 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate State");
4240 info_to_display(tvb,stt,offset,2,"State",pcmm_gate_state,FMT_DEC,&hf_cops_pcmm_packetcable_gate_state);
4244 info_to_display(tvb,stt,offset,2,"Reason",pcmm_gate_state_reason,FMT_DEC,&hf_cops_pcmm_packetcable_gate_state_reason);
4248 /* Cops - Section : Version Info */
4250 cops_version_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
4254 /* Create a subtree */
4255 stt = info_to_cops_subtree(tvb,st,n,offset,"Version Info");
4259 info_to_display(tvb,stt,offset,2,"Major Version Number",NULL,FMT_DEC,&hf_cops_pcmm_packetcable_version_info_major);
4263 info_to_display(tvb,stt,offset,2,"Minor Version Number",NULL,FMT_DEC,&hf_cops_pcmm_packetcable_version_info_minor);
4269 /* PacketCable D-QoS S-Num/S-Type globs */
4270 #define PCDQ_TRANSACTION_ID 0x0101
4271 #define PCDQ_SUBSCRIBER_IDv4 0x0201
4272 #define PCDQ_SUBSCRIBER_IDv6 0x0202
4273 #define PCDQ_GATE_ID 0x0301
4274 #define PCDQ_ACTIVITY_COUNT 0x0401
4275 #define PCDQ_GATE_SPEC 0x0501
4276 #define PCDQ_REMOTE_GATE_INFO 0x0601
4277 #define PCDQ_EVENT_GENERATION_INFO 0x0701
4278 #define PCDQ_MEDIA_CONNECTION_EVENT_INFO 0x0801
4279 #define PCDQ_PACKETCABLE_ERROR 0x0901
4280 #define PCDQ_PACKETCABLE_REASON 0x0d01
4281 #define PCDQ_ELECTRONIC_SURVEILLANCE 0x0a01
4282 #define PCDQ_SESSION_DESCRIPTION 0x0b01
4284 /* Analyze the PacketCable objects */
4286 cops_analyze_packetcable_dqos_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 op_code, guint32 offset) {
4290 guint8 s_num, s_type;
4291 guint16 num_type_glob;
4293 /* Only if this option is enabled by the Gui */
4294 if ( cops_packetcable == FALSE ) {
4298 /* Do the remaining client specific objects */
4299 remdata = tvb_length_remaining(tvb, offset);
4300 while (remdata > 4) {
4302 /* In case we have remaining data, then lets try to get this analyzed */
4303 object_len = tvb_get_ntohs(tvb, offset);
4304 if (object_len < 4) {
4305 proto_tree_add_text(tree, tvb, offset, 2,
4306 "Incorrect PacketCable object length %u < 4", object_len);
4310 s_num = tvb_get_guint8(tvb, offset + 2);
4311 s_type = tvb_get_guint8(tvb, offset + 3);
4313 /* Glom the s_num and s_type together to make switching easier */
4314 num_type_glob = s_num << 8 | s_type;
4316 /* Perform the appropriate functions */
4317 switch (num_type_glob){
4318 case PCDQ_TRANSACTION_ID:
4319 cops_transaction_id(tvb, pinfo, tree, op_code, object_len, offset);
4321 case PCDQ_SUBSCRIBER_IDv4:
4322 cops_subscriber_id_v4(tvb, tree, object_len, offset);
4324 case PCDQ_SUBSCRIBER_IDv6:
4325 cops_subscriber_id_v6(tvb, tree, object_len, offset);
4328 cops_gate_id(tvb, tree, object_len, offset);
4330 case PCDQ_ACTIVITY_COUNT:
4331 cops_activity_count(tvb, tree, object_len, offset);
4333 case PCDQ_GATE_SPEC:
4334 cops_gate_specs(tvb, tree, object_len, offset);
4336 case PCDQ_REMOTE_GATE_INFO:
4337 cops_remote_gate_info(tvb, tree, object_len, offset);
4339 case PCDQ_EVENT_GENERATION_INFO:
4340 cops_event_generation_info(tvb, tree, object_len, offset);
4342 case PCDQ_PACKETCABLE_ERROR:
4343 cops_packetcable_error(tvb, tree, object_len, offset);
4345 case PCDQ_ELECTRONIC_SURVEILLANCE:
4346 cops_surveillance_parameters(tvb, tree, object_len, offset);
4348 case PCDQ_PACKETCABLE_REASON:
4349 cops_packetcable_reason(tvb, tree, object_len, offset);
4354 offset += object_len;
4356 /* See what we can still get from the buffer */
4357 remdata = tvb_length_remaining(tvb, offset);
4361 /* XXX - This duplicates code in the DOCSIS dissector. */
4363 decode_docsis_request_transmission_policy(tvbuff_t *tvb, guint32 offset, proto_tree *tree, gint hf) {
4364 proto_tree *drtp_tree;
4366 guint32 policy = tvb_get_ntohl(tvb, offset);
4369 static const value_string drtp_vals[] = {
4370 { 1 << 0, "The Service Flow MUST NOT use \"all CMs\" broadcast request opportunities" },
4371 { 1 << 1, "The Service Flow MUST NOT use Priority Request multicast request opportunities" },
4372 { 1 << 2, "The Service Flow MUST NOT use Request/Data opportunities for Requests" },
4373 { 1 << 3, "The Service Flow MUST NOT use Request/Data opportunities for Data" },
4374 { 1 << 4, "The Service Flow MUST NOT piggyback requests with data" },
4375 { 1 << 5, "The Service Flow MUST NOT concatenate data" },
4376 { 1 << 6, "The Service Flow MUST NOT fragment data" },
4377 { 1 << 7, "The Service Flow MUST NOT suppress payload headers" },
4378 { 1 << 8, "The Service Flow MUST drop packets that do not fit in the Unsolicited Grant Size" },
4382 item = proto_tree_add_item (tree, hf, tvb, offset, 4, FALSE);
4383 drtp_tree = proto_item_add_subtree(item, ett_docsis_request_transmission_policy);
4384 for (i = 0 ; i <= 8; i++) {
4385 if (policy & drtp_vals[i].value) {
4386 decode_bitfield_value(bit_fld, policy, drtp_vals[i].value, 32);
4387 proto_tree_add_text(drtp_tree, tvb, offset, 4, "%s%s",
4388 bit_fld, drtp_vals[i].strptr);
4394 #define PCMM_TRANSACTION_ID 0x0101
4395 #define PCMM_AMID 0x0201
4396 #define PCMM_SUBSCRIBER_ID 0x0301
4397 #define PCMM_GATE_ID 0x0401
4398 #define PCMM_GATE_SPEC 0x0501
4399 #define PCMM_CLASSIFIER 0x0601
4400 #define PCMM_FLOW_SPEC 0x0701
4401 #define PCMM_DOCSIS_SERVICE_CLASS_NAME 0x0702
4402 #define PCMM_BEST_EFFORT_SERVICE 0x0703
4403 #define PCMM_NON_REAL_TIME_POLLING_SERVICE 0x0704
4404 #define PCMM_REAL_TIME_POLLING_SERVICE 0x0705
4405 #define PCMM_UNSOLICITED_GRANT_SERVICE 0x0706
4406 #define PCMM_UGS_WITH_ACTIVITY_DETECTION 0x0707
4407 #define PCMM_DOWNSTREAM_SERVICE 0x0708
4408 #define PCMM_EVENT_GENERATION_INFO 0x0801
4409 #define PCMM_VOLUME_BASED_USAGE_LIMIT 0x0901
4410 #define PCMM_TIME_BASED_USAGE_LIMIT 0x0a01
4411 #define PCMM_OPAQUE_DATA 0x0b01
4412 #define PCMM_GATE_TIME_INFO 0x0c01
4413 #define PCMM_GATE_USAGE_INFO 0x0d01
4414 #define PCMM_PACKETCABLE_ERROR 0x0e01
4415 #define PCMM_GATE_STATE 0x0f01
4416 #define PCMM_VERSION_INFO 0x1001
4420 cops_analyze_packetcable_mm_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 op_code, guint32 offset) {
4423 guint8 s_num, s_type;
4424 guint16 num_type_glob;
4426 /* Only if this option is enabled by the Gui */
4427 if ( cops_packetcable == FALSE ) {
4431 /* Do the remaining client specific objects */
4432 while (tvb_reported_length_remaining(tvb, offset) > 4) {
4434 /* In case we have remaining data, then lets try to get this analyzed */
4435 object_len = tvb_get_ntohs(tvb, offset);
4436 if (object_len < 4) {
4437 proto_tree_add_text(tree, tvb, offset, 2,
4438 "Incorrect PacketCable object length %u < 4", object_len);
4442 s_num = tvb_get_guint8(tvb, offset + 2);
4443 s_type = tvb_get_guint8(tvb, offset + 3);
4445 /* Glom the s_num and s_type together to make switching easier */
4446 num_type_glob = s_num << 8 | s_type;
4448 /* Perform the appropriate functions */
4449 switch (num_type_glob){
4450 case PCMM_TRANSACTION_ID:
4451 cops_mm_transaction_id(tvb, pinfo, tree, op_code, object_len, offset);
4454 cops_amid(tvb, tree, object_len, offset);
4456 case PCMM_SUBSCRIBER_ID:
4457 cops_subscriber_id_v4(tvb, tree, object_len, offset);
4460 cops_gate_id(tvb, tree, object_len, offset);
4462 case PCMM_GATE_SPEC:
4463 cops_mm_gate_spec(tvb, tree, object_len, offset);
4465 case PCMM_CLASSIFIER:
4466 cops_classifier(tvb, tree, object_len, offset);
4468 case PCMM_FLOW_SPEC:
4469 cops_flow_spec(tvb, tree, object_len, offset);
4471 case PCMM_DOCSIS_SERVICE_CLASS_NAME:
4472 cops_docsis_service_class_name(tvb, tree, object_len, offset);
4474 case PCMM_BEST_EFFORT_SERVICE:
4475 cops_best_effort_service(tvb, tree, object_len, offset);
4477 case PCMM_NON_REAL_TIME_POLLING_SERVICE:
4478 cops_non_real_time_polling_service(tvb, tree, object_len, offset);
4480 case PCMM_REAL_TIME_POLLING_SERVICE:
4481 cops_real_time_polling_service(tvb, tree, object_len, offset);
4483 case PCMM_UNSOLICITED_GRANT_SERVICE:
4484 cops_unsolicited_grant_service(tvb, tree, object_len, offset);
4486 case PCMM_UGS_WITH_ACTIVITY_DETECTION:
4487 cops_ugs_with_activity_detection(tvb, tree, object_len, offset);
4489 case PCMM_DOWNSTREAM_SERVICE:
4490 cops_downstream_service(tvb, tree, object_len, offset);
4492 case PCMM_EVENT_GENERATION_INFO:
4493 cops_mm_event_generation_info(tvb, tree, object_len, offset);
4495 case PCMM_VOLUME_BASED_USAGE_LIMIT:
4496 cops_volume_based_usage_limit(tvb, tree, object_len, offset);
4498 case PCMM_TIME_BASED_USAGE_LIMIT:
4499 cops_time_based_usage_limit(tvb, tree, object_len, offset);
4501 case PCMM_OPAQUE_DATA:
4502 cops_opaque_data(tvb, tree, object_len, offset);
4504 case PCMM_GATE_TIME_INFO:
4505 cops_gate_time_info(tvb, tree, object_len, offset);
4507 case PCMM_GATE_USAGE_INFO:
4508 cops_gate_usage_info(tvb, tree, object_len, offset);
4510 case PCMM_PACKETCABLE_ERROR:
4511 cops_packetcable_mm_error(tvb, tree, object_len, offset);
4513 case PCMM_GATE_STATE:
4514 cops_gate_state(tvb, tree, object_len, offset);
4516 case PCMM_VERSION_INFO:
4517 cops_version_info(tvb, tree, object_len, offset);
4522 offset += object_len;
4527 /* End of PacketCable Addition */