Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-cops.c
blob2cb21b730a41bf6782ef3ebd7af00b64cb5037f1
1 /* packet-cops.c
2 * Routines for the COPS (Common Open Policy Service) protocol dissection
4 * RFC 2748 The COPS (Common Open Policy Service) Protocol
5 * RFC 3084 COPS Usage for Policy Provisioning (COPS-PR)
6 * RFC 3159 Structure of Policy Provisioning Information (SPPI)
8 * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
10 * Added request/response tracking in July 2013 by Simon Zhong <szhong@juniper.net>
12 * Added PacketCable D-QoS specifications by Dick Gooris <gooris@lucent.com>
14 * Taken from PacketCable specifications :
15 * PacketCable Dynamic Quality-of-Service Specification
16 * Based on PKT-SP-DQOS-I09-040402 (April 2, 2004)
18 * PacketCable Multimedia Specification
19 * Based on PKT-SP-MM-I04-080522 and PKT-SP-MM-I05-091029
21 * www.packetcable.com
23 * Implemented in wireshark at April 7-8, 2004
25 * Wireshark - Network traffic analyzer
26 * By Gerald Combs <gerald@wireshark.org>
27 * Copyright 1998 Gerald Combs
29 * SPDX-License-Identifier: GPL-2.0-or-later
33 * Some of the development of the COPS protocol decoder was sponsored by
34 * Cable Television Laboratories, Inc. ("CableLabs") based upon proprietary
35 * CableLabs' specifications. Your license and use of this protocol decoder
36 * does not mean that you are licensed to use the CableLabs'
37 * specifications. If you have questions about this protocol, contact
38 * jf.mule [AT] cablelabs.com or c.stuart [AT] cablelabs.com for additional
39 * information.
43 #include "config.h"
45 #include <epan/packet.h>
46 #include "packet-tcp.h"
48 #include <epan/oids.h>
49 #include <epan/expert.h>
50 #include <epan/tfs.h>
52 #include <wsutil/str_util.h>
54 #include "packet-ber.h"
56 /* XXX - The "plain" COPS port (3288) can be overridden in the prefs.
57 The PacketCable port cannot - should this be the case? */
58 #define TCP_PORT_COPS 3288
59 #define TCP_PORT_PKTCABLE_COPS 2126
60 #define TCP_PORT_PKTCABLE_MM_COPS 3918
62 void proto_register_cops(void);
64 /* Preference: desegmentation of COPS */
65 static bool cops_desegment = true;
67 #define COPS_OBJECT_HDR_SIZE 4
69 static const value_string cops_flags_vals[] = {
70 { 0x00, "None" },
71 { 0x01, "Solicited Message Flag Bit" },
72 { 0, NULL },
75 /* The different COPS message types */
76 enum cops_op_code {
77 COPS_NO_MSG, /* Not a COPS Message type */
79 COPS_MSG_REQ, /* Request (REQ) */
80 COPS_MSG_DEC, /* Decision (DEC) */
81 COPS_MSG_RPT, /* Report State (RPT) */
82 COPS_MSG_DRQ, /* Delete Request State (DRQ) */
83 COPS_MSG_SSQ, /* Synchronize State Req (SSQ) */
84 COPS_MSG_OPN, /* Client-Open (OPN) */
85 COPS_MSG_CAT, /* Client-Accept (CAT) */
86 COPS_MSG_CC, /* Client-Close (CC) */
87 COPS_MSG_KA, /* Keep-Alive (KA) */
88 COPS_MSG_SSC, /* Synchronize Complete (SSC) */
90 COPS_LAST_OP_CODE /* For error checking */
93 static const value_string cops_op_code_vals[] = {
94 { COPS_MSG_REQ, "Request (REQ)" },
95 { COPS_MSG_DEC, "Decision (DEC)" },
96 { COPS_MSG_RPT, "Report State (RPT)" },
97 { COPS_MSG_DRQ, "Delete Request State (DRQ)" },
98 { COPS_MSG_SSQ, "Synchronize State Req (SSQ)" },
99 { COPS_MSG_OPN, "Client-Open (OPN)" },
100 { COPS_MSG_CAT, "Client-Accept (CAT)" },
101 { COPS_MSG_CC, "Client-Close (CC)" },
102 { COPS_MSG_KA, "Keep-Alive (KA)" },
103 { COPS_MSG_SSC, "Synchronize Complete (SSC)" },
104 { 0, NULL },
108 /* The different objects in COPS messages */
109 enum cops_c_num {
110 COPS_NO_OBJECT, /* Not a COPS Object type */
112 COPS_OBJ_HANDLE, /* Handle Object (Handle) */
113 COPS_OBJ_CONTEXT, /* Context Object (Context) */
114 COPS_OBJ_IN_INT, /* In-Interface Object (IN-Int) */
115 COPS_OBJ_OUT_INT, /* Out-Interface Object (OUT-Int) */
116 COPS_OBJ_REASON, /* Reason Object (Reason) */
117 COPS_OBJ_DECISION, /* Decision Object (Decision) */
118 COPS_OBJ_LPDPDECISION, /* LPDP Decision Object (LPDPDecision) */
119 COPS_OBJ_ERROR, /* Error Object (Error) */
120 COPS_OBJ_CLIENTSI, /* Client Specific Information Object (ClientSI) */
121 COPS_OBJ_KATIMER, /* Keep-Alive Timer Object (KATimer) */
122 COPS_OBJ_PEPID, /* PEP Identification Object (PEPID) */
123 COPS_OBJ_REPORT_TYPE, /* Report-Type Object (Report-Type) */
124 COPS_OBJ_PDPREDIRADDR, /* PDP Redirect Address Object (PDPRedirAddr) */
125 COPS_OBJ_LASTPDPADDR, /* Last PDP Address (LastPDPaddr) */
126 COPS_OBJ_ACCTTIMER, /* Accounting Timer Object (AcctTimer) */
127 COPS_OBJ_INTEGRITY, /* Message Integrity Object (Integrity) */
128 COPS_LAST_C_NUM /* For error checking */
131 static const value_string cops_c_num_vals[] = {
132 { COPS_OBJ_HANDLE, "Handle Object (Handle)" },
133 { COPS_OBJ_CONTEXT, "Context Object (Context)" },
134 { COPS_OBJ_IN_INT, "In-Interface Object (IN-Int)" },
135 { COPS_OBJ_OUT_INT, "Out-Interface Object (OUT-Int)" },
136 { COPS_OBJ_REASON, "Reason Object (Reason)" },
137 { COPS_OBJ_DECISION, "Decision Object (Decision)" },
138 { COPS_OBJ_LPDPDECISION, "LPDP Decision Object (LPDPDecision)" },
139 { COPS_OBJ_ERROR, "Error Object (Error)" },
140 { COPS_OBJ_CLIENTSI, "Client Specific Information Object (ClientSI)" },
141 { COPS_OBJ_KATIMER, "Keep-Alive Timer Object (KATimer)" },
142 { COPS_OBJ_PEPID, "PEP Identification Object (PEPID)" },
143 { COPS_OBJ_REPORT_TYPE, "Report-Type Object (Report-Type)" },
144 { COPS_OBJ_PDPREDIRADDR, "PDP Redirect Address Object (PDPRedirAddr)" },
145 { COPS_OBJ_LASTPDPADDR, "Last PDP Address (LastPDPaddr)" },
146 { COPS_OBJ_ACCTTIMER, "Accounting Timer Object (AcctTimer)" },
147 { COPS_OBJ_INTEGRITY, "Message Integrity Object (Integrity)" },
148 { 0, NULL },
152 /* The different objects in COPS-PR messages */
153 enum cops_s_num {
154 COPS_NO_PR_OBJECT, /* Not a COPS-PR Object type */
155 COPS_OBJ_PRID, /* Provisioning Instance Identifier (PRID) */
156 COPS_OBJ_PPRID, /* Prefix Provisioning Instance Identifier (PPRID) */
157 COPS_OBJ_EPD, /* Encoded Provisioning Instance Data (EPD) */
158 COPS_OBJ_GPERR, /* Global Provisioning Error Object (GPERR) */
159 COPS_OBJ_CPERR, /* PRC Class Provisioning Error Object (CPERR) */
160 COPS_OBJ_ERRPRID, /* Error Provisioning Instance Identifier (ErrorPRID)*/
162 COPS_LAST_S_NUM /* For error checking */
166 static const value_string cops_s_num_vals[] = {
167 { COPS_OBJ_PRID, "Provisioning Instance Identifier (PRID)" },
168 { COPS_OBJ_PPRID, "Prefix Provisioning Instance Identifier (PPRID)" },
169 { COPS_OBJ_EPD, "Encoded Provisioning Instance Data (EPD)" },
170 { COPS_OBJ_GPERR, "Global Provisioning Error Object (GPERR)" },
171 { COPS_OBJ_CPERR, "PRC Class Provisioning Error Object (CPERR)" },
172 { COPS_OBJ_ERRPRID, "Error Provisioning Instance Identifier (ErrorPRID)" },
173 { 0, NULL },
177 /* R-Type is carried within the Context Object */
178 static const value_string cops_r_type_vals[] = {
179 { 0x01, "Incoming-Message/Admission Control request" },
180 { 0x02, "Resource-Allocation request" },
181 { 0x04, "Outgoing-Message request" },
182 { 0x08, "Configuration request" },
183 { 0, NULL },
185 /* S-Type is carried within the ClientSI Object for COPS-PR*/
186 static const value_string cops_s_type_vals[] = {
187 { 0x01, "BER" },
188 { 0, NULL },
191 /* Reason-Code is carried within the Reason object */
192 static const value_string cops_reason_vals[] = {
193 { 1, "Unspecified" },
194 { 2, "Management" },
195 { 3, "Preempted (Another request state takes precedence)" },
196 { 4, "Tear (Used to communicate a signaled state removal)" },
197 { 5, "Timeout (Local state has timed-out)" },
198 { 6, "Route Change (Change invalidates request state)" },
199 { 7, "Insufficient Resources (No local resource available)" },
200 { 8, "PDP's Directive (PDP decision caused the delete)" },
201 { 9, "Unsupported decision (PDP decision not supported)" },
202 { 10, "Synchronize Handle Unknown" },
203 { 11, "Transient Handle (stateless event)" },
204 { 12, "Malformed Decision (could not recover)" },
205 { 13, "Unknown COPS Object from PDP" },
206 { 0, NULL },
209 /* Command-Code is carried within the Decision object if C-Type is 1 */
210 static const value_string cops_dec_cmd_code_vals[] = {
211 { 0, "NULL Decision (No configuration data available)" },
212 { 1, "Install (Admit request/Install configuration)" },
213 { 2, "Remove (Remove request/Remove configuration)" },
214 { 0, NULL },
217 /* Decision flags are also carried with the Decision object if C-Type is 1 */
218 static const value_string cops_dec_cmd_flag_vals[] = {
219 { 0x00, "<None set>" },
220 { 0x01, "Trigger Error (Trigger error message if set)" },
221 { 0, NULL },
224 /* Error-Code from Error object */
225 static const value_string cops_error_vals[] = {
226 {1, "Bad handle" },
227 {2, "Invalid handle reference" },
228 {3, "Bad message format (Malformed Message)" },
229 {4, "Unable to process (server gives up on query)" },
230 {5, "Mandatory client-specific info missing" },
231 {6, "Unsupported client" },
232 {7, "Mandatory COPS object missing" },
233 {8, "Client Failure" },
234 {9, "Communication Failure" },
235 {10, "Unspecified" },
236 {11, "Shutting down" },
237 {12, "Redirect to Preferred Server" },
238 {13, "Unknown COPS Object" },
239 {14, "Authentication Failure" },
240 {15, "Authentication Required" },
241 {0, NULL },
243 /* Error-Code from GPERR object */
244 static const value_string cops_gperror_vals[] = {
245 {1, "AvailMemLow" },
246 {2, "AvailMemExhausted" },
247 {3, "unknownASN.1Tag" },
248 {4, "maxMsgSizeExceeded" },
249 {5, "unknownError" },
250 {6, "maxRequestStatesOpen" },
251 {7, "invalidASN.1Length" },
252 {8, "invalidObjectPad" },
253 {9, "unknownPIBData" },
254 {10, "unknownCOPSPRObject" },
255 {11, "malformedDecision" },
256 {0, NULL },
259 /* Error-Code from CPERR object */
260 static const value_string cops_cperror_vals[] = {
261 {1, "priSpaceExhausted" },
262 {2, "priInstanceInvalid" },
263 {3, "attrValueInvalid" },
264 {4, "attrValueSupLimited" },
265 {5, "attrEnumSupLimited" },
266 {6, "attrMaxLengthExceeded" },
267 {7, "attrReferenceUnknown" },
268 {8, "priNotifyOnly" },
269 {9, "unknownPrc" },
270 {10, "tooFewAttrs" },
271 {11, "invalidAttrType" },
272 {12, "deletedInRef" },
273 {13, "priSpecificError" },
274 {0, NULL },
278 /* Report-Type from Report-Type object */
279 static const value_string cops_report_type_vals[] = {
280 {1, " Success : Decision was successful at the PEP" },
281 {2, " Failure : Decision could not be completed by PEP" },
282 {3, " Accounting: Accounting update for an installed state" },
283 {0, NULL },
287 /* Client-type descriptions */
288 /* http://www.iana.org/assignments/cops-parameters */
290 /* PacketCable Types */
292 /* static dissector_handle_t sdp_handle; */
294 #define COPS_CLIENT_PC_DQOS 0x8008
295 #define COPS_CLIENT_PC_MM 0x800a
297 static const value_string cops_client_type_vals[] = {
298 {0, "None"},
299 {1, "RSVP"},
300 {2, "DiffServ QoS"},
301 {0x8001, "IP Highway"},
302 {0x8002, "IP Highway"},
303 {0x8003, "IP Highway"},
304 {0x8004, "IP Highway"},
305 {0x8005, "Fujitsu"},
306 {0x8006, "HP OpenView PolicyXpert"},
307 {0x8007, "HP OpenView PolicyXpert COPS-PR PXPIB"},
308 {COPS_CLIENT_PC_DQOS, "PacketCable Dynamic Quality-of-Service"},
309 {0x8009, "3GPP"},
310 {COPS_CLIENT_PC_MM, "PacketCable Multimedia"},
311 {0x800b, "Juniper"},
312 {0x800c, "Q.3303.1 (Rw interface) COPS alternative"},
313 {0x800d, "Q.3304.1 (Rc interface) COPS alternative"},
314 {0, NULL},
317 /* The next tables are for PacketCable */
319 /* Transaction ID table */
320 static const value_string table_cops_dqos_transaction_id[] =
322 { 0x1, "Gate Alloc" },
323 { 0x2, "Gate Alloc Ack" },
324 { 0x3, "Gate Alloc Err" },
325 { 0x4, "Gate Set" },
326 { 0x5, "Gate Set Ack" },
327 { 0x6, "Gate Set Err" },
328 { 0x7, "Gate Info" },
329 { 0x8, "Gate Info Ack" },
330 { 0x9, "Gate Info Err" },
331 { 0xa, "Gate Delete" },
332 { 0xb, "Gate Delete Ack" },
333 { 0xc, "Gate Delete Err" },
334 { 0xd, "Gate Open" },
335 { 0xe, "Gate Close" },
336 { 0, NULL },
339 /* Direction */
340 static const value_string table_cops_direction[] =
342 { 0x0, "Downstream gate" },
343 { 0x1, "Upstream gate" },
344 { 0, NULL },
347 /* Session Class */
348 static const value_string table_cops_session_class[] =
350 { 0x0, "Unspecified" },
351 { 0x1, "Normal priority VoIP session" },
352 { 0x2, "High priority VoIP session" },
353 { 0x3, "Reserved" },
354 { 0, NULL },
357 /* Reason Code */
358 static const value_string table_cops_reason_code[] =
360 { 0x0, "Gate Delete Operation" },
361 { 0x1, "Gate Close Operation" },
362 { 0, NULL },
365 /* Reason Sub Code - Delete */
366 static const value_string table_cops_reason_subcode_delete[] =
368 { 0x0, "Normal Operation" },
369 { 0x1, "Local Gate-coordination not completed" },
370 { 0x2, "Remote Gate-coordination not completed" },
371 { 0x3, "Authorization revoked" },
372 { 0x4, "Unexpected Gate-Open" },
373 { 0x5, "Local Gate-Close failure" },
374 { 0x7f,"Unspecified error" },
375 { 0, NULL },
378 /* Reason Sub Code - Close */
379 static const value_string table_cops_reason_subcode_close[] =
381 { 0x0, "Client initiated release (normal operation)" },
382 { 0x1, "Reservation reassignment (e.g., for priority session)" },
383 { 0x2, "Lack of reservation maintenance (e.g., RSVP refreshes)" },
384 { 0x3, "Lack of Docsis Mac-layer responses (e.g., station maintenance)" },
385 { 0x4, "Timer T0 expiration; no Gate-Set received from CMS" },
386 { 0x5, "Timer T1 expiration; no Commit received from MTA" },
387 { 0x6, "Timer T7 expiration; Service Flow reservation timeout" },
388 { 0x7, "Timer T8 expiration; Service Flow inactivity in the upstream direction" },
389 { 0x7f,"Unspecified error" },
390 { 0, NULL },
393 /* PacketCable Error */
394 static const value_string table_cops_packetcable_error[] =
396 { 0x1, "No gates currently available" },
397 { 0x2, "Unknown Gate ID" },
398 { 0x3, "Illegal Session Class value" },
399 { 0x4, "Subscriber exceeded gate limit" },
400 { 0x5, "Gate already set" },
401 { 0x6, "Missing Required Object" },
402 { 0x7, "Invalid Object" },
403 { 0x7f,"Unspecified error" },
404 { 0, NULL },
408 /* PacketCable Multimedia */
410 static const value_string table_cops_mm_transaction_id[] = {
411 {1, "Reserved"},
412 {2, "Reserved"},
413 {3, "Reserved"},
414 {4, "Gate Set"},
415 {5, "Gate Set Ack"},
416 {6, "Gate Set Err"},
417 {7, "Gate Info"},
418 {8, "Gate Info Ack"},
419 {9, "Gate Info Err"},
420 {10, "Gate Delete"},
421 {11, "Gate Delete Ack"},
422 {12, "Gate Delete Err"},
423 {13, "Gate Open"},
424 {14, "Gate Close"},
425 {15, "Gate Report State"},
426 {16, "Invalid Gate Cmd Err"},
427 {17, "PDP Config"},
428 {18, "PDP Config Ack"},
429 {19, "PDP Config Error"},
430 {20, "Synch Request"},
431 {21, "Synch Report"},
432 {22, "Synch Complete"},
433 {23, "Message Receipt"},
434 {0, NULL },
437 static const value_string pcmm_activation_state_vals[] = {
438 {0, "Inactive"},
439 {1, "Active"},
440 {0, NULL },
443 static const value_string pcmm_action_vals[] = {
444 {0, "Add classifier"},
445 {1, "Replace classifier"},
446 {2, "Delete classifier"},
447 {3, "No change"},
448 {0, NULL },
451 static const value_string pcmm_flow_spec_service_vals[] = {
452 {2, "Guaranteed Rate"},
453 {5, "Controlled Load"},
454 {0, NULL },
457 static const value_string pcmm_report_type_vals[] = {
458 {0, "Standard Report Data"},
459 {1, "Complete Gate Data"},
460 {0, NULL},
463 static const value_string pcmm_synch_type_vals[] = {
464 {0, "Full Synchronization"},
465 {1, "Incremental Synchronization"},
466 {0, NULL},
469 static const value_string pcmm_packetcable_error_code[] = {
470 {1, "Insufficient Resources"},
471 {2, "Unknown GateID"},
472 {6, "Missing Required Object"},
473 {7, "Invalid Object"},
474 {8, "Volume-Based Usage Limit Exceeded"},
475 {9, "Time-Based Usage Limit Exceeded"},
476 {10, "Session Class Limit Exceeded"},
477 {11, "Undefined Service Class Name"},
478 {12, "Incompatible Envelope"},
479 {13, "Invalid SubscriberID"},
480 {14, "Unauthorized AMID"},
481 {15, "Number of Classifiers Not Supported"},
482 {16, "Policy Exception"},
483 {17, "Invalid Field Value in Object"},
484 {18, "Transport Error"},
485 {19, "Unknown Gate Command"},
486 {20, "Unauthorized PSID"},
487 {21, "No State for PDP"},
488 {22, "Unsupported Synch Type"},
489 {23, "Incremental Data Incomplete"},
490 {127, "Other, Unspecified Error"},
491 {0, NULL},
494 static const value_string pcmm_gate_state[] = {
495 {1, "Idle/Closed"},
496 {2, "Authorized"},
497 {3, "Reserved"},
498 {4, "Committed"},
499 {5, "Committed-Recovery"},
500 {0, NULL},
503 static const value_string pcmm_gate_state_reason[] = {
504 {1, "Close initiated by CMTS due to reservation reassignment"},
505 {2, "Close initiated by CMTS due to lack of DOCSIS MAC-layer responses"},
506 {3, "Close initiated by CMTS due to timer T1 expiration"},
507 {4, "Close initiated by CMTS due to timer T2 expiration"},
508 {5, "Inactivity timer expired due to Service Flow inactivity (timer T3 expiration)"},
509 {6, "Close initiated by CMTS due to lack of Reservation Maintenance"},
510 {7, "Gate state unchanged, but volume limit reached"},
511 {8, "Close initiated by CMTS due to timer T4 expiration"},
512 {9, "Gate state unchanged, but timer T2 expiration caused reservation reduction"},
513 {10, "Gate state unchanged, but time limit reached"},
514 {11, "Close initiated by Policy Server or CMTS, volume limit reached"},
515 {12, "Close initiated by Policy Server or CMTS, time limit reached"},
516 {13, "Close initiated by CMTS, other"},
517 {65535, "Other"},
518 {0, NULL},
522 /* End of PacketCable Tables */
525 /* Initialize the protocol and registered fields */
526 static int proto_cops;
527 static int hf_cops_ver_flags;
528 static int hf_cops_version;
529 static int hf_cops_flags;
531 static int hf_cops_response_in;
532 static int hf_cops_response_to;
533 static int hf_cops_response_time;
535 static int hf_cops_op_code;
536 static int hf_cops_client_type;
537 static int hf_cops_msg_len;
539 static int hf_cops_obj_len;
540 static int hf_cops_obj_c_num;
541 static int hf_cops_obj_c_type;
543 static int hf_cops_obj_s_num;
544 static int hf_cops_obj_s_type;
546 static int hf_cops_handle;
548 static int hf_cops_r_type_flags;
549 static int hf_cops_m_type_flags;
551 static int hf_cops_in_int_ipv4;
552 static int hf_cops_in_int_ipv6;
553 static int hf_cops_out_int_ipv4;
554 static int hf_cops_out_int_ipv6;
555 static int hf_cops_int_ifindex;
557 static int hf_cops_reason;
558 static int hf_cops_reason_sub;
560 static int hf_cops_dec_cmd_code;
561 static int hf_cops_dec_flags;
563 static int hf_cops_error;
564 static int hf_cops_error_sub;
566 static int hf_cops_gperror;
567 static int hf_cops_gperror_sub;
569 static int hf_cops_cperror;
570 static int hf_cops_cperror_sub;
572 static int hf_cops_katimer;
574 static int hf_cops_pepid;
576 static int hf_cops_report_type;
578 static int hf_cops_pdprediraddr_ipv4;
579 static int hf_cops_pdprediraddr_ipv6;
580 static int hf_cops_lastpdpaddr_ipv4;
581 static int hf_cops_lastpdpaddr_ipv6;
582 static int hf_cops_pdp_tcp_port;
584 static int hf_cops_accttimer;
586 static int hf_cops_key_id;
587 static int hf_cops_seq_num;
589 static int hf_cops_prid_oid;
590 static int hf_cops_pprid_oid;
591 static int hf_cops_errprid_oid;
592 static int hf_cops_epd_null;
593 static int hf_cops_epd_int;
594 static int hf_cops_epd_octets;
595 static int hf_cops_epd_oid;
596 static int hf_cops_epd_ipv4;
597 static int hf_cops_epd_u32;
598 static int hf_cops_epd_ticks;
599 static int hf_cops_epd_opaque;
600 static int hf_cops_epd_i64;
601 static int hf_cops_epd_u64;
602 static int hf_cops_epd_unknown;
603 static int hf_cops_reserved8;
604 static int hf_cops_reserved16;
605 static int hf_cops_reserved24;
606 static int hf_cops_keyed_message_digest;
607 static int hf_cops_integrity_contents;
608 static int hf_cops_opaque_data;
610 /* For PacketCable D-QoS */
611 static int hf_cops_subtree;
612 static int hf_cops_pc_activity_count;
613 static int hf_cops_pc_algorithm;
614 static int hf_cops_pc_close_subcode;
615 static int hf_cops_pc_cmts_ip;
616 static int hf_cops_pc_cmts_ip_port;
617 static int hf_cops_pc_prks_ip;
618 static int hf_cops_pc_prks_ip_port;
619 static int hf_cops_pc_srks_ip;
620 static int hf_cops_pc_srks_ip_port;
621 static int hf_cops_pc_delete_subcode;
622 static int hf_cops_pc_dest_ip;
623 static int hf_cops_pc_dest_port;
624 static int hf_cops_pc_direction;
625 static int hf_cops_pc_ds_field;
626 static int hf_cops_pc_gate_id;
627 static int hf_cops_pc_gate_spec_flags;
628 static int hf_cops_pc_gate_command_type;
629 static int hf_cops_pc_key;
630 static int hf_cops_pc_max_packet_size;
631 static int hf_cops_pc_min_policed_unit;
632 static int hf_cops_pc_packetcable_err_code;
633 static int hf_cops_pc_packetcable_sub_code;
634 static int hf_cops_pc_peak_data_rate;
635 static int hf_cops_pc_protocol_id;
636 static int hf_cops_pc_reason_code;
637 static int hf_cops_pc_remote_flags;
638 static int hf_cops_pc_remote_gate_id;
639 static int hf_cops_pc_reserved;
640 static int hf_cops_pc_session_class;
641 static int hf_cops_pc_slack_term;
642 static int hf_cops_pc_spec_rate;
643 static int hf_cops_pc_src_ip;
644 static int hf_cops_pc_src_port;
645 static int hf_cops_pc_subscriber_id_ipv4;
646 static int hf_cops_pc_subscriber_id_ipv6;
647 static int hf_cops_pc_t1_value;
648 static int hf_cops_pc_t7_value;
649 static int hf_cops_pc_t8_value;
650 static int hf_cops_pc_token_bucket_rate;
651 static int hf_cops_pc_token_bucket_size;
652 static int hf_cops_pc_transaction_id;
653 static int hf_cops_pc_bcid_ts;
654 static int hf_cops_pc_bcid_id;
655 static int hf_cops_pc_bcid_tz;
656 static int hf_cops_pc_bcid_ev;
657 static int hf_cops_pc_dfcdc_ip;
658 static int hf_cops_pc_dfccc_ip;
659 static int hf_cops_pc_dfcdc_ip_port;
660 static int hf_cops_pc_dfccc_ip_port;
661 static int hf_cops_pc_dfccc_id;
663 /* PacketCable Multimedia */
664 static int hf_cops_pcmm_amid_app_type;
665 static int hf_cops_pcmm_amid_am_tag;
666 static int hf_cops_pcmm_gate_spec_flags;
667 static int hf_cops_pcmm_gate_spec_flags_gate;
668 static int hf_cops_pcmm_gate_spec_flags_dscp_overwrite;
669 static int hf_cops_pcmm_gate_spec_dscp_tos_field;
670 static int hf_cops_pcmm_gate_spec_dscp_tos_mask;
671 static int hf_cops_pcmm_gate_spec_session_class_id;
672 static int hf_cops_pcmm_gate_spec_session_class_id_priority;
673 static int hf_cops_pcmm_gate_spec_session_class_id_preemption;
674 static int hf_cops_pcmm_gate_spec_session_class_id_configurable;
675 static int hf_cops_pcmm_gate_spec_timer_t1;
676 static int hf_cops_pcmm_gate_spec_timer_t2;
677 static int hf_cops_pcmm_gate_spec_timer_t3;
678 static int hf_cops_pcmm_gate_spec_timer_t4;
679 static int hf_cops_pcmm_classifier_protocol_id;
680 static int hf_cops_pcmm_classifier_dscp_tos_field;
681 static int hf_cops_pcmm_classifier_dscp_tos_mask;
682 static int hf_cops_pcmm_classifier_src_addr;
683 static int hf_cops_pcmm_classifier_src_mask;
684 static int hf_cops_pcmm_classifier_dst_addr;
685 static int hf_cops_pcmm_classifier_dst_mask;
686 static int hf_cops_pcmm_classifier_src_port;
687 static int hf_cops_pcmm_classifier_src_port_end;
688 static int hf_cops_pcmm_classifier_dst_port;
689 static int hf_cops_pcmm_classifier_dst_port_end;
690 static int hf_cops_pcmm_classifier_priority;
691 static int hf_cops_pcmm_classifier_classifier_id;
692 static int hf_cops_pcmm_classifier_activation_state;
693 static int hf_cops_pcmm_classifier_action;
694 static int hf_cops_pcmm_classifier_flags;
695 static int hf_cops_pcmm_classifier_tc_low;
696 static int hf_cops_pcmm_classifier_tc_high;
697 static int hf_cops_pcmm_classifier_tc_mask;
698 static int hf_cops_pcmm_classifier_flow_label;
699 static int hf_cops_pcmm_classifier_next_header_type;
700 static int hf_cops_pcmm_classifier_source_prefix_length;
701 static int hf_cops_pcmm_classifier_destination_prefix_length;
702 static int hf_cops_pcmm_classifier_src_addr_v6;
703 static int hf_cops_pcmm_classifier_dst_addr_v6;
704 static int hf_cops_pcmm_flow_spec_envelope;
705 static int hf_cops_pcmm_flow_spec_service_number;
706 static int hf_cops_pcmm_docsis_scn;
707 static int hf_cops_pcmm_envelope;
708 static int hf_cops_pcmm_traffic_priority;
709 static int hf_cops_pcmm_request_transmission_policy;
710 static int hf_cops_pcmm_request_transmission_policy_sf_all_cm;
711 static int hf_cops_pcmm_request_transmission_policy_sf_priority;
712 static int hf_cops_pcmm_request_transmission_policy_sf_request_for_request;
713 static int hf_cops_pcmm_request_transmission_policy_sf_data_for_data;
714 static int hf_cops_pcmm_request_transmission_policy_sf_piggyback;
715 static int hf_cops_pcmm_request_transmission_policy_sf_concatenate;
716 static int hf_cops_pcmm_request_transmission_policy_sf_fragment;
717 static int hf_cops_pcmm_request_transmission_policy_sf_suppress;
718 static int hf_cops_pcmm_request_transmission_policy_sf_drop_packets;
719 static int hf_cops_pcmm_max_sustained_traffic_rate;
720 static int hf_cops_pcmm_max_traffic_burst;
721 static int hf_cops_pcmm_min_reserved_traffic_rate;
722 static int hf_cops_pcmm_ass_min_rtr_packet_size;
723 static int hf_cops_pcmm_max_concat_burst;
724 static int hf_cops_pcmm_req_att_mask;
725 static int hf_cops_pcmm_forbid_att_mask;
726 static int hf_cops_pcmm_att_aggr_rule_mask;
727 static int hf_cops_pcmm_nominal_polling_interval;
728 static int hf_cops_pcmm_tolerated_poll_jitter;
729 static int hf_cops_pcmm_unsolicited_grant_size;
730 static int hf_cops_pcmm_grants_per_interval;
731 static int hf_cops_pcmm_nominal_grant_interval;
732 static int hf_cops_pcmm_tolerated_grant_jitter;
733 static int hf_cops_pcmm_down_resequencing;
734 static int hf_cops_pcmm_down_peak_traffic_rate;
735 static int hf_cops_pcmm_max_downstream_latency;
736 static int hf_cops_pcmm_volume_based_usage_limit;
737 static int hf_cops_pcmm_time_based_usage_limit;
738 static int hf_cops_pcmm_gate_time_info;
739 static int hf_cops_pcmm_gate_usage_info;
740 static int hf_cops_pcmm_packetcable_error_code;
741 static int hf_cops_pcmm_packetcable_error_subcode;
742 static int hf_cops_pcmm_packetcable_gate_state;
743 static int hf_cops_pcmm_packetcable_gate_state_reason;
744 static int hf_cops_pcmm_packetcable_version_info_major;
745 static int hf_cops_pcmm_packetcable_version_info_minor;
746 static int hf_cops_pcmm_psid;
747 static int hf_cops_pcmm_synch_options_report_type;
748 static int hf_cops_pcmm_synch_options_synch_type;
749 static int hf_cops_pcmm_msg_receipt_key;
750 static int hf_cops_pcmm_userid;
751 static int hf_cops_pcmm_sharedresourceid;
754 /* Initialize the subtree pointers */
755 static int ett_cops;
756 static int ett_cops_ver_flags;
757 static int ett_cops_obj;
758 static int ett_cops_pr_obj;
759 static int ett_cops_obj_data;
760 static int ett_cops_r_type_flags;
761 static int ett_cops_itf;
762 static int ett_cops_reason;
763 static int ett_cops_decision;
764 static int ett_cops_error;
765 static int ett_cops_clientsi;
766 static int ett_cops_asn1;
767 static int ett_cops_gperror;
768 static int ett_cops_cperror;
769 static int ett_cops_pdp;
771 static expert_field ei_cops_pepid_not_null;
772 static expert_field ei_cops_trailing_garbage;
773 static expert_field ei_cops_bad_cops_object_length;
774 static expert_field ei_cops_bad_cops_pr_object_length;
775 static expert_field ei_cops_unknown_c_num;
776 /* static expert_field ei_cops_unknown_s_num; */
778 /* For PacketCable */
779 static int ett_cops_subtree;
781 static int ett_docsis_request_transmission_policy;
783 static dissector_handle_t cops_handle;
785 /* For request/response matching */
786 typedef struct _cops_conv_info_t {
787 wmem_map_t *pdus_tree;
788 } cops_conv_info_t;
790 typedef struct _cops_call_t
792 uint8_t op_code;
793 bool solicited;
794 uint32_t req_num;
795 uint32_t rsp_num;
796 nstime_t req_time;
797 } cops_call_t;
799 void proto_reg_handoff_cops(void);
800 static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, uint8_t op_code, uint32_t offset, proto_tree *tree, uint16_t client_type, uint32_t* handle_value);
801 static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree,
802 uint8_t op_code, uint16_t client_type, uint8_t c_num, uint8_t c_type, int len, uint32_t* handle_value);
804 static void dissect_cops_pr_objects(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree, int pr_len,
805 oid_info_t** oid_info_p, uint32_t** pprid_subids_p, unsigned* pprid_subids_len_p);
806 static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree,
807 uint8_t s_num, uint8_t s_type, int len,
808 oid_info_t** oid_info_p, uint32_t** pprid_subids, unsigned* pprid_subids_len);
810 /* Added for PacketCable */
811 static proto_tree *info_to_cops_subtree(tvbuff_t *, proto_tree *, int, int, const char *);
812 static proto_item *info_to_display(tvbuff_t *, proto_item *, int, int, const char *, const value_string *, int, int *);
814 static void cops_transaction_id(tvbuff_t *, packet_info *, proto_tree *, uint8_t, unsigned, uint32_t);
815 static void cops_subscriber_id_v4(tvbuff_t *, proto_tree *, unsigned, uint32_t);
816 static void cops_subscriber_id_v6(tvbuff_t *, proto_tree *, unsigned, uint32_t);
817 static void cops_gate_id(tvbuff_t *, proto_tree *, unsigned, uint32_t);
818 static void cops_activity_count(tvbuff_t *, proto_tree *, unsigned, uint32_t);
819 static void cops_gate_specs(tvbuff_t *, proto_tree *, unsigned, uint32_t);
820 static void cops_remote_gate_info(tvbuff_t *, proto_tree *, unsigned, uint32_t);
821 static void cops_packetcable_reason(tvbuff_t *, proto_tree *, unsigned, uint32_t);
822 static void cops_packetcable_error(tvbuff_t *, proto_tree *, unsigned, uint32_t);
823 static void cops_event_generation_info(tvbuff_t *, proto_tree *, unsigned, uint32_t);
824 static void cops_surveillance_parameters(tvbuff_t *, proto_tree *, unsigned, uint32_t);
826 static void cops_amid(tvbuff_t *, proto_tree *, unsigned, uint32_t);
828 static void decode_docsis_request_transmission_policy(tvbuff_t *tvb, uint32_t offset, proto_tree *tree);
830 static void cops_analyze_packetcable_dqos_obj(tvbuff_t *, packet_info *, proto_tree *, uint8_t, uint32_t);
831 static void cops_analyze_packetcable_mm_obj(tvbuff_t *, packet_info *, proto_tree *, uint8_t, uint32_t);
833 static bool cops_packetcable = true;
835 /* End of addition for PacketCable */
837 /* COPS PR Tags */
839 #define COPS_IPA 0 /* IP Address */
840 #define COPS_U32 2 /* Unsigned 32*/
841 #define COPS_TIT 3 /* TimeTicks */
842 #define COPS_OPQ 4 /* Opaque */
843 #define COPS_I64 10 /* Integer64 */
844 #define COPS_U64 11 /* Uinteger64 */
846 /* COPS PR Types */
848 #define COPS_NULL 0
849 #define COPS_INTEGER 1 /* l */
850 #define COPS_OCTETSTR 2 /* c */
851 #define COPS_OBJECTID 3 /* ul */
852 #define COPS_IPADDR 4 /* uc */
853 #define COPS_UNSIGNED32 5 /* ul */
854 #define COPS_TIMETICKS 7 /* ul */
855 #define COPS_OPAQUE 8 /* c */
856 #define COPS_INTEGER64 10 /* ll */
857 #define COPS_UNSIGNED64 11 /* ull */
859 typedef struct _COPS_CNV COPS_CNV;
861 struct _COPS_CNV
863 unsigned ber_class;
864 unsigned tag;
865 int syntax;
866 const char *name;
867 int* hfidp;
870 static const true_false_string tfs_upstream_downstream = { "Upstream", "Downstream" };
872 static COPS_CNV CopsCnv [] =
874 {BER_CLASS_UNI, BER_UNI_TAG_NULL, COPS_NULL, "NULL" , &hf_cops_epd_null},
875 {BER_CLASS_UNI, BER_UNI_TAG_INTEGER, COPS_INTEGER, "INTEGER", &hf_cops_epd_int},
876 {BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, COPS_OCTETSTR, "OCTET STRING", &hf_cops_epd_octets},
877 {BER_CLASS_UNI, BER_UNI_TAG_OID, COPS_OBJECTID, "OBJECTID", &hf_cops_epd_oid},
878 {BER_CLASS_APP, COPS_IPA, COPS_IPADDR, "IPADDR", &hf_cops_epd_ipv4},
879 {BER_CLASS_APP, COPS_U32, COPS_UNSIGNED32,"UNSIGNED32", &hf_cops_epd_u32},
880 {BER_CLASS_APP, COPS_TIT, COPS_TIMETICKS, "TIMETICKS", &hf_cops_epd_ticks},
881 {BER_CLASS_APP, COPS_OPQ, COPS_OPAQUE, "OPAQUE", &hf_cops_epd_opaque},
882 {BER_CLASS_APP, COPS_I64, COPS_INTEGER64, "INTEGER64", &hf_cops_epd_i64},
883 {BER_CLASS_APP, COPS_U64, COPS_UNSIGNED64, "UNSIGNED64", &hf_cops_epd_u64},
884 {BER_CLASS_ANY, 0, -1, NULL, NULL}
887 static int cops_tag_cls2syntax ( unsigned tag, unsigned cls ) {
888 COPS_CNV *cnv;
891 cnv = CopsCnv;
892 while (cnv->syntax != -1)
894 if (cnv->tag == tag && cnv->ber_class == cls)
896 return *(cnv->hfidp);
898 cnv++;
900 return hf_cops_epd_unknown;
903 static unsigned
904 get_cops_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
907 * Get the length of the COPS message.
909 return tvb_get_ntohl(tvb, offset + 4);
912 static int
913 dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
915 uint8_t op_code;
916 uint16_t client_type;
917 int object_len;
918 proto_item *ti, *tv;
919 proto_tree *cops_tree, *ver_flags_tree;
920 uint32_t msg_len;
921 uint32_t offset = 0;
922 uint8_t ver_flags;
923 int garbage;
924 uint32_t handle_value = 0;
926 /* variables for Request/Response tracking */
927 unsigned i;
928 bool is_solicited, is_request, is_response;
929 conversation_t *conversation;
930 cops_conv_info_t *cops_conv_info;
931 cops_call_t *cops_call;
932 wmem_array_t* pdus_array;
933 nstime_t delta;
935 col_set_str(pinfo->cinfo, COL_PROTOCOL, "COPS");
936 col_clear(pinfo->cinfo, COL_INFO);
938 op_code = tvb_get_uint8(tvb, 1);
939 col_add_fstr(pinfo->cinfo, COL_INFO, "COPS %s",
940 val_to_str_const(op_code, cops_op_code_vals, "Unknown Op Code"));
942 /* Currently used by PacketCable */
943 client_type = tvb_get_ntohs(tvb, 2);
945 ti = proto_tree_add_item(tree, proto_cops, tvb, offset, -1, ENC_NA);
946 cops_tree = proto_item_add_subtree(ti, ett_cops);
948 /* Version and flags share the same byte, put them in a subtree */
949 ver_flags = tvb_get_uint8(tvb, offset);
950 is_solicited = (lo_nibble(ver_flags) == 0x01);
951 tv = proto_tree_add_uint_format(cops_tree, hf_cops_ver_flags, tvb, offset, 1,
952 ver_flags, "Version: %u, Flags: %s",
953 hi_nibble(ver_flags),
954 val_to_str_const(lo_nibble(ver_flags), cops_flags_vals, "Unknown"));
955 ver_flags_tree = proto_item_add_subtree(tv, ett_cops_ver_flags);
956 proto_tree_add_uint(ver_flags_tree, hf_cops_version, tvb, offset, 1, ver_flags);
957 proto_tree_add_uint(ver_flags_tree, hf_cops_flags, tvb, offset, 1, ver_flags);
958 offset++;
960 proto_tree_add_item(cops_tree, hf_cops_op_code, tvb, offset, 1, ENC_BIG_ENDIAN);
961 offset ++;
962 proto_tree_add_item(cops_tree, hf_cops_client_type, tvb, offset, 2, ENC_BIG_ENDIAN);
963 offset += 2;
965 msg_len = tvb_get_ntohl(tvb, offset);
966 proto_tree_add_uint(cops_tree, hf_cops_msg_len, tvb, offset, 4, msg_len);
967 offset += 4;
969 while (tvb_reported_length_remaining(tvb, offset) >= COPS_OBJECT_HDR_SIZE) {
970 object_len = dissect_cops_object(tvb, pinfo, op_code, offset, cops_tree, client_type, &handle_value);
971 if (object_len < 0)
972 return offset;
973 offset += object_len;
976 garbage = tvb_reported_length_remaining(tvb, offset);
977 if (garbage > 0) {
978 proto_tree_add_expert_format(tree, pinfo, &ei_cops_trailing_garbage, tvb, offset, garbage, "Trailing garbage: %d byte%s", garbage, plurality(garbage, "", "s"));
981 /* Start request/response matching */
983 /* handle is 0(or not present), and op_code doesn't allow null handle, return */
984 /* TODO, add expert info for this abnormal */
985 if (handle_value == 0 &&
986 ( op_code != COPS_MSG_SSQ &&
987 op_code != COPS_MSG_OPN &&
988 op_code != COPS_MSG_CAT &&
989 op_code != COPS_MSG_CC &&
990 op_code != COPS_MSG_KA &&
991 op_code != COPS_MSG_SSC) ) {
992 return offset;
996 is_request =
997 op_code == COPS_MSG_REQ || /* expects DEC */
998 (op_code == COPS_MSG_DEC && !is_solicited) || /* expects RPT|DRQ */
999 /* COPS_MSG_RPT doesn't expect response */
1000 /* COPS_MSG_DRQ doesn't expect response */
1001 op_code == COPS_MSG_SSQ || /* expects RPT|DRQ|SSC */
1002 op_code == COPS_MSG_OPN || /* expects CAT|CC */
1003 /* COPS_MSG_CAT doesn't expect response */
1004 /* COPS_MSG_CC doesn't expect response */
1005 (op_code == COPS_MSG_KA && !is_solicited); /* expects KA from PDP, always initialized by PEP */
1006 /* COPS_MSG_SSC doesn't expect response */
1008 is_response =
1009 /* COPS_MSG_REQ request only */
1010 (op_code == COPS_MSG_DEC && is_solicited) || /* response only if reply REQ */
1011 (op_code == COPS_MSG_RPT && is_solicited) || /* response only if reply DEC/SSQ */
1012 (op_code == COPS_MSG_DRQ && is_solicited) || /* response only if reply DEC/SSQ */
1013 /* COPS_MSG_SSQ request only */
1014 /* COPS_MSG_OPN request only */
1015 op_code == COPS_MSG_CAT || /* response for OPN */
1016 (op_code == COPS_MSG_CC && is_solicited) || /* response for OPN */
1017 (op_code == COPS_MSG_KA && is_solicited) || /* response for KA from PEP */
1018 op_code == COPS_MSG_SSC; /* response for SSQ */
1020 conversation = find_or_create_conversation(pinfo);
1021 cops_conv_info = (cops_conv_info_t *)conversation_get_proto_data(conversation, proto_cops);
1022 if (!cops_conv_info) {
1023 cops_conv_info = wmem_new(wmem_file_scope(), cops_conv_info_t);
1025 cops_conv_info->pdus_tree = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
1026 conversation_add_proto_data(conversation, proto_cops, cops_conv_info);
1029 if ( is_request ||
1030 (op_code == COPS_MSG_DEC && is_solicited) ) { /* DEC as response for REQ is considered as request, because it expects RPT|DRQ */
1032 pdus_array = (wmem_array_t *)wmem_map_lookup(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value));
1033 if (pdus_array == NULL) { /* This is the first request we've seen with this handle_value */
1034 pdus_array = wmem_array_new(wmem_file_scope(), sizeof(cops_call_t *));
1035 wmem_map_insert(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value), pdus_array);
1038 if (!pinfo->fd->visited) {
1040 * XXX - yes, we're setting all the fields in this
1041 * structure, but there's padding between op_code
1042 * and solicited, and that can't be set.
1044 * For some reason, on some platforms, valgrind is
1045 * complaining about a test of the solicited field
1046 * accessing uninitialized data, perhaps because
1047 * the 8 bytes containing op_code and solicited is
1048 * being loaded as a unit. If the compiler is, for
1049 * example, turning a test of
1051 * cops_call->op_code == COPS_MSG_KA && !(cops_call->solicited)
1053 * into a load of those 8 bytes and a comparison against a value
1054 * with op_code being COPS_MSG_KA, solicited being false (0),
1055 * *and* the padding being zero, it's buggy, but overly-"clever"
1056 * buggy compilers do exist, so....)
1058 * So we use wmem_new0() to forcibly zero out the entire
1059 * structure before filling it in.
1061 cops_call = wmem_new0(wmem_file_scope(), cops_call_t);
1062 cops_call->op_code = op_code;
1063 cops_call->solicited = is_solicited;
1064 cops_call->req_num = pinfo->num;
1065 cops_call->rsp_num = 0;
1066 cops_call->req_time = pinfo->abs_ts;
1067 wmem_array_append_one(pdus_array, cops_call);
1069 else {
1070 for (i=0; i < wmem_array_get_count(pdus_array); i++) {
1071 cops_call = *(cops_call_t**)(wmem_array_index(pdus_array, i));
1072 if ( cops_call->req_num == pinfo->num
1073 && cops_call->rsp_num != 0) {
1074 ti = proto_tree_add_uint_format(cops_tree, hf_cops_response_in, tvb, 0, 0, cops_call->rsp_num,
1075 "Response to this request is in frame %u", cops_call->rsp_num);
1076 proto_item_set_generated(ti);
1082 if (is_response) {
1083 pdus_array = (wmem_array_t *)wmem_map_lookup(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value));
1085 if (pdus_array == NULL) /* There's no request with this handle value */
1086 return offset;
1088 if (!pinfo->fd->visited) {
1089 for (i=0; i < wmem_array_get_count(pdus_array); i++) {
1090 cops_call = *(cops_call_t**)(wmem_array_index(pdus_array, i));
1092 if (nstime_cmp(&pinfo->abs_ts, &cops_call->req_time) <= 0 || cops_call->rsp_num != 0)
1093 continue;
1095 if (
1096 ( (cops_call->op_code == COPS_MSG_REQ) &&
1097 (op_code == COPS_MSG_DEC && is_solicited) ) ||
1098 ( (cops_call->op_code == COPS_MSG_DEC) &&
1099 ( (op_code == COPS_MSG_RPT && is_solicited) ||
1100 (op_code == COPS_MSG_DRQ && is_solicited) ) ) ||
1101 ( (cops_call->op_code == COPS_MSG_SSQ) &&
1102 ( (op_code == COPS_MSG_RPT && is_solicited) ||
1103 (op_code == COPS_MSG_DRQ && is_solicited) ||
1104 (op_code == COPS_MSG_SSC) ) ) ||
1105 ( (cops_call->op_code == COPS_MSG_OPN) &&
1106 (op_code == COPS_MSG_CAT ||
1107 op_code == COPS_MSG_CC) ) ||
1108 ( (cops_call->op_code == COPS_MSG_KA && !(cops_call->solicited)) &&
1109 (op_code == COPS_MSG_KA && is_solicited) ) ) {
1110 cops_call->rsp_num = pinfo->num;
1111 break;
1115 else {
1116 for (i=0; i < wmem_array_get_count(pdus_array); i++) {
1117 cops_call = *(cops_call_t**)(wmem_array_index(pdus_array, i));
1118 if ( cops_call->rsp_num == pinfo->num ) {
1119 ti = proto_tree_add_uint_format(cops_tree, hf_cops_response_to, tvb, 0, 0, cops_call->req_num,
1120 "Response to a request in frame %u", cops_call->req_num);
1121 proto_item_set_generated(ti);
1123 nstime_delta(&delta, &pinfo->abs_ts, &cops_call->req_time);
1124 ti = proto_tree_add_time(cops_tree, hf_cops_response_time, tvb, 0, 0, &delta);
1125 proto_item_set_generated(ti);
1127 break;
1133 return tvb_reported_length(tvb);
1136 /* Code to actually dissect the packets */
1137 static int
1138 dissect_cops(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1140 tcp_dissect_pdus(tvb, pinfo, tree, cops_desegment, 8,
1141 get_cops_pdu_len, dissect_cops_pdu, data);
1142 return tvb_reported_length(tvb);
1145 static const char *cops_c_type_to_str(uint8_t c_num, uint8_t c_type)
1147 switch (c_num) {
1148 case COPS_OBJ_HANDLE:
1149 if (c_type == 1)
1150 return "Client Handle";
1151 break;
1152 case COPS_OBJ_IN_INT:
1153 case COPS_OBJ_OUT_INT:
1154 if (c_type == 1)
1155 return "IPv4 Address + Interface";
1156 else if (c_type == 2)
1157 return "IPv6 Address + Interface";
1158 break;
1159 case COPS_OBJ_DECISION:
1160 case COPS_OBJ_LPDPDECISION:
1161 if (c_type == 1)
1162 return "Decision Flags (Mandatory)";
1163 else if (c_type == 2)
1164 return "Stateless Data";
1165 else if (c_type == 3)
1166 return "Replacement Data";
1167 else if (c_type == 4)
1168 return "Client Specific Decision Data";
1169 else if (c_type == 5)
1170 return "Named Decision Data";
1171 break;
1172 case COPS_OBJ_CLIENTSI:
1173 if (c_type == 1)
1174 return "Signaled ClientSI";
1175 else if (c_type == 2)
1176 return "Named ClientSI";
1177 break;
1178 case COPS_OBJ_KATIMER:
1179 if (c_type == 1)
1180 return "Keep-alive timer value";
1181 break;
1182 case COPS_OBJ_PDPREDIRADDR:
1183 case COPS_OBJ_LASTPDPADDR:
1184 if (c_type == 1)
1185 return "IPv4 Address + TCP Port";
1186 else if (c_type == 2)
1187 return "IPv6 Address + TCP Port";
1188 break;
1189 case COPS_OBJ_ACCTTIMER:
1190 if (c_type == 1)
1191 return "Accounting timer value";
1192 break;
1193 case COPS_OBJ_INTEGRITY:
1194 if (c_type == 1)
1195 return "HMAC digest";
1196 break;
1199 return "";
1202 static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, uint8_t op_code, uint32_t offset, proto_tree *tree, uint16_t client_type, uint32_t* handle_value)
1204 int object_len, contents_len;
1205 uint8_t c_num, c_type;
1206 proto_item *ti;
1207 proto_tree *obj_tree;
1208 const char *type_str;
1210 object_len = tvb_get_ntohs(tvb, offset);
1211 if (object_len < COPS_OBJECT_HDR_SIZE) {
1212 /* Bogus! */
1213 ti = proto_tree_add_uint(tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1214 expert_add_info_format(pinfo, ti, &ei_cops_bad_cops_object_length,
1215 "Bad COPS object length: %u, should be at least %u",
1216 object_len, COPS_OBJECT_HDR_SIZE);
1217 return -1;
1219 c_num = tvb_get_uint8(tvb, offset + 2);
1220 c_type = tvb_get_uint8(tvb, offset + 3);
1222 ti = proto_tree_add_uint_format(tree, hf_cops_obj_c_num, tvb, offset, object_len, c_num,
1223 "%s: %s", val_to_str_const(c_num, cops_c_num_vals, "Unknown"),
1224 cops_c_type_to_str(c_num, c_type));
1225 obj_tree = proto_item_add_subtree(ti, ett_cops_obj);
1227 proto_tree_add_uint(obj_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1228 offset += 2;
1230 proto_tree_add_uint(obj_tree, hf_cops_obj_c_num, tvb, offset, 1, c_num);
1231 offset++;
1233 type_str = cops_c_type_to_str(c_num, c_type);
1234 proto_tree_add_uint_format_value(obj_tree, hf_cops_obj_c_type, tvb, offset, 1, c_type,
1235 "%s%s%u%s",
1236 type_str,
1237 strlen(type_str) ? " (" : "",
1238 c_type,
1239 strlen(type_str) ? ")" : "");
1240 offset++;
1242 contents_len = object_len - COPS_OBJECT_HDR_SIZE;
1243 dissect_cops_object_data(tvb, pinfo, offset, obj_tree, op_code, client_type, c_num, c_type, contents_len, handle_value);
1245 /* Pad to 32bit boundary */
1246 if (object_len % sizeof (uint32_t))
1247 object_len += ((int)sizeof (uint32_t) - object_len % (int)sizeof (uint32_t));
1249 return object_len;
1252 static void dissect_cops_pr_objects(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree, int pr_len,
1253 oid_info_t** oid_info_p, uint32_t** pprid_subids_p, unsigned* pprid_subids_len_p)
1255 int object_len, contents_len;
1256 uint8_t s_num, s_type;
1257 const char *type_str;
1258 int ret;
1259 proto_tree *cops_pr_tree, *obj_tree;
1260 proto_item *ti;
1262 cops_pr_tree = proto_item_add_subtree(tree, ett_cops_pr_obj);
1264 while (pr_len >= COPS_OBJECT_HDR_SIZE) {
1265 object_len = tvb_get_ntohs(tvb, offset);
1266 if (object_len < COPS_OBJECT_HDR_SIZE) {
1267 /* Bogus! */
1268 ti = proto_tree_add_uint(cops_pr_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1269 expert_add_info_format(pinfo, ti, &ei_cops_bad_cops_pr_object_length,
1270 "Bad COPS-PR object length: %u, should be at least %u",
1271 object_len, COPS_OBJECT_HDR_SIZE);
1272 return;
1274 s_num = tvb_get_uint8(tvb, offset + 2);
1276 ti = proto_tree_add_uint_format(cops_pr_tree, hf_cops_obj_s_num, tvb, offset, object_len, s_num,
1277 "%s", val_to_str_const(s_num, cops_s_num_vals, "Unknown"));
1278 obj_tree = proto_item_add_subtree(ti, ett_cops_pr_obj);
1280 proto_tree_add_uint(obj_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1281 offset += 2;
1282 pr_len -= 2;
1284 proto_tree_add_uint(obj_tree, hf_cops_obj_s_num, tvb, offset, 1, s_num);
1285 offset++;
1286 pr_len--;
1288 s_type = tvb_get_uint8(tvb, offset);
1289 type_str = val_to_str_const(s_type, cops_s_type_vals, "Unknown");
1290 proto_tree_add_uint_format_value(obj_tree, hf_cops_obj_s_type, tvb, offset, 1, s_type,
1291 "%s%s%u%s",
1292 type_str,
1293 strlen(type_str) ? " (" : "",
1294 s_type,
1295 strlen(type_str) ? ")" : "");
1296 offset++;
1297 pr_len--;
1299 contents_len = object_len - COPS_OBJECT_HDR_SIZE;
1300 ret = dissect_cops_pr_object_data(tvb, pinfo, offset, obj_tree, s_num, s_type, contents_len,
1301 oid_info_p, pprid_subids_p, pprid_subids_len_p);
1302 if (ret < 0)
1303 break;
1305 /* Pad to 32bit boundary */
1306 if (object_len % sizeof (uint32_t))
1307 object_len += ((int)sizeof (uint32_t) - object_len % (int)sizeof (uint32_t));
1309 pr_len -= object_len - COPS_OBJECT_HDR_SIZE;
1310 offset += object_len - COPS_OBJECT_HDR_SIZE;
1314 static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree,
1315 uint8_t op_code, uint16_t client_type, uint8_t c_num, uint8_t c_type, int len, uint32_t* handle_value)
1317 proto_item *ti;
1318 proto_tree *r_type_tree, *itf_tree, *reason_tree, *dec_tree, *error_tree, *clientsi_tree, *pdp_tree;
1319 uint16_t r_type, m_type, reason, reason_sub, cmd_code, cmd_flags, error, error_sub,
1320 tcp_port, katimer, accttimer;
1321 uint32_t ifindex;
1322 ws_in6_addr ipv6addr;
1323 oid_info_t* oid_info = NULL;
1324 uint32_t* pprid_subids = NULL;
1325 unsigned pprid_subids_len = 0;
1327 switch (c_num) {
1328 case COPS_OBJ_HANDLE: /* handle is a variable-length field, however 32bit seems enough for most of the applications */
1329 if (len >= 4) {
1330 offset += (len-4); /* for handle longer than 32bit, only take lowest 32 bits as handle */
1331 *handle_value = tvb_get_ntohl(tvb, offset);
1332 proto_tree_add_item(tree, hf_cops_handle, tvb, offset, 4, ENC_BIG_ENDIAN);
1334 break;
1335 case COPS_OBJ_CONTEXT:
1336 r_type = tvb_get_ntohs(tvb, offset);
1337 m_type = tvb_get_ntohs(tvb, offset + 2);
1338 r_type_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_r_type_flags, NULL,
1339 "Contents: R-Type: %s, M-Type: %u",
1340 val_to_str_const(r_type, cops_r_type_vals, "Unknown"), m_type);
1342 proto_tree_add_uint(r_type_tree, hf_cops_r_type_flags, tvb, offset, 2, r_type);
1343 offset += 2;
1344 proto_tree_add_uint(r_type_tree, hf_cops_m_type_flags, tvb, offset, 2, m_type);
1346 break;
1347 case COPS_OBJ_IN_INT:
1348 case COPS_OBJ_OUT_INT:
1349 if (c_type == 1) { /* IPv4 */
1350 ifindex = tvb_get_ntohl(tvb, offset + 4);
1351 itf_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_cops_itf, NULL,
1352 "Contents: IPv4 address %s, ifIndex: %u",
1353 tvb_ip_to_str(pinfo->pool, tvb, offset), ifindex);
1354 proto_tree_add_item(itf_tree,
1355 (c_num == COPS_OBJ_IN_INT) ? hf_cops_in_int_ipv4 : hf_cops_out_int_ipv4,
1356 tvb, offset, 4, ENC_BIG_ENDIAN);
1357 offset += 4;
1358 } else if (c_type == 2) { /* IPv6 */
1359 ifindex = tvb_get_ntohl(tvb, offset + (int)sizeof ipv6addr);
1360 itf_tree = proto_tree_add_subtree_format(tree, tvb, offset, 20, ett_cops_itf, NULL,
1361 "Contents: IPv6 address %s, ifIndex: %u",
1362 tvb_ip6_to_str(pinfo->pool, tvb, offset), ifindex);
1363 proto_tree_add_item(itf_tree,
1364 (c_num == COPS_OBJ_IN_INT) ? hf_cops_in_int_ipv6 : hf_cops_out_int_ipv6,
1365 tvb, offset, 16, ENC_NA);
1366 offset += 16;
1367 } else {
1368 break;
1370 proto_tree_add_uint(itf_tree, hf_cops_int_ifindex, tvb, offset, 4, ifindex);
1372 break;
1373 case COPS_OBJ_REASON:
1374 reason = tvb_get_ntohs(tvb, offset);
1375 reason_sub = tvb_get_ntohs(tvb, offset + 2);
1376 reason_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_reason, NULL,
1377 "Contents: Reason-Code: %s, Reason Sub-code: 0x%04x",
1378 val_to_str_const(reason, cops_reason_vals, "<Unknown value>"), reason_sub);
1379 proto_tree_add_uint(reason_tree, hf_cops_reason, tvb, offset, 2, reason);
1380 offset += 2;
1381 if (reason == 13) { /* RFC 2748 2.2.5 */
1382 proto_tree_add_uint_format_value(reason_tree, hf_cops_reason_sub, tvb, offset, 2,
1383 reason_sub, "Unknown object's C-Num %u, C-Type %u",
1384 tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1));
1385 } else
1386 proto_tree_add_uint(reason_tree, hf_cops_reason_sub, tvb, offset, 2, reason_sub);
1388 break;
1389 case COPS_OBJ_DECISION:
1390 case COPS_OBJ_LPDPDECISION:
1391 if (c_type == 1) {
1392 cmd_code = tvb_get_ntohs(tvb, offset);
1393 cmd_flags = tvb_get_ntohs(tvb, offset + 2);
1394 dec_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_decision, NULL, "Contents: Command-Code: %s, Flags: %s",
1395 val_to_str_const(cmd_code, cops_dec_cmd_code_vals, "<Unknown value>"),
1396 val_to_str_const(cmd_flags, cops_dec_cmd_flag_vals, "<Unknown flag>"));
1397 proto_tree_add_uint(dec_tree, hf_cops_dec_cmd_code, tvb, offset, 2, cmd_code);
1398 offset += 2;
1399 proto_tree_add_uint(dec_tree, hf_cops_dec_flags, tvb, offset, 2, cmd_flags);
1400 } else if (c_type == 5) { /*COPS-PR Data*/
1401 dec_tree = proto_tree_add_subtree_format(tree, tvb, offset, len, ett_cops_decision, NULL, "Contents: %d bytes", len);
1402 dissect_cops_pr_objects(tvb, pinfo, offset, dec_tree, len, &oid_info, &pprid_subids, &pprid_subids_len);
1405 /* PacketCable : Analyze the remaining data if available */
1406 if (client_type == COPS_CLIENT_PC_DQOS && c_type == 4) {
1407 cops_analyze_packetcable_dqos_obj(tvb, pinfo, tree, op_code, offset);
1408 } else if (client_type == COPS_CLIENT_PC_MM && c_type == 4) {
1409 cops_analyze_packetcable_mm_obj(tvb, pinfo, tree, op_code, offset);
1412 break;
1413 case COPS_OBJ_ERROR:
1414 if (c_type != 1)
1415 break;
1417 error = tvb_get_ntohs(tvb, offset);
1418 error_sub = tvb_get_ntohs(tvb, offset + 2);
1419 error_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_error, NULL,
1420 "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1421 val_to_str_const(error, cops_error_vals, "<Unknown value>"), error_sub);
1422 proto_tree_add_uint(error_tree, hf_cops_error, tvb, offset, 2, error);
1423 offset += 2;
1424 if (error == 13) { /* RFC 2748 2.2.8 */
1425 proto_tree_add_uint_format_value(error_tree, hf_cops_error_sub, tvb, offset, 2,
1426 error_sub, "Unknown object's C-Num %u, C-Type %u",
1427 tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1));
1428 } else
1429 proto_tree_add_uint(error_tree, hf_cops_error_sub, tvb, offset, 2, error_sub);
1431 break;
1432 case COPS_OBJ_CLIENTSI:
1434 /* For PacketCable */
1435 if (client_type == COPS_CLIENT_PC_DQOS && c_type == 1) {
1436 cops_analyze_packetcable_dqos_obj(tvb, pinfo, tree, op_code, offset);
1437 break;
1438 } else if (client_type == COPS_CLIENT_PC_MM && c_type == 1) {
1439 cops_analyze_packetcable_mm_obj(tvb, pinfo, tree, op_code, offset);
1440 break;
1443 if (c_type != 2) /*Not COPS-PR data*/
1444 break;
1446 clientsi_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_clientsi, NULL, "Contents: %d bytes", len);
1448 dissect_cops_pr_objects(tvb, pinfo, offset, clientsi_tree, len, &oid_info, &pprid_subids, &pprid_subids_len);
1450 break;
1451 case COPS_OBJ_KATIMER:
1452 if (c_type != 1)
1453 break;
1455 katimer = tvb_get_ntohs(tvb, offset + 2);
1456 if (katimer == 0) {
1457 proto_tree_add_uint_format_value(tree, hf_cops_katimer, tvb, offset + 2, 2, katimer, "0 (infinity)");
1458 } else {
1459 proto_tree_add_item(tree, hf_cops_katimer, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1461 break;
1462 case COPS_OBJ_PEPID:
1463 if (c_type != 1)
1464 break;
1466 if (tvb_strnlen(tvb, offset, len) == -1) {
1467 ti = proto_tree_add_item(tree, hf_cops_pepid, tvb, offset, len, ENC_ASCII);
1468 expert_add_info(pinfo, ti, &ei_cops_pepid_not_null);
1470 else
1471 proto_tree_add_item(tree, hf_cops_pepid, tvb, offset,
1472 tvb_strnlen(tvb, offset, len) + 1, ENC_ASCII);
1474 break;
1475 case COPS_OBJ_REPORT_TYPE:
1476 if (c_type != 1)
1477 break;
1479 proto_tree_add_item(tree, hf_cops_report_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1481 break;
1482 case COPS_OBJ_PDPREDIRADDR:
1483 case COPS_OBJ_LASTPDPADDR:
1484 if (c_type == 1) { /* IPv4 */
1485 tcp_port = tvb_get_ntohs(tvb, offset + 4 + 2);
1486 pdp_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_cops_pdp, NULL,
1487 "Contents: IPv4 address %s, TCP Port Number: %u",
1488 tvb_ip_to_str(pinfo->pool, tvb, offset), tcp_port);
1489 proto_tree_add_item(pdp_tree,
1490 (c_num == COPS_OBJ_PDPREDIRADDR) ? hf_cops_pdprediraddr_ipv4 : hf_cops_lastpdpaddr_ipv4,
1491 tvb, offset, 4, ENC_BIG_ENDIAN);
1492 offset += 4;
1493 } else if (c_type == 2) { /* IPv6 */
1494 tcp_port = tvb_get_ntohs(tvb, offset + (int)sizeof ipv6addr + 2);
1495 pdp_tree = proto_tree_add_subtree_format(tree, tvb, offset, 20, ett_cops_pdp, NULL,
1496 "Contents: IPv6 address %s, TCP Port Number: %u",
1497 tvb_ip6_to_str(pinfo->pool, tvb, offset), tcp_port);
1498 proto_tree_add_item(pdp_tree,
1499 (c_num == COPS_OBJ_PDPREDIRADDR) ? hf_cops_pdprediraddr_ipv6 : hf_cops_lastpdpaddr_ipv6,
1500 tvb, offset, 16, ENC_NA);
1501 offset += 16;
1502 } else {
1503 break;
1505 offset += 2;
1506 proto_tree_add_uint(pdp_tree, hf_cops_pdp_tcp_port, tvb, offset, 2, tcp_port);
1508 break;
1509 case COPS_OBJ_ACCTTIMER:
1510 if (c_type != 1)
1511 break;
1513 accttimer = tvb_get_ntohs(tvb, offset + 2);
1514 if (accttimer == 0) {
1515 proto_tree_add_uint_format_value(tree, hf_cops_accttimer, tvb, offset + 2, 2, accttimer,
1516 "0 (there SHOULD be no unsolicited accounting updates)");
1517 } else {
1518 proto_tree_add_item(tree, hf_cops_accttimer, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1520 break;
1521 case COPS_OBJ_INTEGRITY:
1522 if (c_type != 1)
1523 break; /* Not HMAC digest */
1525 proto_tree_add_item(tree, hf_cops_key_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1526 proto_tree_add_item(tree, hf_cops_seq_num, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1527 proto_tree_add_item(tree, hf_cops_keyed_message_digest, tvb, offset + 8 , len - 8, ENC_NA);
1529 break;
1530 default:
1531 proto_tree_add_expert_format(tree, pinfo, &ei_cops_unknown_c_num, tvb, offset, len, "Unknown C-Num %d, Contents: %d bytes", c_num, len);
1532 break;
1536 static unsigned redecode_oid(uint32_t* pprid_subids, unsigned pprid_subids_len, uint8_t* encoded_subids, unsigned encoded_len, uint32_t** subids_p) {
1537 unsigned i;
1538 unsigned n = 0;
1539 uint32_t subid = 0;
1540 uint32_t* subids;
1541 uint32_t* subid_overflow;
1543 for (i=0; i<encoded_len; i++) { if (! (encoded_subids[i] & 0x80 )) n++; }
1545 *subids_p = subids = (uint32_t *)wmem_alloc(wmem_packet_scope(), sizeof(uint32_t)*(n+pprid_subids_len));
1546 subid_overflow = subids+n+pprid_subids_len;
1547 for (i=0;i<pprid_subids_len;i++) subids[i] = pprid_subids[i];
1549 subids += pprid_subids_len;
1552 for (i=0; i<encoded_len; i++){
1553 uint8_t byte = encoded_subids[i];
1555 subid <<= 7;
1556 subid |= byte & 0x7F;
1558 if (byte & 0x80) {
1559 continue;
1562 DISSECTOR_ASSERT(subids < subid_overflow);
1563 *subids++ = subid;
1564 subid = 0;
1567 return pprid_subids_len+n;
1571 static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree,
1572 uint8_t s_num, uint8_t s_type, int len,
1573 oid_info_t** oid_info_p, uint32_t** pprid_subids, unsigned* pprid_subids_len) {
1574 proto_tree *asn_tree, *gperror_tree, *cperror_tree;
1575 uint16_t gperror=0, gperror_sub=0, cperror=0, cperror_sub=0;
1576 asn1_ctx_t actx;
1578 memset(&actx,0,sizeof(actx));
1579 actx.pinfo = pinfo;
1581 switch (s_num){
1582 case COPS_OBJ_PPRID: {
1583 tvbuff_t* oid_tvb = NULL;
1585 if (s_type != 1) /* Not Prefix Provisioning Instance Identifier (PPRID) */
1586 break;
1587 /* Never tested this branch */
1588 asn_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_cops_asn1, NULL, "Contents:");
1590 dissect_ber_object_identifier(false, &actx, asn_tree, tvb, offset, hf_cops_pprid_oid, &oid_tvb);
1592 if (oid_tvb) {
1593 int encoid_len;
1594 uint8_t* encoid;
1596 encoid_len = tvb_reported_length_remaining(oid_tvb,0);
1597 if (encoid_len > 0) {
1598 encoid = (uint8_t*)tvb_memdup(pinfo->pool,oid_tvb,0,encoid_len);
1599 (*pprid_subids_len) = oid_encoded2subid(pinfo->pool, encoid, encoid_len, pprid_subids);
1602 break;
1604 case COPS_OBJ_PRID: {
1605 uint32_t* subids;
1606 unsigned subids_len;
1607 unsigned matched;
1608 unsigned left;
1609 int8_t ber_class;
1610 bool ber_pc;
1611 int32_t ber_tag;
1612 unsigned encoid_len;
1613 uint8_t* encoid;
1614 oid_info_t* oid_info;
1616 if (s_type != 1) break; /* Not Provisioning Instance Identifier (PRID) */
1618 asn_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_cops_asn1, NULL, "Contents:");
1620 offset = get_ber_identifier(tvb, offset, &ber_class, &ber_pc, &ber_tag);
1621 offset = get_ber_length(tvb, offset, &encoid_len, NULL);
1623 /* TODO: check pc, class and tag */
1625 encoid = (uint8_t*)tvb_memdup(pinfo->pool,tvb,offset,encoid_len);
1627 if (*pprid_subids) {
1628 /* Never tested this branch */
1629 subids_len = redecode_oid(*pprid_subids, *pprid_subids_len, encoid, encoid_len, &subids);
1630 encoid_len = oid_subid2encoded(pinfo->pool, subids_len, subids, &encoid);
1631 } else {
1632 subids_len = oid_encoded2subid(pinfo->pool, encoid, encoid_len, &subids);
1635 proto_tree_add_oid(asn_tree,hf_cops_prid_oid,tvb,offset,encoid_len,encoid);
1637 oid_info = oid_get(subids_len, subids, &matched, &left);
1640 TODO: from RFC 3159 find-out how the values are mapped;
1641 when instead of an oid for an xxEntry
1642 we have one describing a scalar or something else;
1643 what's below works in most cases but is not complete.
1645 if (left <= 1 && oid_info->kind == OID_KIND_ROW) {
1646 *oid_info_p = oid_info;
1647 } else {
1648 *oid_info_p = NULL;
1651 break;
1653 case COPS_OBJ_EPD: {
1654 oid_info_t* oid_info;
1655 unsigned end_offset = offset + len;
1657 if (s_type != 1) break;/* Not Encoded Provisioning Instance Data (EPD) */
1659 asn_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_cops_asn1, NULL, "Contents:");
1662 * XXX: LAZINESS WARNING:
1663 * We are assuming that for the first element in the sequence
1664 * that describes an entry subid==1, and, that the subsequent elements
1665 * use ++subid; This is true for all IETF's PIBs (and good sense
1666 * indicates it should be this way) but AFAIK there's nothing in
1667 * SMIv2 that imposes this restriction. -- a lazy lego
1670 if(*oid_info_p) {
1671 if ((*oid_info_p)->kind == OID_KIND_ROW) {
1672 oid_info = (oid_info_t *)wmem_tree_lookup32((*oid_info_p)->children,1);
1673 } else {
1674 oid_info = NULL;
1676 } else {
1677 oid_info = NULL;
1681 while(offset < end_offset) {
1682 int8_t ber_class;
1683 bool ber_pc;
1684 int32_t ber_tag;
1685 uint32_t ber_length;
1686 bool ber_ind;
1687 int hfid;
1689 offset = get_ber_identifier(tvb, offset, &ber_class, &ber_pc, &ber_tag);
1690 offset = get_ber_length(tvb, offset, &ber_length, &ber_ind);
1692 if (oid_info) {
1694 * XXX: LAZINESS WARNING:
1695 * We are assuming that the value of the sequenced item is of
1696 * the right class, the right type and the right length.
1697 * We should check that to avoid throwing a Malformed packet and
1698 * keep dissecting.
1699 * We should verify the class and the tag match what we expect as well,
1700 * but COPS and SNMP use different tags (&#@$!) so the typedata in oid_info_t
1701 * does not work here.
1702 * -- a lazy lego
1704 hfid = oid_info->value_hfid;
1705 oid_info = (oid_info_t *)wmem_tree_lookup32((*oid_info_p)->children,oid_info->subid+1);
1706 } else
1707 hfid = cops_tag_cls2syntax( ber_tag, ber_class );
1708 switch (proto_registrar_get_ftype(hfid)) {
1710 case FT_INT8:
1711 case FT_INT16:
1712 case FT_INT24:
1713 case FT_INT32:
1714 case FT_INT64:
1715 case FT_UINT8:
1716 case FT_UINT16:
1717 case FT_UINT24:
1718 case FT_UINT32:
1719 case FT_UINT64:
1720 case FT_BOOLEAN:
1721 case FT_FLOAT:
1722 case FT_DOUBLE:
1723 case FT_IPv4:
1724 proto_tree_add_item(asn_tree,hfid,tvb,offset,ber_length,ENC_BIG_ENDIAN);
1725 break;
1727 case FT_STRING:
1728 proto_tree_add_item(asn_tree,hfid,tvb,offset,ber_length,ENC_ASCII|ENC_NA);
1729 break;
1731 default:
1732 proto_tree_add_item(asn_tree,hfid,tvb,offset,ber_length,ENC_NA);
1733 break;
1736 offset += ber_length;
1739 (*oid_info_p) = NULL;
1740 break;
1742 case COPS_OBJ_ERRPRID: {
1743 if (s_type != 1) break; /*Not Error Provisioning Instance Identifier (ErrorPRID)*/
1745 asn_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_cops_asn1, NULL, "Contents:");
1747 dissect_ber_object_identifier(false, &actx, asn_tree, tvb, offset, hf_cops_errprid_oid, NULL);
1749 break;
1751 case COPS_OBJ_GPERR:
1752 if (s_type != 1) /* Not Global Provisioning Error Object (GPERR) */
1753 break;
1755 gperror = tvb_get_ntohs(tvb, offset);
1756 gperror_sub = tvb_get_ntohs(tvb, offset + 2);
1757 gperror_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_gperror, NULL,
1758 "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1759 val_to_str_const(gperror, cops_gperror_vals, "<Unknown value>"), gperror_sub);
1760 proto_tree_add_uint(gperror_tree, hf_cops_gperror, tvb, offset, 2, gperror);
1761 offset += 2;
1762 if (gperror == 13) { /* RFC 3084 4.4 */
1763 proto_tree_add_uint_format_value(gperror_tree, hf_cops_gperror_sub, tvb, offset, 2,
1764 gperror_sub, "Unknown object's C-Num %u, C-Type %u",
1765 tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1));
1766 } else
1767 proto_tree_add_uint(gperror_tree, hf_cops_gperror_sub, tvb, offset, 2, gperror_sub);
1769 break;
1770 case COPS_OBJ_CPERR:
1771 if (s_type != 1) /*Not PRC Class Provisioning Error Object (CPERR) */
1772 break;
1774 cperror = tvb_get_ntohs(tvb, offset);
1775 cperror_sub = tvb_get_ntohs(tvb, offset + 2);
1776 cperror_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_gperror, NULL,
1777 "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1778 val_to_str_const(gperror, cops_gperror_vals, "<Unknown value>"), gperror_sub);
1779 proto_tree_add_uint(cperror_tree, hf_cops_cperror, tvb, offset, 2, cperror);
1780 offset += 2;
1781 if (cperror == 13) { /* RFC 3084 4.5 */
1782 proto_tree_add_uint_format_value(cperror_tree, hf_cops_cperror_sub, tvb, offset, 2, cperror_sub,
1783 "Unknown object's S-Num %u, C-Type %u",
1784 tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1));
1785 } else
1786 proto_tree_add_uint(cperror_tree, hf_cops_cperror_sub, tvb, offset, 2, cperror_sub);
1788 break;
1789 default:
1790 proto_tree_add_bytes_format_value(tree, hf_cops_integrity_contents, tvb, offset, len, NULL, "%d bytes", len);
1791 break;
1794 return 0;
1798 /* Register the protocol with Wireshark */
1799 void proto_register_cops(void)
1801 /* Setup list of header fields */
1802 static hf_register_info hf[] = {
1803 { &hf_cops_ver_flags,
1804 { "Version and Flags", "cops.ver_flags",
1805 FT_UINT8, BASE_HEX, NULL, 0x0,
1806 "Version and Flags in COPS Common Header", HFILL }
1808 { &hf_cops_version,
1809 { "Version", "cops.version",
1810 FT_UINT8, BASE_DEC, NULL, 0xF0,
1811 "Version in COPS Common Header", HFILL }
1813 { &hf_cops_flags,
1814 { "Flags", "cops.flags",
1815 FT_UINT8, BASE_HEX, VALS(cops_flags_vals), 0x0F,
1816 "Flags in COPS Common Header", HFILL }
1818 { &hf_cops_response_in,
1819 { "Response In", "cops.response_in",
1820 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0,
1821 "The response to this COPS request is in this frame", HFILL }
1823 { &hf_cops_response_to,
1824 { "Request In", "cops.response_to",
1825 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0,
1826 "This is a response to the COPS request in this frame", HFILL }
1828 { &hf_cops_response_time,
1829 { "Response Time", "cops.response_time",
1830 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
1831 "The time between the Call and the Reply", HFILL }
1833 { &hf_cops_op_code,
1834 { "Op Code", "cops.op_code",
1835 FT_UINT8, BASE_DEC, VALS(cops_op_code_vals), 0x0,
1836 "Op Code in COPS Common Header", HFILL }
1838 { &hf_cops_client_type,
1839 { "Client Type", "cops.client_type",
1840 FT_UINT16, BASE_DEC, VALS(cops_client_type_vals), 0x0,
1841 "Client Type in COPS Common Header", HFILL }
1843 { &hf_cops_msg_len,
1844 { "Message Length", "cops.msg_len",
1845 FT_UINT32, BASE_DEC, NULL, 0x0,
1846 "Message Length in COPS Common Header", HFILL }
1848 { &hf_cops_obj_len,
1849 { "Object Length", "cops.obj.len",
1850 FT_UINT32, BASE_DEC, NULL, 0x0,
1851 "Object Length in COPS Object Header", HFILL }
1853 { &hf_cops_obj_c_num,
1854 { "C-Num", "cops.c_num",
1855 FT_UINT8, BASE_DEC, VALS(cops_c_num_vals), 0x0,
1856 "C-Num in COPS Object Header", HFILL }
1858 { &hf_cops_obj_c_type,
1859 { "C-Type", "cops.c_type",
1860 FT_UINT8, BASE_DEC, NULL, 0x0,
1861 "C-Type in COPS Object Header", HFILL }
1864 { &hf_cops_obj_s_num,
1865 { "S-Num", "cops.s_num",
1866 FT_UINT8, BASE_DEC, VALS(cops_s_num_vals), 0x0,
1867 "S-Num in COPS-PR Object Header", HFILL }
1869 { &hf_cops_obj_s_type,
1870 { "S-Type", "cops.s_type",
1871 FT_UINT8, BASE_DEC, NULL, 0x0,
1872 "S-Type in COPS-PR Object Header", HFILL }
1874 { &hf_cops_handle,
1875 { "Handle", "cops.handle",
1876 FT_UINT32, BASE_HEX, NULL, 0x0,
1877 "Handle in COPS Handle Object", HFILL }
1879 { &hf_cops_r_type_flags,
1880 { "R-Type", "cops.context.r_type",
1881 FT_UINT16, BASE_HEX, VALS(cops_r_type_vals), 0x0,
1882 "R-Type in COPS Context Object", HFILL }
1884 { &hf_cops_m_type_flags,
1885 { "M-Type", "cops.context.m_type",
1886 FT_UINT16, BASE_HEX, NULL, 0x0,
1887 "M-Type in COPS Context Object", HFILL }
1889 { &hf_cops_in_int_ipv4,
1890 { "IPv4 address", "cops.in-int.ipv4",
1891 FT_IPv4, BASE_NONE, NULL, 0,
1892 "IPv4 address in COPS IN-Int object", HFILL }
1894 { &hf_cops_in_int_ipv6,
1895 { "IPv6 address", "cops.in-int.ipv6",
1896 FT_IPv6, BASE_NONE, NULL, 0,
1897 "IPv6 address in COPS IN-Int object", HFILL }
1899 { &hf_cops_out_int_ipv4,
1900 { "IPv4 address", "cops.out-int.ipv4",
1901 FT_IPv4, BASE_NONE, NULL, 0,
1902 "IPv4 address in COPS OUT-Int object", HFILL }
1904 { &hf_cops_out_int_ipv6,
1905 { "IPv6 address", "cops.out-int.ipv6",
1906 FT_IPv6, BASE_NONE, NULL, 0,
1907 "IPv6 address in COPS OUT-Int", HFILL }
1909 { &hf_cops_int_ifindex,
1910 { "ifIndex", "cops.in-out-int.ifindex",
1911 FT_UINT32, BASE_DEC, NULL, 0x0,
1912 "If SNMP is supported, corresponds to MIB-II ifIndex", HFILL }
1914 { &hf_cops_reason,
1915 { "Reason", "cops.reason",
1916 FT_UINT16, BASE_DEC, VALS(cops_reason_vals), 0,
1917 "Reason in Reason object", HFILL }
1919 { &hf_cops_reason_sub,
1920 { "Reason Sub-code", "cops.reason_sub",
1921 FT_UINT16, BASE_HEX, NULL, 0,
1922 "Reason Sub-code in Reason object", HFILL }
1924 { &hf_cops_dec_cmd_code,
1925 { "Command-Code", "cops.decision.cmd",
1926 FT_UINT16, BASE_DEC, VALS(cops_dec_cmd_code_vals), 0,
1927 "Command-Code in Decision/LPDP Decision object", HFILL }
1929 { &hf_cops_dec_flags,
1930 { "Flags", "cops.decision.flags",
1931 FT_UINT16, BASE_HEX, VALS(cops_dec_cmd_flag_vals), 0xffff,
1932 "Flags in Decision/LPDP Decision object", HFILL }
1934 { &hf_cops_error,
1935 { "Error", "cops.error",
1936 FT_UINT16, BASE_DEC, VALS(cops_error_vals), 0,
1937 "Error in Error object", HFILL }
1939 { &hf_cops_error_sub,
1940 { "Error Sub-code", "cops.error_sub",
1941 FT_UINT16, BASE_HEX, NULL, 0,
1942 "Error Sub-code in Error object", HFILL }
1944 { &hf_cops_katimer,
1945 { "Contents: KA Timer Value", "cops.katimer.value",
1946 FT_UINT16, BASE_DEC, NULL, 0,
1947 "Keep-Alive Timer Value in KATimer object", HFILL }
1949 { &hf_cops_pepid,
1950 { "Contents: PEP Id", "cops.pepid.id",
1951 FT_STRING, BASE_NONE, NULL, 0,
1952 "PEP Id in PEPID object", HFILL }
1954 { &hf_cops_report_type,
1955 { "Contents: Report-Type", "cops.report_type",
1956 FT_UINT16, BASE_DEC, VALS(cops_report_type_vals), 0,
1957 "Report-Type in Report-Type object", HFILL }
1959 { &hf_cops_pdprediraddr_ipv4,
1960 { "IPv4 address", "cops.pdprediraddr.ipv4",
1961 FT_IPv4, BASE_NONE, NULL, 0,
1962 "IPv4 address in COPS PDPRedirAddr object", HFILL }
1964 { &hf_cops_pdprediraddr_ipv6,
1965 { "IPv6 address", "cops.pdprediraddr.ipv6",
1966 FT_IPv6, BASE_NONE, NULL, 0,
1967 "IPv6 address in COPS PDPRedirAddr object", HFILL }
1969 { &hf_cops_lastpdpaddr_ipv4,
1970 { "IPv4 address", "cops.lastpdpaddr.ipv4",
1971 FT_IPv4, BASE_NONE, NULL, 0,
1972 "IPv4 address in COPS LastPDPAddr object", HFILL }
1974 { &hf_cops_lastpdpaddr_ipv6,
1975 { "IPv6 address", "cops.lastpdpaddr.ipv6",
1976 FT_IPv6, BASE_NONE, NULL, 0,
1977 "IPv6 address in COPS LastPDPAddr object", HFILL }
1979 { &hf_cops_pdp_tcp_port,
1980 { "TCP Port Number", "cops.pdp.tcp_port",
1981 FT_UINT32, BASE_DEC, NULL, 0x0,
1982 "TCP Port Number of PDP in PDPRedirAddr/LastPDPAddr object", HFILL }
1984 { &hf_cops_accttimer,
1985 { "Contents: ACCT Timer Value", "cops.accttimer.value",
1986 FT_UINT16, BASE_DEC, NULL, 0,
1987 "Accounting Timer Value in AcctTimer object", HFILL }
1989 { &hf_cops_key_id,
1990 { "Contents: Key ID", "cops.integrity.key_id",
1991 FT_UINT32, BASE_DEC, NULL, 0,
1992 "Key ID in Integrity object", HFILL }
1994 { &hf_cops_seq_num,
1995 { "Contents: Sequence Number", "cops.integrity.seq_num",
1996 FT_UINT32, BASE_DEC, NULL, 0,
1997 "Sequence Number in Integrity object", HFILL }
1999 { &hf_cops_keyed_message_digest,
2000 { "Contents: Keyed Message Digest", "cops.integrity.keyed_message_digest",
2001 FT_BYTES, BASE_NONE, NULL, 0,
2002 NULL, HFILL }
2004 { &hf_cops_integrity_contents,
2005 { "Contents", "cops.integrity.contents",
2006 FT_BYTES, BASE_NONE, NULL, 0,
2007 NULL, HFILL }
2009 { &hf_cops_opaque_data,
2010 { "Opaque Data", "cops.opaque_data",
2011 FT_BYTES, BASE_NONE, NULL, 0,
2012 NULL, HFILL }
2014 { &hf_cops_gperror,
2015 { "Error", "cops.gperror",
2016 FT_UINT16, BASE_DEC, VALS(cops_gperror_vals), 0,
2017 "Error in Error object", HFILL }
2019 { &hf_cops_gperror_sub,
2020 { "Error Sub-code", "cops.gperror_sub",
2021 FT_UINT16, BASE_HEX, NULL, 0,
2022 "Error Sub-code in Error object", HFILL }
2024 { &hf_cops_cperror,
2025 { "Error", "cops.cperror",
2026 FT_UINT16, BASE_DEC, VALS(cops_cperror_vals), 0,
2027 "Error in Error object", HFILL }
2029 { &hf_cops_cperror_sub,
2030 { "Error Sub-code", "cops.cperror_sub",
2031 FT_UINT16, BASE_HEX, NULL, 0,
2032 "Error Sub-code in Error object", HFILL }
2035 { &hf_cops_reserved8, { "Reserved", "cops.reserved", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } },
2036 { &hf_cops_reserved16, { "Reserved", "cops.reserved", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } },
2037 { &hf_cops_reserved24, { "Reserved", "cops.reserved", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL } },
2039 { &hf_cops_prid_oid, { "PRID Instance Identifier", "cops.prid.instance_id", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
2040 { &hf_cops_pprid_oid, { "Prefix Identifier", "cops.pprid.prefix_id", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
2041 { &hf_cops_errprid_oid, { "ErrorPRID Instance Identifier", "cops.errprid.instance_id", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
2042 { &hf_cops_epd_unknown, { "EPD Unknown Data", "cops.epd.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
2043 { &hf_cops_epd_null, { "EPD Null Data", "cops.epd.null", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
2044 { &hf_cops_epd_int, { "EPD Integer Data", "cops.epd.int", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2045 { &hf_cops_epd_octets, { "EPD Octet String Data", "cops.epd.octets", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
2046 { &hf_cops_epd_oid, { "EPD OID Data", "cops.epd.oid", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
2047 { &hf_cops_epd_ipv4, { "EPD IPAddress Data", "cops.epd.ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } },
2048 { &hf_cops_epd_u32, { "EPD Unsigned32 Data", "cops.epd.unsigned32", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2049 { &hf_cops_epd_ticks, { "EPD TimeTicks Data", "cops.epd.timeticks", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2050 { &hf_cops_epd_opaque, { "EPD Opaque Data", "cops.epd.opaque", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
2051 { &hf_cops_epd_i64, { "EPD Integer64 Data", "cops.epd.integer64", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2052 { &hf_cops_epd_u64, { "EPD Unsigned64 Data", "cops.epd.unsigned64", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2054 /* Added for PacketCable */
2056 { &hf_cops_subtree,
2057 { "Object Subtree", "cops.pc_subtree",
2058 FT_NONE, BASE_NONE, NULL, 0,
2059 NULL, HFILL }
2061 { &hf_cops_pc_ds_field,
2062 { "DS Field (DSCP or TOS)", "cops.pc_ds_field",
2063 FT_UINT8, BASE_HEX, NULL, 0x00,
2064 NULL, HFILL }
2066 { &hf_cops_pc_direction,
2067 { "Direction", "cops.pc_direction",
2068 FT_UINT8, BASE_HEX, NULL, 0x00,
2069 NULL, HFILL }
2071 { &hf_cops_pc_gate_spec_flags,
2072 { "Flags", "cops.pc_gate_spec_flags",
2073 FT_UINT8, BASE_HEX, NULL, 0x00,
2074 NULL, HFILL }
2076 { &hf_cops_pc_protocol_id,
2077 { "Protocol ID", "cops.pc_protocol_id",
2078 FT_UINT8, BASE_HEX, NULL, 0x00,
2079 NULL, HFILL }
2081 { &hf_cops_pc_session_class,
2082 { "Session Class", "cops.pc_session_class",
2083 FT_UINT8, BASE_HEX, NULL, 0x00,
2084 NULL, HFILL }
2086 { &hf_cops_pc_algorithm,
2087 { "Algorithm", "cops.pc_algorithm",
2088 FT_UINT16, BASE_HEX, NULL, 0x00,
2089 NULL, HFILL }
2091 { &hf_cops_pc_cmts_ip_port,
2092 { "CMTS IP Port", "cops.pc_cmts_ip_port",
2093 FT_UINT16, BASE_HEX, NULL, 0x00,
2094 NULL, HFILL }
2096 { &hf_cops_pc_prks_ip_port,
2097 { "PRKS IP Port", "cops.pc_prks_ip_port",
2098 FT_UINT16, BASE_HEX, NULL, 0x00,
2099 NULL, HFILL }
2101 { &hf_cops_pc_srks_ip_port,
2102 { "SRKS IP Port", "cops.pc_srks_ip_port",
2103 FT_UINT16, BASE_HEX, NULL, 0x00,
2104 NULL, HFILL }
2106 { &hf_cops_pc_dest_port,
2107 { "Destination IP Port", "cops.pc_dest_port",
2108 FT_UINT16, BASE_HEX, NULL, 0x00,
2109 NULL, HFILL }
2111 { &hf_cops_pc_packetcable_err_code,
2112 { "Error Code", "cops.pc_packetcable_err_code",
2113 FT_UINT16, BASE_HEX, NULL, 0x00,
2114 NULL, HFILL }
2116 { &hf_cops_pc_packetcable_sub_code,
2117 { "Error Sub Code", "cops.pc_packetcable_sub_code",
2118 FT_UINT16, BASE_HEX, NULL, 0x00,
2119 NULL, HFILL }
2121 { &hf_cops_pc_remote_flags,
2122 { "Flags", "cops.pc_remote_flags",
2123 FT_UINT16, BASE_HEX, NULL, 0x00,
2124 NULL, HFILL }
2126 { &hf_cops_pc_close_subcode,
2127 { "Reason Sub Code", "cops.pc_close_subcode",
2128 FT_UINT16, BASE_HEX, NULL, 0x00,
2129 NULL, HFILL }
2131 { &hf_cops_pc_gate_command_type,
2132 { "Gate Command Type", "cops.pc_gate_command_type",
2133 FT_UINT16, BASE_HEX, NULL, 0x00,
2134 NULL, HFILL }
2136 { &hf_cops_pc_reason_code,
2137 { "Reason Code", "cops.pc_reason_code",
2138 FT_UINT16, BASE_HEX, NULL, 0x00,
2139 NULL, HFILL }
2141 { &hf_cops_pc_delete_subcode,
2142 { "Reason Sub Code", "cops.pc_delete_subcode",
2143 FT_UINT16, BASE_HEX, NULL, 0x00,
2144 NULL, HFILL }
2146 { &hf_cops_pc_src_port,
2147 { "Source IP Port", "cops.pc_src_port",
2148 FT_UINT16, BASE_HEX, NULL, 0x00,
2149 NULL, HFILL }
2151 { &hf_cops_pc_t1_value,
2152 { "Timer T1 Value (sec)", "cops.pc_t1_value",
2153 FT_UINT16, BASE_HEX, NULL, 0x00,
2154 NULL, HFILL }
2156 { &hf_cops_pc_t7_value,
2157 { "Timer T7 Value (sec)", "cops.pc_t7_value",
2158 FT_UINT16, BASE_HEX, NULL, 0x00,
2159 NULL, HFILL }
2161 { &hf_cops_pc_t8_value,
2162 { "Timer T8 Value (sec)", "cops.pc_t8_value",
2163 FT_UINT16, BASE_HEX, NULL, 0x00,
2164 NULL, HFILL }
2166 { &hf_cops_pc_transaction_id,
2167 { "Transaction Identifier", "cops.pc_transaction_id",
2168 FT_UINT16, BASE_HEX, NULL, 0x00,
2169 NULL, HFILL }
2171 { &hf_cops_pc_cmts_ip,
2172 { "CMTS IP Address", "cops.pc_cmts_ip",
2173 FT_IPv4, BASE_NONE, NULL, 0x00,
2174 NULL, HFILL }
2176 { &hf_cops_pc_prks_ip,
2177 { "PRKS IP Address", "cops.pc_prks_ip",
2178 FT_IPv4, BASE_NONE, NULL, 0x00,
2179 NULL, HFILL }
2181 { &hf_cops_pc_srks_ip,
2182 { "SRKS IP Address", "cops.pc_srks_ip",
2183 FT_IPv4, BASE_NONE, NULL, 0x00,
2184 NULL, HFILL }
2186 { &hf_cops_pc_dfcdc_ip,
2187 { "DF IP Address CDC", "cops.pc_dfcdc_ip",
2188 FT_IPv4, BASE_NONE, NULL, 0x00,
2189 NULL, HFILL }
2191 { &hf_cops_pc_dfccc_ip,
2192 { "DF IP Address CCC", "cops.pc_dfccc_ip",
2193 FT_IPv4, BASE_NONE, NULL, 0x00,
2194 NULL, HFILL }
2196 { &hf_cops_pc_dfcdc_ip_port,
2197 { "DF IP Port CDC", "cops.pc_dfcdc_ip_port",
2198 FT_UINT16, BASE_HEX, NULL, 0x00,
2199 NULL, HFILL }
2201 { &hf_cops_pc_dfccc_ip_port,
2202 { "DF IP Port CCC", "cops.pc_dfccc_ip_port",
2203 FT_UINT16, BASE_HEX, NULL, 0x00,
2204 NULL, HFILL }
2206 { &hf_cops_pc_dfccc_id,
2207 { "CCC ID", "cops.pc_dfccc_id",
2208 FT_UINT32, BASE_DEC, NULL, 0x00,
2209 NULL, HFILL }
2211 { &hf_cops_pc_activity_count,
2212 { "Count", "cops.pc_activity_count",
2213 FT_UINT32, BASE_HEX, NULL, 0x00,
2214 NULL, HFILL }
2216 { &hf_cops_pc_dest_ip,
2217 { "Destination IP Address", "cops.pc_dest_ip",
2218 FT_IPv4, BASE_NONE, NULL, 0x00,
2219 NULL, HFILL }
2221 { &hf_cops_pc_gate_id,
2222 { "Gate Identifier", "cops.pc_gate_id",
2223 FT_UINT32, BASE_HEX, NULL, 0x00,
2224 NULL, HFILL }
2226 { &hf_cops_pc_max_packet_size,
2227 { "Maximum Packet Size", "cops.pc_max_packet_size",
2228 FT_UINT32, BASE_HEX, NULL, 0x00,
2229 NULL, HFILL }
2231 { &hf_cops_pc_min_policed_unit,
2232 { "Minimum Policed Unit", "cops.pc_min_policed_unit",
2233 FT_UINT32, BASE_HEX, NULL, 0x00,
2234 NULL, HFILL }
2236 { &hf_cops_pc_peak_data_rate,
2237 { "Peak Data Rate", "cops.pc_peak_data_rate",
2238 FT_FLOAT, BASE_NONE, NULL, 0x00,
2239 NULL, HFILL }
2241 { &hf_cops_pc_spec_rate,
2242 { "Rate", "cops.pc_spec_rate",
2243 FT_FLOAT, BASE_NONE, NULL, 0x00,
2244 NULL, HFILL }
2246 { &hf_cops_pc_remote_gate_id,
2247 { "Remote Gate ID", "cops.pc_remote_gate_id",
2248 FT_UINT32, BASE_HEX, NULL, 0x00,
2249 NULL, HFILL }
2251 { &hf_cops_pc_reserved,
2252 { "Reserved", "cops.pc_reserved",
2253 FT_UINT32, BASE_HEX, NULL, 0x00,
2254 NULL, HFILL }
2256 { &hf_cops_pc_key,
2257 { "Security Key", "cops.pc_key",
2258 FT_UINT32, BASE_HEX, NULL, 0x00,
2259 NULL, HFILL }
2261 { &hf_cops_pc_slack_term,
2262 { "Slack Term", "cops.pc_slack_term",
2263 FT_UINT32, BASE_HEX, NULL, 0x00,
2264 NULL, HFILL }
2266 { &hf_cops_pc_src_ip,
2267 { "Source IP Address", "cops.pc_src_ip",
2268 FT_IPv4, BASE_NONE, NULL, 0x00,
2269 NULL, HFILL }
2271 { &hf_cops_pc_subscriber_id_ipv4,
2272 { "Subscriber Identifier (IPv4)", "cops.pc_subscriber_id4",
2273 FT_IPv4, BASE_NONE, NULL, 0x00,
2274 NULL, HFILL }
2276 { &hf_cops_pc_subscriber_id_ipv6,
2277 { "Subscriber Identifier (IPv6)", "cops.pc_subscriber_id6",
2278 FT_IPv6, BASE_NONE, NULL, 0x00,
2279 NULL, HFILL }
2281 { &hf_cops_pc_token_bucket_rate,
2282 { "Token Bucket Rate", "cops.pc_token_bucket_rate",
2283 FT_FLOAT, BASE_NONE, NULL, 0x00,
2284 NULL, HFILL }
2286 { &hf_cops_pc_token_bucket_size,
2287 { "Token Bucket Size", "cops.pc_token_bucket_size",
2288 FT_FLOAT, BASE_NONE, NULL, 0x00,
2289 NULL, HFILL }
2291 { &hf_cops_pc_bcid_id,
2292 { "BCID - Element ID", "cops.pc_bcid.id",
2293 FT_STRING, BASE_NONE, NULL, 0x00,
2294 NULL, HFILL }
2296 { &hf_cops_pc_bcid_tz,
2297 { "BCID - Time Zone", "cops.pc_bcid.tz",
2298 FT_STRING, BASE_NONE, NULL, 0x00,
2299 NULL, HFILL }
2301 { &hf_cops_pc_bcid_ts,
2302 { "BDID Timestamp", "cops.pc_bcid_ts",
2303 FT_UINT32, BASE_HEX, NULL, 0x00,
2304 "BCID Timestamp", HFILL }
2306 { &hf_cops_pc_bcid_ev,
2307 { "BDID Event Counter", "cops.pc_bcid_ev",
2308 FT_UINT32, BASE_HEX, NULL, 0x00,
2309 "BCID Event Counter", HFILL }
2312 { &hf_cops_pcmm_amid_app_type,
2313 { "AMID Application Type", "cops.pc_mm_amid_application_type",
2314 FT_UINT32, BASE_DEC, NULL, 0,
2315 "PacketCable Multimedia AMID Application Type", HFILL }
2317 { &hf_cops_pcmm_amid_am_tag,
2318 { "AMID Application Manager Tag", "cops.pc_mm_amid_am_tag",
2319 FT_UINT32, BASE_DEC, NULL, 0,
2320 "PacketCable Multimedia AMID Application Manager Tag", HFILL }
2323 { &hf_cops_pcmm_gate_spec_flags,
2324 { "Flags", "cops.pc_mm_gs_flags",
2325 FT_UINT8, BASE_HEX, NULL, 0,
2326 "PacketCable Multimedia GateSpec Flags", HFILL }
2329 { &hf_cops_pcmm_gate_spec_flags_gate,
2330 { "Gate", "cops.pc_mm_gs_flags.gate",
2331 FT_BOOLEAN, 8, TFS(&tfs_upstream_downstream), 0x1,
2332 NULL, HFILL }
2335 { &hf_cops_pcmm_gate_spec_flags_dscp_overwrite,
2336 { "DSCP/TOS overwrite", "cops.pc_mm_gs_flags.dscp_overwrite",
2337 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x2,
2338 NULL, HFILL }
2341 { &hf_cops_pcmm_gate_spec_dscp_tos_field,
2342 { "DSCP/TOS Field", "cops.pc_mm_gs_dscp",
2343 FT_UINT8, BASE_HEX, NULL, 0,
2344 "PacketCable Multimedia GateSpec DSCP/TOS Field", HFILL }
2346 { &hf_cops_pcmm_gate_spec_dscp_tos_mask,
2347 { "DSCP/TOS Mask", "cops.pc_mm_gs_dscp_mask",
2348 FT_UINT8, BASE_HEX, NULL, 0,
2349 "PacketCable Multimedia GateSpec DSCP/TOS Mask", HFILL }
2351 { &hf_cops_pcmm_gate_spec_session_class_id,
2352 { "SessionClassID", "cops.pc_mm_gs_scid",
2353 FT_UINT8, BASE_DEC, NULL, 0,
2354 "PacketCable Multimedia GateSpec SessionClassID", HFILL }
2356 { &hf_cops_pcmm_gate_spec_session_class_id_priority,
2357 { "SessionClassID Priority", "cops.pc_mm_gs_scid_prio",
2358 FT_UINT8, BASE_DEC, NULL, 0x07,
2359 "PacketCable Multimedia GateSpec SessionClassID Priority", HFILL }
2361 { &hf_cops_pcmm_gate_spec_session_class_id_preemption,
2362 { "SessionClassID Preemption", "cops.pc_mm_gs_scid_preempt",
2363 FT_UINT8, BASE_DEC, NULL, 0x08,
2364 "PacketCable Multimedia GateSpec SessionClassID Preemption", HFILL }
2366 { &hf_cops_pcmm_gate_spec_session_class_id_configurable,
2367 { "SessionClassID Configurable", "cops.pc_mm_gs_scid_conf",
2368 FT_UINT8, BASE_DEC, NULL, 0xf0,
2369 "PacketCable Multimedia GateSpec SessionClassID Configurable", HFILL }
2371 { &hf_cops_pcmm_gate_spec_timer_t1,
2372 { "Timer T1", "cops.pc_mm_gs_timer_t1",
2373 FT_UINT16, BASE_DEC, NULL, 0,
2374 "PacketCable Multimedia GateSpec Timer T1", HFILL }
2376 { &hf_cops_pcmm_gate_spec_timer_t2,
2377 { "Timer T2", "cops.pc_mm_gs_timer_t2",
2378 FT_UINT16, BASE_DEC, NULL, 0,
2379 "PacketCable Multimedia GateSpec Timer T2", HFILL }
2381 { &hf_cops_pcmm_gate_spec_timer_t3,
2382 { "Timer T3", "cops.pc_mm_gs_timer_t3",
2383 FT_UINT16, BASE_DEC, NULL, 0,
2384 "PacketCable Multimedia GateSpec Timer T3", HFILL }
2386 { &hf_cops_pcmm_gate_spec_timer_t4,
2387 { "Timer T4", "cops.pc_mm_gs_timer_t4",
2388 FT_UINT16, BASE_DEC, NULL, 0,
2389 "PacketCable Multimedia GateSpec Timer T4", HFILL }
2392 { &hf_cops_pcmm_classifier_protocol_id,
2393 { "Protocol ID", "cops.pc_mm_classifier_proto_id",
2394 FT_UINT16, BASE_HEX, NULL, 0,
2395 "PacketCable Multimedia Classifier Protocol ID", HFILL }
2397 { &hf_cops_pcmm_classifier_dscp_tos_field,
2398 { "DSCP/TOS Field", "cops.pc_mm_classifier_dscp",
2399 FT_UINT8, BASE_HEX, NULL, 0,
2400 "PacketCable Multimedia Classifier DSCP/TOS Field", HFILL }
2402 { &hf_cops_pcmm_classifier_dscp_tos_mask,
2403 { "DSCP/TOS Mask", "cops.pc_mm_classifier_dscp_mask",
2404 FT_UINT8, BASE_HEX, NULL, 0,
2405 "PacketCable Multimedia Classifier DSCP/TOS Mask", HFILL }
2407 { &hf_cops_pcmm_classifier_src_addr,
2408 { "Source address", "cops.pc_mm_classifier_src_addr",
2409 FT_IPv4, BASE_NONE, NULL, 0,
2410 "PacketCable Multimedia Classifier Source IP Address", HFILL }
2412 { &hf_cops_pcmm_classifier_src_mask,
2413 { "Source mask", "cops.pc_mm_classifier_src_mask",
2414 FT_IPv4, BASE_NONE, NULL, 0,
2415 "PacketCable Multimedia Classifier Source Mask", HFILL }
2417 { &hf_cops_pcmm_classifier_dst_addr,
2418 { "Destination address", "cops.pc_mm_classifier_dst_addr",
2419 FT_IPv4, BASE_NONE, NULL, 0,
2420 "PacketCable Multimedia Classifier Destination IP Address", HFILL }
2422 { &hf_cops_pcmm_classifier_dst_mask,
2423 { "Destination mask", "cops.pc_mm_classifier_dst_mask",
2424 FT_IPv4, BASE_NONE, NULL, 0,
2425 "PacketCable Multimedia Classifier Destination Mask", HFILL }
2427 { &hf_cops_pcmm_classifier_src_port,
2428 { "Source Port", "cops.pc_mm_classifier_src_port",
2429 FT_UINT16, BASE_DEC, NULL, 0,
2430 "PacketCable Multimedia Classifier Source Port", HFILL }
2432 { &hf_cops_pcmm_classifier_src_port_end,
2433 { "Source Port End", "cops.pc_mm_classifier_src_port_end",
2434 FT_UINT16, BASE_DEC, NULL, 0,
2435 "PacketCable Multimedia Classifier Source Port End", HFILL }
2437 { &hf_cops_pcmm_classifier_dst_port,
2438 { "Destination Port", "cops.pc_mm_classifier_dst_port",
2439 FT_UINT16, BASE_DEC, NULL, 0,
2440 "PacketCable Multimedia Classifier Source Port", HFILL }
2442 { &hf_cops_pcmm_classifier_dst_port_end,
2443 { "Destination Port End", "cops.pc_mm_classifier_dst_port_end",
2444 FT_UINT16, BASE_DEC, NULL, 0,
2445 "PacketCable Multimedia Classifier Source Port End", HFILL }
2447 { &hf_cops_pcmm_classifier_priority,
2448 { "Priority", "cops.pc_mm_classifier_priority",
2449 FT_UINT8, BASE_HEX, NULL, 0,
2450 "PacketCable Multimedia Classifier Priority", HFILL }
2452 { &hf_cops_pcmm_classifier_classifier_id,
2453 { "Classifier Id", "cops.pc_mm_classifier_id",
2454 FT_UINT16, BASE_HEX, NULL, 0,
2455 "PacketCable Multimedia Classifier ID", HFILL }
2457 { &hf_cops_pcmm_classifier_activation_state,
2458 { "Activation State", "cops.pc_mm_classifier_activation_state",
2459 FT_UINT8, BASE_HEX, VALS(pcmm_activation_state_vals), 0,
2460 "PacketCable Multimedia Classifier Activation State", HFILL }
2462 { &hf_cops_pcmm_classifier_action,
2463 { "Action", "cops.pc_mm_classifier_action",
2464 FT_UINT8, BASE_HEX, VALS(pcmm_action_vals), 0,
2465 "PacketCable Multimedia Classifier Action", HFILL }
2467 { &hf_cops_pcmm_classifier_flags,
2468 { "Flags", "cops.pc_mm_classifier_flags",
2469 FT_UINT8, BASE_HEX, NULL, 0,
2470 "PacketCable Multimedia Classifier Flags", HFILL }
2472 { &hf_cops_pcmm_classifier_tc_low,
2473 { "tc-low", "cops.pc_mm_classifier_tc_low",
2474 FT_UINT8, BASE_HEX, NULL, 0,
2475 "PacketCable Multimedia Classifier tc-low", HFILL }
2477 { &hf_cops_pcmm_classifier_tc_high,
2478 { "tc-high", "cops.pc_mm_classifier_tc_high",
2479 FT_UINT8, BASE_HEX, NULL, 0,
2480 "PacketCable Multimedia Classifier tc-high", HFILL }
2482 { &hf_cops_pcmm_classifier_tc_mask,
2483 { "tc-mask", "cops.pc_mm_classifier_tc_mask",
2484 FT_UINT8, BASE_HEX, NULL, 0,
2485 "PacketCable Multimedia Classifier tc-mask", HFILL }
2487 { &hf_cops_pcmm_classifier_flow_label,
2488 { "Flow Label", "cops.pc_mm_classifier_flow_label",
2489 FT_UINT32, BASE_HEX, NULL, 0,
2490 "PacketCable Multimedia Classifier Flow Label", HFILL }
2492 { &hf_cops_pcmm_classifier_next_header_type,
2493 { "Next Header Type", "cops.pc_mm_classifier_next_header_type",
2494 FT_UINT16, BASE_HEX, NULL, 0,
2495 "PacketCable Multimedia Classifier Next Header Type", HFILL }
2497 { &hf_cops_pcmm_classifier_source_prefix_length,
2498 { "Source Prefix Length", "cops.pc_mm_classifier_source_prefix_length",
2499 FT_UINT8, BASE_HEX, NULL, 0,
2500 "PacketCable Multimedia Classifier Source Prefix Length", HFILL }
2502 { &hf_cops_pcmm_classifier_destination_prefix_length,
2503 { "Destination Prefix Length", "cops.pc_mm_classifier_destination_prefix_length",
2504 FT_UINT8, BASE_HEX, NULL, 0,
2505 "PacketCable Multimedia Classifier Destination Prefix Length", HFILL }
2507 { &hf_cops_pcmm_classifier_src_addr_v6,
2508 { "IPv6 Source Address", "cops.pc_mm_classifier_src_addr_v6",
2509 FT_IPv6, BASE_NONE, NULL, 0,
2510 "PacketCable Multimedia Classifier IPv6 Source Address", HFILL }
2512 { &hf_cops_pcmm_classifier_dst_addr_v6,
2513 { "IPv6 Destination Address", "cops.pc_mm_classifier_dst_addr_v6",
2514 FT_IPv6, BASE_NONE, NULL, 0,
2515 "PacketCable Multimedia Classifier IPv6 Destination Address", HFILL }
2518 { &hf_cops_pcmm_flow_spec_envelope,
2519 { "Envelope", "cops.pc_mm_fs_envelope",
2520 FT_UINT8, BASE_DEC, NULL, 0,
2521 "PacketCable Multimedia Flow Spec Envelope", HFILL }
2523 { &hf_cops_pcmm_flow_spec_service_number,
2524 { "Service Number", "cops.pc_mm_fs_svc_num",
2525 FT_UINT8, BASE_DEC, VALS(pcmm_flow_spec_service_vals), 0,
2526 "PacketCable Multimedia Flow Spec Service Number", HFILL }
2529 { &hf_cops_pcmm_docsis_scn,
2530 { "Service Class Name", "cops.pc_mm_docsis_scn",
2531 FT_STRINGZ, BASE_NONE, NULL, 0,
2532 "PacketCable Multimedia DOCSIS Service Class Name", HFILL }
2535 { &hf_cops_pcmm_envelope,
2536 { "Envelope", "cops.pc_mm_envelope",
2537 FT_UINT8, BASE_DEC, NULL, 0,
2538 "PacketCable Multimedia Envelope", HFILL }
2541 { &hf_cops_pcmm_traffic_priority,
2542 { "Traffic Priority", "cops.pc_mm_tp",
2543 FT_UINT8, BASE_DEC, NULL, 0,
2544 "PacketCable Multimedia Committed Envelope Traffic Priority", HFILL }
2546 { &hf_cops_pcmm_request_transmission_policy,
2547 { "Request Transmission Policy", "cops.pc_mm_rtp",
2548 FT_UINT32, BASE_HEX, NULL, 0,
2549 "PacketCable Multimedia Committed Envelope Traffic Priority", HFILL }
2551 { &hf_cops_pcmm_request_transmission_policy_sf_all_cm,
2552 { "The Service Flow MUST NOT use \"all CMs\" broadcast request opportunities", "cops.pc_mm_rtp.sf.all_cm",
2553 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
2554 NULL, HFILL }
2556 { &hf_cops_pcmm_request_transmission_policy_sf_priority,
2557 { "The Service Flow MUST NOT use Priority Request multicast request opportunities", "cops.pc_mm_rtp.sf.priority",
2558 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
2559 NULL, HFILL }
2561 { &hf_cops_pcmm_request_transmission_policy_sf_request_for_request,
2562 { "The Service Flow MUST NOT use Request/Data opportunities for Requests", "cops.pc_mm_rtp.sf.request_for_request",
2563 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000004,
2564 NULL, HFILL }
2566 { &hf_cops_pcmm_request_transmission_policy_sf_data_for_data,
2567 { "The Service Flow MUST NOT use Request/Data opportunities for Data", "cops.pc_mm_rtp.sf.data_for_data",
2568 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000008,
2569 NULL, HFILL }
2571 { &hf_cops_pcmm_request_transmission_policy_sf_piggyback,
2572 { "The Service Flow MUST NOT piggyback requests with data", "cops.pc_mm_rtp.sf.piggyback",
2573 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000010,
2574 NULL, HFILL }
2576 { &hf_cops_pcmm_request_transmission_policy_sf_concatenate,
2577 { "The Service Flow MUST NOT concatenate data", "cops.pc_mm_rtp.sf.concatenate",
2578 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000020,
2579 NULL, HFILL }
2581 { &hf_cops_pcmm_request_transmission_policy_sf_fragment,
2582 { "The Service Flow MUST NOT fragment data", "cops.pc_mm_rtp.sf.fragment",
2583 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000040,
2584 NULL, HFILL }
2586 { &hf_cops_pcmm_request_transmission_policy_sf_suppress,
2587 { "The Service Flow MUST NOT suppress payload headers", "cops.pc_mm_rtp.sf.suppress",
2588 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000080,
2589 NULL, HFILL }
2591 { &hf_cops_pcmm_request_transmission_policy_sf_drop_packets,
2592 { "The Service Flow MUST drop packets that do not fit in the Unsolicited Grant Size", "cops.pc_mm_rtp.sf.drop_packets",
2593 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000100,
2594 NULL, HFILL }
2596 { &hf_cops_pcmm_max_sustained_traffic_rate,
2597 { "Maximum Sustained Traffic Rate", "cops.pc_mm_mstr",
2598 FT_UINT32, BASE_DEC, NULL, 0,
2599 "PacketCable Multimedia Committed Envelope Maximum Sustained Traffic Rate", HFILL }
2601 { &hf_cops_pcmm_max_traffic_burst,
2602 { "Maximum Traffic Burst", "cops.pc_mm_mtb",
2603 FT_UINT32, BASE_DEC, NULL, 0,
2604 "PacketCable Multimedia Committed Envelope Maximum Traffic Burst", HFILL }
2606 { &hf_cops_pcmm_min_reserved_traffic_rate,
2607 { "Minimum Reserved Traffic Rate", "cops.pc_mm_mrtr",
2608 FT_UINT32, BASE_DEC, NULL, 0,
2609 "PacketCable Multimedia Committed Envelope Minimum Reserved Traffic Rate", HFILL }
2611 { &hf_cops_pcmm_ass_min_rtr_packet_size,
2612 { "Assumed Minimum Reserved Traffic Rate Packet Size", "cops.pc_mm_amrtrps",
2613 FT_UINT16, BASE_DEC, NULL, 0,
2614 "PacketCable Multimedia Committed Envelope Assumed Minimum Reserved Traffic Rate Packet Size", HFILL }
2616 { &hf_cops_pcmm_max_concat_burst,
2617 { "Maximum Concatenated Burst", "cops.pc_mm_mcburst",
2618 FT_UINT16, BASE_DEC, NULL, 0,
2619 "PacketCable Multimedia Committed Envelope Maximum Concatenated Burst", HFILL }
2621 { &hf_cops_pcmm_req_att_mask,
2622 { "Required Attribute Mask", "cops.pc_mm_ramask",
2623 FT_UINT16, BASE_DEC, NULL, 0,
2624 "PacketCable Multimedia Committed Envelope Required Attribute Mask", HFILL }
2626 { &hf_cops_pcmm_forbid_att_mask,
2627 { "Forbidden Attribute Mask", "cops.pc_mm_famask",
2628 FT_UINT16, BASE_DEC, NULL, 0,
2629 "PacketCable Multimedia Committed Envelope Forbidden Attribute Mask", HFILL }
2631 { &hf_cops_pcmm_att_aggr_rule_mask,
2632 { "Attribute Aggregation Rule Mask", "cops.pc_mm_aarmask",
2633 FT_UINT16, BASE_DEC, NULL, 0,
2634 "PacketCable Multimedia Committed Envelope Attribute Aggregation Rule Mask", HFILL }
2637 { &hf_cops_pcmm_nominal_polling_interval,
2638 { "Nominal Polling Interval", "cops.pc_mm_npi",
2639 FT_UINT32, BASE_DEC, NULL, 0,
2640 "PacketCable Multimedia Nominal Polling Interval", HFILL }
2643 { &hf_cops_pcmm_tolerated_poll_jitter,
2644 { "Tolerated Poll Jitter", "cops.pc_mm_tpj",
2645 FT_UINT32, BASE_DEC, NULL, 0,
2646 "PacketCable Multimedia Tolerated Poll Jitter", HFILL }
2649 { &hf_cops_pcmm_unsolicited_grant_size,
2650 { "Unsolicited Grant Size", "cops.pc_mm_ugs",
2651 FT_UINT16, BASE_DEC, NULL, 0,
2652 "PacketCable Multimedia Unsolicited Grant Size", HFILL }
2654 { &hf_cops_pcmm_grants_per_interval,
2655 { "Grants Per Interval", "cops.pc_mm_gpi",
2656 FT_UINT8, BASE_DEC, NULL, 0,
2657 "PacketCable Multimedia Grants Per Interval", HFILL }
2659 { &hf_cops_pcmm_nominal_grant_interval,
2660 { "Nominal Grant Interval", "cops.pc_mm_ngi",
2661 FT_UINT32, BASE_DEC, NULL, 0,
2662 "PacketCable Multimedia Nominal Grant Interval", HFILL }
2664 { &hf_cops_pcmm_tolerated_grant_jitter,
2665 { "Tolerated Grant Jitter", "cops.pc_mm_tgj",
2666 FT_UINT32, BASE_DEC, NULL, 0,
2667 "PacketCable Multimedia Tolerated Grant Jitter", HFILL }
2670 { &hf_cops_pcmm_down_resequencing,
2671 { "Downstream Resequencing", "cops.pc_mm_downres",
2672 FT_UINT32, BASE_DEC, NULL, 0,
2673 "PacketCable Multimedia Downstream Resequencing", HFILL }
2676 { &hf_cops_pcmm_down_peak_traffic_rate,
2677 { "Downstream Peak Traffic Rate", "cops.pc_mm_downpeak",
2678 FT_UINT32, BASE_DEC, NULL, 0,
2679 "PacketCable Multimedia Downstream Peak Traffic Rate", HFILL }
2682 { &hf_cops_pcmm_max_downstream_latency,
2683 { "Maximum Downstream Latency", "cops.pc_mm_mdl",
2684 FT_UINT32, BASE_DEC, NULL, 0,
2685 "PacketCable Multimedia Maximum Downstream Latency", HFILL }
2688 { &hf_cops_pcmm_volume_based_usage_limit,
2689 { "Usage Limit", "cops.pc_mm_vbul_ul",
2690 FT_UINT64, BASE_DEC, NULL, 0,
2691 "PacketCable Multimedia Volume-Based Usage Limit", HFILL }
2694 { &hf_cops_pcmm_time_based_usage_limit,
2695 { "Usage Limit", "cops.pc_mm_tbul_ul",
2696 FT_UINT32, BASE_DEC, NULL, 0,
2697 "PacketCable Multimedia Time-Based Usage Limit", HFILL }
2700 { &hf_cops_pcmm_gate_time_info,
2701 { "Gate Time Info", "cops.pc_mm_gti",
2702 FT_UINT32, BASE_DEC, NULL, 0,
2703 "PacketCable Multimedia Gate Time Info", HFILL }
2706 { &hf_cops_pcmm_gate_usage_info,
2707 { "Gate Usage Info", "cops.pc_mm_gui",
2708 FT_UINT64, BASE_DEC, NULL, 0,
2709 "PacketCable Multimedia Gate Usage Info", HFILL }
2712 { &hf_cops_pcmm_packetcable_error_code,
2713 { "Error-Code", "cops.pc_mm_error_ec",
2714 FT_UINT16, BASE_DEC, NULL, 0,
2715 "PacketCable Multimedia PacketCable-Error Error-Code", HFILL }
2717 { &hf_cops_pcmm_packetcable_error_subcode,
2718 { "Error-code", "cops.pc_mm_error_esc",
2719 FT_UINT16, BASE_HEX, NULL, 0,
2720 "PacketCable Multimedia PacketCable-Error Error Sub-code", HFILL }
2723 { &hf_cops_pcmm_packetcable_gate_state,
2724 { "State", "cops.pc_mm_gs_state",
2725 FT_UINT16, BASE_DEC, NULL, 0,
2726 "PacketCable Multimedia Gate State", HFILL }
2728 { &hf_cops_pcmm_packetcable_gate_state_reason,
2729 { "Reason", "cops.pc_mm_gs_reason",
2730 FT_UINT16, BASE_HEX, NULL, 0,
2731 "PacketCable Multimedia Gate State Reason", HFILL }
2733 { &hf_cops_pcmm_packetcable_version_info_major,
2734 { "Major Version Number", "cops.pc_mm_vi_major",
2735 FT_UINT16, BASE_DEC, NULL, 0,
2736 "PacketCable Multimedia Major Version Number", HFILL }
2738 { &hf_cops_pcmm_packetcable_version_info_minor,
2739 { "Minor Version Number", "cops.pc_mm_vi_minor",
2740 FT_UINT16, BASE_DEC, NULL, 0,
2741 "PacketCable Multimedia Minor Version Number", HFILL }
2744 { &hf_cops_pcmm_psid,
2745 { "PSID", "cops.pc_mm_psid",
2746 FT_UINT32, BASE_DEC, NULL, 0,
2747 "PacketCable Multimedia PSID", HFILL }
2750 { &hf_cops_pcmm_synch_options_report_type,
2751 { "Report Type", "cops.pc_mm_synch_options_report_type",
2752 FT_UINT8, BASE_DEC, VALS(pcmm_report_type_vals), 0,
2753 "PacketCable Multimedia Synch Options Report Type", HFILL }
2755 { &hf_cops_pcmm_synch_options_synch_type,
2756 { "Synch Type", "cops.pc_mm_synch_options_synch_type",
2757 FT_UINT8, BASE_DEC, VALS(pcmm_synch_type_vals), 0,
2758 "PacketCable Multimedia Synch Options Synch Type", HFILL }
2761 { &hf_cops_pcmm_msg_receipt_key,
2762 { "Msg Receipt Key", "cops.pc_mm_msg_receipt_key",
2763 FT_UINT32, BASE_HEX, NULL, 0,
2764 "PacketCable Multimedia Msg Receipt Key", HFILL }
2767 { &hf_cops_pcmm_userid,
2768 { "UserID", "cops.pc_mm_userid",
2769 FT_STRING, BASE_NONE, NULL, 0,
2770 "PacketCable Multimedia UserID", HFILL }
2773 { &hf_cops_pcmm_sharedresourceid,
2774 { "SharedResourceID", "cops.pc_mm_sharedresourceid",
2775 FT_UINT32, BASE_HEX, NULL, 0,
2776 "PacketCable Multimedia SharedResourceID", HFILL }
2779 /* End of addition for PacketCable */
2783 /* Setup protocol subtree array */
2784 static int *ett[] = {
2785 &ett_cops,
2786 &ett_cops_ver_flags,
2787 &ett_cops_obj,
2788 &ett_cops_pr_obj,
2789 &ett_cops_obj_data,
2790 &ett_cops_r_type_flags,
2791 &ett_cops_itf,
2792 &ett_cops_reason,
2793 &ett_cops_decision,
2794 &ett_cops_error,
2795 &ett_cops_clientsi,
2796 &ett_cops_asn1,
2797 &ett_cops_gperror,
2798 &ett_cops_cperror,
2799 &ett_cops_pdp,
2800 &ett_cops_subtree,
2801 &ett_docsis_request_transmission_policy,
2804 static ei_register_info ei[] = {
2805 { &ei_cops_pepid_not_null, { "cops.pepid.not_null", PI_MALFORMED, PI_NOTE, "PEP Id is not a NULL terminated ASCII string", EXPFILL }},
2806 { &ei_cops_trailing_garbage, { "cops.trailing_garbage", PI_UNDECODED, PI_NOTE, "Trailing garbage", EXPFILL }},
2807 { &ei_cops_bad_cops_object_length, { "cops.bad_cops_object_length", PI_MALFORMED, PI_ERROR, "COPS object length is too short", EXPFILL }},
2808 { &ei_cops_bad_cops_pr_object_length, { "cops.bad_cops_pr_object_length", PI_MALFORMED, PI_ERROR, "COPS-PR object length is too short", EXPFILL }},
2809 { &ei_cops_unknown_c_num, { "cops.unknown_c_num", PI_UNDECODED, PI_NOTE, "Unknown C-Num value", EXPFILL }},
2810 #if 0
2811 { &ei_cops_unknown_s_num, { "cops.unknown_s_num", PI_UNDECODED, PI_NOTE, "Unknown S-Num value", EXPFILL }},
2812 #endif
2816 module_t* cops_module;
2817 expert_module_t* expert_cops;
2819 /* Register the protocol name and description */
2820 proto_cops = proto_register_protocol("Common Open Policy Service", "COPS", "cops");
2822 /* Required function calls to register the header fields and subtrees used */
2823 proto_register_field_array(proto_cops, hf, array_length(hf));
2824 proto_register_subtree_array(ett, array_length(ett));
2825 expert_cops = expert_register_protocol(proto_cops);
2826 expert_register_field_array(expert_cops, ei, array_length(ei));
2828 /* Make dissector findable by name */
2829 cops_handle = register_dissector("cops", dissect_cops, proto_cops);
2831 /* Register our configuration options for cops */
2832 cops_module = prefs_register_protocol(proto_cops, NULL);
2833 prefs_register_bool_preference(cops_module, "desegment",
2834 "Reassemble COPS messages spanning multiple TCP segments",
2835 "Whether the COPS dissector should reassemble messages spanning multiple TCP segments."
2836 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
2837 &cops_desegment);
2839 /* For PacketCable */
2840 prefs_register_bool_preference(cops_module, "packetcable",
2841 "Decode for PacketCable clients",
2842 "Decode the COPS messages using PacketCable clients. (Select port 2126)",
2843 &cops_packetcable);
2845 prefs_register_static_text_preference(cops_module, "info_pibs",
2846 "PIB settings can be changed in the Name Resolution preferences",
2847 "PIB settings can be changed in the Name Resolution preferences");
2849 prefs_register_obsolete_preference(cops_module, "typefrommib");
2852 void proto_reg_handoff_cops(void)
2854 /* These could use a separate "preference name" (to avoid collision),
2855 but they are IANA registered and users could still use Decode As */
2856 dissector_add_uint("tcp.port", TCP_PORT_PKTCABLE_COPS, cops_handle);
2857 dissector_add_uint("tcp.port", TCP_PORT_PKTCABLE_MM_COPS, cops_handle);
2859 dissector_add_uint_with_preference("tcp.port", TCP_PORT_COPS, cops_handle);
2863 /* Additions for PacketCable ( Added by Dick Gooris, Lucent Technologies ) */
2865 /* Definitions for print formatting */
2866 /* XXX - Why don't we just use ftenum types here? */
2867 #define FMT_DEC 0
2868 #define FMT_HEX 1
2869 #define FMT_IPv4 2
2870 #define FMT_IPv6 3
2871 #define FMT_FLT 4
2872 #define FMT_STR 5
2874 /* Print the translated information in the display gui in a formatted way
2876 * octets = The number of octets to obtain from the buffer
2878 * vsp = If not a NULL pointer, it points to an array with text
2880 * mode = 0 -> print decimal value
2881 * 1 -> print hexadecimal vaue
2882 * 2 -> print value as an IPv4 address
2883 * 3 -> print value as an IPv6 address
2884 * 4 -> print value as an IEEE float
2885 * 5 -> print value as a string
2887 * This function in combination with the separate function info_to_cops_subtree() for subtrees.
2891 static proto_item *
2892 info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, const char *str, const value_string *vsp, int mode,int *hf_proto_parameter)
2894 proto_item *pi = NULL;
2895 uint8_t *codestr;
2896 uint8_t code8 = 0;
2897 uint16_t code16 = 0;
2898 uint32_t codeipv4 = 0;
2899 uint32_t code32 = 0;
2900 uint64_t code64 = 0;
2901 float codefl = 0.0f;
2903 /* Special section for printing strings */
2904 if (mode==FMT_STR) {
2905 codestr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, octets, ENC_ASCII);
2906 pi = proto_tree_add_string_format(stt, *hf_proto_parameter, tvb,
2907 offset, octets, codestr, "%-28s : %s", str, codestr);
2908 return pi;
2911 /* Print information elements in the specified way */
2912 switch (octets) {
2914 case 1:
2915 /* Get the octet */
2916 code8 = tvb_get_uint8( tvb, offset );
2917 if (vsp == NULL) {
2918 /* Hexadecimal format */
2919 if (mode==FMT_HEX)
2920 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2921 offset, octets, code8,"%-28s : 0x%02x",str,code8);
2922 else
2923 /* Print an 8 bits integer */
2924 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2925 offset, octets, code8,"%-28s : %u",str,code8);
2926 } else {
2927 if (mode==FMT_HEX)
2928 /* Hexadecimal format */
2929 pi = proto_tree_add_uint_format(
2930 stt, *hf_proto_parameter,tvb, offset, octets, code8,
2931 "%-28s : %s (0x%02x)",str,val_to_str_const(code8, vsp, "Unknown"),code8);
2932 else
2933 /* String table indexed */
2934 pi = proto_tree_add_uint_format(
2935 stt, *hf_proto_parameter,tvb, offset, octets, code8,
2936 "%-28s : %s (%u)",str,val_to_str_const(code8, vsp, "Unknown"),code8);
2938 break;
2940 case 2:
2942 /* Get the next two octets */
2943 code16 = tvb_get_ntohs(tvb,offset);
2944 if (vsp == NULL) {
2945 /* Hexadecimal format */
2946 if (mode==FMT_HEX)
2947 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2948 offset, octets, code16,"%-28s : 0x%04x",str,code16);
2949 else
2950 /* Print a 16 bits integer */
2951 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2952 offset, octets, code16,"%-28s : %u",str,code16);
2953 } else {
2954 if (mode==FMT_HEX)
2955 /* Hexadecimal format */
2956 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2957 offset, octets, code16,"%-28s : %s (0x%04x)", str,
2958 val_to_str(code16, vsp, "Unknown (0x%04x)"),code16);
2959 else
2960 /* Print a 16 bits integer */
2961 pi = proto_tree_add_uint_format(
2962 stt, *hf_proto_parameter,tvb, offset, octets, code16,
2963 "%-28s : %s (%u)",str,val_to_str(code16, vsp, "Unknown (0x%04x)"),code16);
2965 break;
2967 case 4:
2969 /* Get the next four octets */
2970 switch (mode) {
2971 case FMT_FLT: codefl = tvb_get_ntohieee_float(tvb,offset);
2972 break;
2973 case FMT_IPv4: codeipv4 = tvb_get_ipv4(tvb, offset);
2974 break;
2975 default: code32 = tvb_get_ntohl(tvb,offset);
2978 if (vsp == NULL) {
2979 /* Hexadecimal format */
2980 if (mode==FMT_HEX) {
2981 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2982 offset, octets, code32,"%-28s : 0x%08x",str,code32);
2983 break;
2985 /* Ip address format*/
2986 if (mode==FMT_IPv4) {
2987 pi = proto_tree_add_ipv4(stt, *hf_proto_parameter,tvb, offset, octets, codeipv4);
2988 break;
2990 /* Ieee float format */
2991 if (mode==FMT_FLT) {
2992 pi = proto_tree_add_float_format(stt, *hf_proto_parameter,tvb, offset, octets,
2993 codefl,"%-28s : %.10g",str,codefl);
2994 break;
2996 /* Print a 32 bits integer */
2997 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
2998 code32,"%-28s : %u",str,code32);
2999 } else {
3000 /* Hexadecimal format */
3001 if (mode==FMT_HEX)
3002 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
3003 code32,"%-28s : %s (0x%08x)",str,val_to_str_const(code32, vsp, "Unknown"),code32);
3004 else
3005 /* String table indexed */
3006 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
3007 code32,"%-28s : %s (%u)",str,val_to_str_const(code32, vsp, "Unknown"),code32);
3009 break;
3011 /* In case of more than 4 octets.... */
3012 default:
3014 if (mode==FMT_HEX) {
3015 pi = proto_tree_add_item(stt, *hf_proto_parameter,
3016 tvb, offset, octets, ENC_NA);
3017 } else if (mode==FMT_IPv6 && octets==16) {
3018 pi = proto_tree_add_item(stt, *hf_proto_parameter, tvb, offset, octets,
3019 ENC_NA);
3020 } else if (mode==FMT_DEC && octets==8) {
3021 code64 = tvb_get_ntoh64(tvb, offset);
3022 pi = proto_tree_add_uint64_format(stt, *hf_proto_parameter, tvb, offset, octets,
3023 code64, "%-28s : %" PRIu64, str, code64);
3024 } else {
3025 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,
3026 tvb, offset, octets, code32,"%s",str);
3028 break;
3031 return pi;
3034 /* Print the subtree information for cops */
3035 static proto_tree *
3036 info_to_cops_subtree(tvbuff_t *tvb, proto_tree *st, int n, int offset, const char *str) {
3037 proto_item *tv;
3039 tv = proto_tree_add_none_format( st, hf_cops_subtree, tvb, offset, n, "%s", str);
3040 return proto_item_add_subtree( tv, ett_cops_subtree );
3043 /* Cops - Section : D-QoS Transaction ID */
3044 static void
3045 cops_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, uint8_t op_code, unsigned n, uint32_t offset) {
3047 proto_tree *stt;
3048 uint16_t code16;
3049 char info[50];
3051 /* Create a subtree */
3052 stt = info_to_cops_subtree(tvb,st,n,offset,"D-QoS Transaction ID");
3053 offset += 4;
3055 /* Transaction Identifier */
3056 info_to_display(tvb,stt,offset,2,"D-QoS Transaction Identifier", NULL,FMT_DEC,&hf_cops_pc_transaction_id);
3057 offset +=2;
3059 /* Gate Command Type */
3060 code16 = tvb_get_ntohs(tvb,offset);
3061 proto_tree_add_uint_format(stt, hf_cops_pc_gate_command_type,tvb, offset, 2,
3062 code16,"%-28s : %s (%u)", "Gate Command Type",
3063 val_to_str(code16,table_cops_dqos_transaction_id, "Unknown (0x%04x)"),code16);
3065 /* Write the right data into the 'info field' on the Gui */
3066 snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
3067 val_to_str_const(code16,table_cops_dqos_transaction_id, "Unknown"));
3069 col_add_str(pinfo->cinfo, COL_INFO,info);
3072 /* Cops - Section : Subscriber IDv4 */
3073 static void
3074 cops_subscriber_id_v4(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3076 proto_item *tv;
3078 /* Create a subtree */
3079 tv = info_to_cops_subtree(tvb,st,n,offset,"Subscriber ID (IPv4)");
3080 offset += 4;
3082 /* Subscriber Identifier */
3083 info_to_display(tvb,tv,offset,4,"Subscriber Identifier (IPv4)", NULL,FMT_IPv4,&hf_cops_pc_subscriber_id_ipv4);
3086 /* Cops - Section : Subscriber IDv6 */
3087 static void
3088 cops_subscriber_id_v6(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3090 proto_item *tv;
3092 /* Create a subtree */
3093 tv = info_to_cops_subtree(tvb,st,n,offset,"Subscriber ID (IPv6)");
3094 offset += 4;
3096 /* Subscriber Identifier */
3097 info_to_display(tvb,tv,offset,16,"Subscriber Identifier (IPv6)", NULL,FMT_IPv6,&hf_cops_pc_subscriber_id_ipv6);
3100 /* Cops - Section : Gate ID */
3101 static void
3102 cops_gate_id(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3104 proto_tree *stt;
3106 /* Create a subtree */
3107 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate ID");
3108 offset += 4;
3110 /* Gate Identifier */
3111 info_to_display(tvb,stt,offset,4,"Gate Identifier", NULL,FMT_HEX,&hf_cops_pc_gate_id);
3114 /* Cops - Section : Activity Count */
3115 static void
3116 cops_activity_count(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3118 proto_tree *stt;
3120 /* Create a subtree */
3121 stt = info_to_cops_subtree(tvb,st,n,offset,"Activity Count");
3122 offset += 4;
3124 /* Activity Count */
3125 info_to_display(tvb,stt,offset,4,"Count", NULL,FMT_DEC,&hf_cops_pc_activity_count);
3128 /* Cops - Section : Gate Specifications */
3129 static void
3130 cops_gate_specs(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3132 proto_tree *stt;
3134 /* Create a subtree */
3135 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Specifications");
3136 offset += 4;
3138 /* Direction */
3139 info_to_display(tvb,stt,offset,1,"Direction",table_cops_direction,FMT_DEC,&hf_cops_pc_direction);
3140 offset += 1;
3142 /* Protocol ID */
3143 info_to_display(tvb,stt,offset,1,"Protocol ID",NULL,FMT_DEC,&hf_cops_pc_protocol_id);
3144 offset += 1;
3146 /* Flags */
3147 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_DEC,&hf_cops_pc_gate_spec_flags);
3148 offset += 1;
3150 /* Session Class */
3151 info_to_display(tvb,stt,offset,1,"Session Class",table_cops_session_class,FMT_DEC,&hf_cops_pc_session_class);
3152 offset += 1;
3154 /* Source IP Address */
3155 info_to_display(tvb,stt,offset,4,"Source IP Address",NULL,FMT_IPv4,&hf_cops_pc_src_ip);
3156 offset += 4;
3158 /* Destination IP Address */
3159 info_to_display(tvb,stt,offset,4,"Destination IP Address",NULL,FMT_IPv4,&hf_cops_pc_dest_ip);
3160 offset += 4;
3162 /* Source IP Port */
3163 info_to_display(tvb,stt,offset,2,"Source IP Port",NULL,FMT_DEC,&hf_cops_pc_src_port);
3164 offset += 2;
3166 /* Destination IP Port */
3167 info_to_display(tvb,stt,offset,2,"Destination IP Port",NULL,FMT_DEC,&hf_cops_pc_dest_port);
3168 offset += 2;
3170 /* DiffServ Code Point */
3171 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS)",NULL,FMT_HEX,&hf_cops_pc_ds_field);
3172 offset += 1;
3174 /* 3 octets Not specified */
3175 offset += 3;
3177 /* Timer T1 Value */
3178 info_to_display(tvb,stt,offset,2,"Timer T1 Value (sec)",NULL,FMT_DEC,&hf_cops_pc_t1_value);
3179 offset += 2;
3181 /* Reserved */
3182 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_DEC,&hf_cops_pc_reserved);
3183 offset += 2;
3185 /* Timer T7 Value */
3186 info_to_display(tvb,stt,offset,2,"Timer T7 Value (sec)",NULL,FMT_DEC,&hf_cops_pc_t7_value);
3187 offset += 2;
3189 /* Timer T8 Value */
3190 info_to_display(tvb,stt,offset,2,"Timer T8 Value (sec)",NULL,FMT_DEC,&hf_cops_pc_t8_value);
3191 offset += 2;
3193 /* Token Bucket Rate */
3194 info_to_display(tvb,stt,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3195 offset += 4;
3197 /* Token Bucket Size */
3198 info_to_display(tvb,stt,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3199 offset += 4;
3201 /* Peak Data Rate */
3202 info_to_display(tvb,stt,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3203 offset += 4;
3205 /* Minimum Policed Unit */
3206 info_to_display(tvb,stt,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3207 offset += 4;
3209 /* Maximum Packet Size */
3210 info_to_display(tvb,stt,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3211 offset += 4;
3213 /* Rate */
3214 info_to_display(tvb,stt,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3215 offset += 4;
3217 /* Slack Term */
3218 info_to_display(tvb,stt,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3221 /* Cops - Section : Electronic Surveillance Parameters */
3222 static void
3223 cops_surveillance_parameters(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3225 proto_tree *stt;
3227 /* Create a subtree */
3228 stt = info_to_cops_subtree(tvb,st,n,offset,"Electronic Surveillance Parameters");
3229 offset += 4;
3231 /* DF IP Address for CDC */
3232 info_to_display(tvb,stt,offset,4,"DF IP Address for CDC", NULL,FMT_IPv4,&hf_cops_pc_dfcdc_ip);
3233 offset += 4;
3235 /* DF IP Port for CDC */
3236 info_to_display(tvb,stt,offset,2,"DF IP Port for CDC",NULL,FMT_DEC,&hf_cops_pc_dfcdc_ip_port);
3237 offset += 2;
3239 /* Flags */
3240 info_to_display(tvb,stt,offset,2,"Flags",NULL,FMT_HEX,&hf_cops_pc_gate_spec_flags);
3241 offset += 2;
3243 /* DF IP Address for CCC */
3244 info_to_display(tvb,stt,offset,4,"DF IP Address for CCC", NULL,FMT_IPv4,&hf_cops_pc_dfccc_ip);
3245 offset += 4;
3247 /* DF IP Port for CCC */
3248 info_to_display(tvb,stt,offset,2,"DF IP Port for CCC",NULL,FMT_DEC,&hf_cops_pc_dfccc_ip_port);
3249 offset += 2;
3251 /* Reserved */
3252 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3253 offset += 2;
3255 /* CCCID */
3256 info_to_display(tvb,stt,offset,4,"CCCID", NULL,FMT_DEC,&hf_cops_pc_dfccc_id);
3257 offset += 4;
3259 /* BCID Timestamp */
3260 info_to_display(tvb,stt,offset,4,"BCID - Timestamp",NULL,FMT_HEX,&hf_cops_pc_bcid_ts);
3261 offset += 4;
3263 /* BCID Element ID */
3264 proto_tree_add_item(stt, hf_cops_pc_bcid_id, tvb, offset, 8, ENC_ASCII);
3265 offset += 8;
3267 /* BCID Time Zone */
3268 proto_tree_add_item(stt, hf_cops_pc_bcid_tz, tvb, offset, 8, ENC_ASCII);
3269 offset += 8;
3271 /* BCID Event Counter */
3272 info_to_display(tvb,stt,offset,4,"BCID - Event Counter",NULL,FMT_DEC,&hf_cops_pc_bcid_ev);
3275 /* Cops - Section : Event Gereration-Info */
3276 static void
3277 cops_event_generation_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3279 proto_tree *stt;
3281 /* Create a subtree */
3282 stt = info_to_cops_subtree(tvb,st,n,offset,"Event Generation Info");
3283 offset += 4;
3285 /* Primary Record Keeping Server IP Address */
3286 info_to_display(tvb,stt,offset,4,"PRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_prks_ip);
3287 offset += 4;
3289 /* Primary Record Keeping Server IP Port */
3290 info_to_display(tvb,stt,offset,2,"PRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_prks_ip_port);
3291 offset += 2;
3293 /* Flags */
3294 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_HEX,&hf_cops_pc_gate_spec_flags);
3295 offset += 1;
3297 /* Reserved */
3298 info_to_display(tvb,stt,offset,1,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3299 offset += 1;
3301 /* Secondary Record Keeping Server IP Address */
3302 info_to_display(tvb,stt,offset,4,"SRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_srks_ip);
3303 offset += 4;
3305 /* Secondary Record Keeping Server IP Port */
3306 info_to_display(tvb,stt,offset,2,"SRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_srks_ip_port);
3307 offset += 2;
3309 /* Flags */
3310 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_DEC,&hf_cops_pc_gate_spec_flags);
3311 offset += 1;
3313 /* Reserved */
3314 info_to_display(tvb,stt,offset,1,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3315 offset += 1;
3317 /* BCID Timestamp */
3318 info_to_display(tvb,stt,offset,4,"BCID - Timestamp",NULL,FMT_HEX,&hf_cops_pc_bcid_ts);
3319 offset += 4;
3321 /* BCID Element ID */
3322 proto_tree_add_item(stt, hf_cops_pc_bcid_id, tvb, offset, 8, ENC_ASCII);
3323 offset += 8;
3325 /* BCID Time Zone */
3326 proto_tree_add_item(stt, hf_cops_pc_bcid_tz, tvb, offset, 8, ENC_ASCII);
3327 offset += 8;
3329 /* BCID Event Counter */
3330 info_to_display(tvb,stt,offset,4,"BCID - Event Counter",NULL,FMT_DEC,&hf_cops_pc_bcid_ev);
3333 /* Cops - Section : Remote Gate */
3334 static void
3335 cops_remote_gate_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3337 proto_tree *stt;
3339 /* Create a subtree */
3340 stt = info_to_cops_subtree(tvb,st,n,offset,"Remote Gate Info");
3341 offset += 4;
3343 /* CMTS IP Address */
3344 info_to_display(tvb,stt,offset,4,"CMTS IP Address", NULL,FMT_IPv4,&hf_cops_pc_cmts_ip);
3345 offset += 4;
3347 /* CMTS IP Port */
3348 info_to_display(tvb,stt,offset,2,"CMTS IP Port",NULL,FMT_DEC,&hf_cops_pc_cmts_ip_port);
3349 offset += 2;
3351 /* Flags */
3352 info_to_display(tvb,stt,offset,2,"Flags",NULL,FMT_DEC,&hf_cops_pc_remote_flags);
3353 offset += 2;
3355 /* Remote Gate ID */
3356 info_to_display(tvb,stt,offset,4,"Remote Gate ID", NULL,FMT_HEX,&hf_cops_pc_remote_gate_id);
3357 offset += 4;
3359 /* Algorithm */
3360 info_to_display(tvb,stt,offset,2,"Algorithm", NULL,FMT_DEC,&hf_cops_pc_algorithm);
3361 offset += 2;
3363 /* Reserved */
3364 info_to_display(tvb,stt,offset,4,"Reserved", NULL,FMT_HEX,&hf_cops_pc_reserved);
3365 offset += 4;
3367 /* Security Key */
3368 info_to_display(tvb,stt,offset,4,"Security Key", NULL,FMT_HEX,&hf_cops_pc_key);
3369 offset += 4;
3371 /* Security Key */
3372 info_to_display(tvb,stt,offset,4,"Security Key (cont)", NULL,FMT_HEX,&hf_cops_pc_key);
3373 offset += 4;
3375 /* Security Key */
3376 info_to_display(tvb,stt,offset,4,"Security Key (cont)", NULL,FMT_HEX,&hf_cops_pc_key);
3377 offset += 4;
3379 /* Security Key */
3380 info_to_display(tvb,stt,offset,4,"Security Key (cont)", NULL,FMT_HEX,&hf_cops_pc_key);
3383 /* Cops - Section : PacketCable reason */
3384 static void
3385 cops_packetcable_reason(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3387 proto_tree *stt;
3388 uint16_t code16;
3390 /* Create a subtree */
3391 stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Reason");
3392 offset += 4;
3394 /* Reason Code */
3395 code16 = tvb_get_ntohs(tvb,offset);
3396 proto_tree_add_uint_format(stt, hf_cops_pc_reason_code,tvb, offset, 2,
3397 code16, "%-28s : %s (%u)","Reason Code",
3398 val_to_str(code16, table_cops_reason_code, "Unknown (0x%04x)"),code16);
3399 offset += 2;
3401 if ( code16 == 0 ) {
3402 /* Reason Sub Code with Delete */
3403 info_to_display(tvb,stt,offset,2,"Reason Sub Code",table_cops_reason_subcode_delete,FMT_DEC,&hf_cops_pc_delete_subcode);
3404 } else {
3405 /* Reason Sub Code with Close */
3406 info_to_display(tvb,stt,offset,2,"Reason Sub Code",table_cops_reason_subcode_close,FMT_DEC,&hf_cops_pc_close_subcode);
3410 /* Cops - Section : PacketCable error */
3411 static void
3412 cops_packetcable_error(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3414 proto_tree *stt;
3416 /* Create a subtree */
3417 stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Error");
3418 offset += 4;
3420 /* Error Code */
3421 info_to_display(tvb,stt,offset,2,"Error Code",table_cops_packetcable_error,FMT_DEC,&hf_cops_pc_packetcable_err_code);
3422 offset += 2;
3424 /* Error Sub Code */
3425 info_to_display(tvb,stt,offset,2,"Error Sub Code",NULL,FMT_HEX,&hf_cops_pc_packetcable_sub_code);
3429 /* Cops - Section : Multimedia Transaction ID */
3430 static void
3431 cops_mm_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, uint8_t op_code, unsigned n, uint32_t offset) {
3433 proto_tree *stt;
3434 uint16_t code16;
3435 char info[50];
3437 /* Create a subtree */
3438 stt = info_to_cops_subtree(tvb,st,n,offset,"MM Transaction ID");
3439 offset += 4;
3441 /* Transaction Identifier */
3442 info_to_display(tvb,stt,offset,2,"Multimedia Transaction Identifier", NULL,FMT_DEC,&hf_cops_pc_transaction_id);
3443 offset +=2;
3445 /* Gate Command Type */
3446 code16 = tvb_get_ntohs(tvb,offset);
3447 proto_tree_add_uint_format(stt, hf_cops_pc_gate_command_type,tvb, offset, 2,
3448 code16,"%-28s : %s (%u)", "Gate Command Type",
3449 val_to_str(code16,table_cops_mm_transaction_id, "Unknown (0x%04x)"),code16);
3451 /* Write the right data into the 'info field' on the Gui */
3452 snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
3453 val_to_str_const(code16,table_cops_mm_transaction_id, "Unknown"));
3455 col_add_str(pinfo->cinfo, COL_INFO,info);
3458 /* Cops - Section : AMID */
3459 static void
3460 cops_amid(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3462 proto_tree *stt;
3464 /* Create a subtree */
3465 stt = info_to_cops_subtree(tvb,st,n,offset,"AMID");
3466 offset += 4;
3468 /* Application Type */
3469 info_to_display(tvb,stt,offset,2,"Application Manager ID Application Type", NULL,FMT_DEC,&hf_cops_pcmm_amid_app_type);
3470 offset += 2;
3472 /* Application Manager Tag */
3473 info_to_display(tvb,stt,offset,2,"Application Manager ID Application Manager Tag", NULL,FMT_DEC,&hf_cops_pcmm_amid_am_tag);
3478 /* Cops - Section : Multimedia Gate Specifications */
3479 static int
3480 cops_mm_gate_spec(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3481 proto_item *ti;
3482 proto_tree *stt, *object_tree;
3484 /* Create a subtree */
3485 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Spec");
3486 offset += 4;
3488 /* Flags */
3489 ti = info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_HEX,&hf_cops_pcmm_gate_spec_flags);
3490 object_tree = proto_item_add_subtree(ti, ett_cops_subtree );
3491 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_flags_gate, tvb, offset, 1, ENC_BIG_ENDIAN);
3492 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_flags_dscp_overwrite, tvb, offset, 1, ENC_BIG_ENDIAN);
3493 offset += 1;
3495 /* DiffServ Code Point */
3496 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS)",NULL,FMT_HEX,&hf_cops_pcmm_gate_spec_dscp_tos_field);
3497 offset += 1;
3499 /* DiffServ Code Point Mask */
3500 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS) Mask",NULL,FMT_HEX,&hf_cops_pcmm_gate_spec_dscp_tos_mask);
3501 offset += 1;
3503 /* Session Class */
3504 ti = info_to_display(tvb,stt,offset,1,"Session Class",table_cops_session_class,FMT_DEC,&hf_cops_pcmm_gate_spec_session_class_id);
3505 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3506 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_session_class_id_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
3507 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_session_class_id_preemption, tvb, offset, 1, ENC_BIG_ENDIAN);
3508 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_session_class_id_configurable, tvb, offset, 1, ENC_BIG_ENDIAN);
3509 offset += 1;
3511 /* Timer T1 Value */
3512 info_to_display(tvb,stt,offset,2,"Timer T1 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t1);
3513 offset += 2;
3515 /* Timer T2 Value */
3516 info_to_display(tvb,stt,offset,2,"Timer T2 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t2);
3517 offset += 2;
3519 /* Timer T3 Value */
3520 info_to_display(tvb,stt,offset,2,"Timer T3 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t3);
3521 offset += 2;
3523 /* Timer T4 Value */
3524 info_to_display(tvb,stt,offset,2,"Timer T4 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t4);
3525 offset += 2;
3527 return offset;
3530 /* Cops - Section : Classifier */
3531 static int
3532 cops_classifier(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool extended) {
3534 proto_tree *stt;
3536 /* Create a subtree */
3537 stt = info_to_cops_subtree(tvb,st,n,offset,
3538 extended ? "Extended Classifier" : "Classifier");
3539 offset += 4;
3541 /* Protocol ID */
3542 info_to_display(tvb,stt,offset,2,"Protocol ID",NULL,FMT_DEC,&hf_cops_pcmm_classifier_protocol_id);
3543 offset += 2;
3545 /* DiffServ Code Point */
3546 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS)",NULL,FMT_HEX,&hf_cops_pcmm_classifier_dscp_tos_field);
3547 offset += 1;
3549 /* DiffServ Code Point Mask */
3550 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS) Mask",NULL,FMT_HEX,&hf_cops_pcmm_classifier_dscp_tos_mask);
3551 offset += 1;
3553 /* Source IP Address */
3554 info_to_display(tvb,stt,offset,4,"Source IP Address",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_src_addr);
3555 offset += 4;
3557 if (extended) {
3558 /* Source Mask */
3559 info_to_display(tvb,stt,offset,4,"Source Mask",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_src_mask);
3560 offset += 4;
3563 /* Destination IP Address */
3564 info_to_display(tvb,stt,offset,4,"Destination IP Address",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_dst_addr);
3565 offset += 4;
3567 if (extended) {
3568 /* Destination Mask */
3569 info_to_display(tvb,stt,offset,4,"Destination Mask",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_dst_mask);
3570 offset += 4;
3573 /* Source IP Port */
3574 info_to_display(tvb,stt,offset,2,"Source IP Port",NULL,FMT_DEC,&hf_cops_pcmm_classifier_src_port);
3575 offset += 2;
3577 if (extended) {
3578 /* Source Port End */
3579 info_to_display(tvb,stt,offset,2,"Source Port End",NULL,FMT_DEC,&hf_cops_pcmm_classifier_src_port_end);
3580 offset += 2;
3583 /* Destination IP Port */
3584 info_to_display(tvb,stt,offset,2,"Destination IP Port",NULL,FMT_DEC,&hf_cops_pcmm_classifier_dst_port);
3585 offset += 2;
3587 if (extended) {
3588 /* Destination Port End */
3589 info_to_display(tvb,stt,offset,2,"Destination Port End",NULL,FMT_DEC,&hf_cops_pcmm_classifier_dst_port_end);
3590 offset += 2;
3593 if (extended) {
3594 /* ClassifierID */
3595 info_to_display(tvb,stt,offset,2,"ClassifierID",NULL,FMT_HEX,&hf_cops_pcmm_classifier_classifier_id);
3596 offset += 2;
3599 /* Priority */
3600 info_to_display(tvb,stt,offset,1,"Priority",NULL,FMT_HEX,&hf_cops_pcmm_classifier_priority);
3601 offset += 1;
3603 if (extended) {
3604 /* Activation State */
3605 info_to_display(tvb,stt,offset,1,"Activation State",NULL,FMT_HEX,&hf_cops_pcmm_classifier_activation_state);
3606 offset += 1;
3608 /* Action */
3609 info_to_display(tvb,stt,offset,1,"Action",NULL,FMT_HEX,&hf_cops_pcmm_classifier_action);
3610 offset += 1;
3613 /* 3 octets Not specified */
3614 offset += 3;
3616 return offset;
3619 /* Cops - Section : IPv6 Classifier */
3620 static int
3621 cops_ipv6_classifier(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3623 proto_tree *stt;
3625 /* Create a subtree */
3626 stt = info_to_cops_subtree(tvb,st,n,offset, "IPv6 Classifier");
3627 offset += 4;
3629 /* Reserved/Flags */
3630 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_HEX,&hf_cops_pcmm_classifier_flags);
3631 offset += 1;
3633 /* tc-low */
3634 info_to_display(tvb,stt,offset,1,"tc-low",NULL,FMT_HEX,&hf_cops_pcmm_classifier_tc_low);
3635 offset += 1;
3637 /* tc-high */
3638 info_to_display(tvb,stt,offset,1,"tc-high",NULL,FMT_HEX,&hf_cops_pcmm_classifier_tc_high);
3639 offset += 1;
3641 /* tc-mask */
3642 info_to_display(tvb,stt,offset,1,"tc-mask",NULL,FMT_HEX,&hf_cops_pcmm_classifier_tc_mask);
3643 offset += 1;
3645 /* Flow Label */
3646 info_to_display(tvb,stt,offset,4,"Flow Label",NULL,FMT_HEX,&hf_cops_pcmm_classifier_flow_label);
3647 offset += 4;
3649 /* Next Header Type */
3650 info_to_display(tvb,stt,offset,2,"Next Header Type",NULL,FMT_DEC,&hf_cops_pcmm_classifier_next_header_type);
3651 offset += 2;
3653 /* Source Prefix Length */
3654 info_to_display(tvb,stt,offset,1,"Source Prefix Length",NULL,FMT_DEC,&hf_cops_pcmm_classifier_source_prefix_length);
3655 offset += 1;
3657 /* Destination Prefix Length */
3658 info_to_display(tvb,stt,offset,1,"Destination Prefix Length",NULL,FMT_DEC,&hf_cops_pcmm_classifier_destination_prefix_length);
3659 offset += 1;
3661 /* Source IP Address */
3662 info_to_display(tvb,stt,offset,16,"IPv6 Source Address",NULL,FMT_IPv6,&hf_cops_pcmm_classifier_src_addr_v6);
3663 offset += 16;
3665 /* Destination IP Address */
3666 info_to_display(tvb,stt,offset,16,"IPv6 Destination Address",NULL,FMT_IPv6,&hf_cops_pcmm_classifier_dst_addr_v6);
3667 offset += 16;
3669 /* Source IP Port */
3670 info_to_display(tvb,stt,offset,2,"Source Port Start",NULL,FMT_DEC,&hf_cops_pcmm_classifier_src_port);
3671 offset += 2;
3673 /* Source Port End */
3674 info_to_display(tvb,stt,offset,2,"Source Port End",NULL,FMT_DEC,&hf_cops_pcmm_classifier_src_port_end);
3675 offset += 2;
3677 /* Destination IP Port */
3678 info_to_display(tvb,stt,offset,2,"Destination Port Start",NULL,FMT_DEC,&hf_cops_pcmm_classifier_dst_port);
3679 offset += 2;
3681 /* Destination Port End */
3682 info_to_display(tvb,stt,offset,2,"Destination Port End",NULL,FMT_DEC,&hf_cops_pcmm_classifier_dst_port_end);
3683 offset += 2;
3685 /* ClassifierID */
3686 info_to_display(tvb,stt,offset,2,"ClassifierID",NULL,FMT_HEX,&hf_cops_pcmm_classifier_classifier_id);
3687 offset += 2;
3689 /* Priority */
3690 info_to_display(tvb,stt,offset,1,"Priority",NULL,FMT_HEX,&hf_cops_pcmm_classifier_priority);
3691 offset += 1;
3693 /* Activation State */
3694 info_to_display(tvb,stt,offset,1,"Activation State",NULL,FMT_HEX,&hf_cops_pcmm_classifier_activation_state);
3695 offset += 1;
3697 /* Action */
3698 info_to_display(tvb,stt,offset,1,"Action",NULL,FMT_HEX,&hf_cops_pcmm_classifier_action);
3699 offset += 1;
3701 /* 3 octets Not specified */
3702 offset += 3;
3704 return offset;
3707 /* Cops - Section : Gate Specifications */
3708 static int
3709 cops_flow_spec(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3710 proto_tree *stt, *object_tree;
3712 /* Create a subtree */
3713 stt = info_to_cops_subtree(tvb,st,n,offset,"Flow Spec");
3714 offset += 4;
3716 /* Envelope */
3717 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_flow_spec_envelope);
3718 offset += 1;
3720 /* Service Number */
3721 info_to_display(tvb,stt,offset,1,"Service Number",NULL,FMT_DEC,&hf_cops_pcmm_flow_spec_service_number);
3722 offset += 1;
3724 /* Reserved */
3725 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3726 offset += 2;
3728 /* Authorized Envelope */
3729 object_tree = proto_tree_add_subtree(stt, tvb, offset, 28, ett_cops_subtree, NULL, "Authorized Envelope");
3731 /* Token Bucket Rate */
3732 info_to_display(tvb,object_tree,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3733 offset += 4;
3735 /* Token Bucket Size */
3736 info_to_display(tvb,object_tree,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3737 offset += 4;
3739 /* Peak Data Rate */
3740 info_to_display(tvb,object_tree,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3741 offset += 4;
3743 /* Minimum Policed Unit */
3744 info_to_display(tvb,object_tree,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3745 offset += 4;
3747 /* Maximum Packet Size */
3748 info_to_display(tvb,object_tree,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3749 offset += 4;
3751 /* Rate */
3752 info_to_display(tvb,object_tree,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3753 offset += 4;
3755 /* Slack Term */
3756 info_to_display(tvb,object_tree,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3757 offset += 4;
3759 if (n < 64) return offset;
3761 /* Reserved Envelope */
3762 object_tree = proto_tree_add_subtree(stt, tvb, offset, 28, ett_cops_subtree, NULL, "Reserved Envelope");
3764 /* Token Bucket Rate */
3765 info_to_display(tvb,object_tree,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3766 offset += 4;
3768 /* Token Bucket Size */
3769 info_to_display(tvb,object_tree,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3770 offset += 4;
3772 /* Peak Data Rate */
3773 info_to_display(tvb,object_tree,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3774 offset += 4;
3776 /* Minimum Policed Unit */
3777 info_to_display(tvb,object_tree,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3778 offset += 4;
3780 /* Maximum Packet Size */
3781 info_to_display(tvb,object_tree,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3782 offset += 4;
3784 /* Rate */
3785 info_to_display(tvb,object_tree,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3786 offset += 4;
3788 /* Slack Term */
3789 info_to_display(tvb,object_tree,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3790 offset += 4;
3792 if (n < 92) return offset;
3794 /* Committed Envelope */
3795 object_tree = proto_tree_add_subtree(stt, tvb, offset, 28, ett_cops_subtree, NULL, "Committed Envelope");
3797 /* Token Bucket Rate */
3798 info_to_display(tvb,object_tree,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3799 offset += 4;
3801 /* Token Bucket Size */
3802 info_to_display(tvb,object_tree,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3803 offset += 4;
3805 /* Peak Data Rate */
3806 info_to_display(tvb,object_tree,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3807 offset += 4;
3809 /* Minimum Policed Unit */
3810 info_to_display(tvb,object_tree,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3811 offset += 4;
3813 /* Maximum Packet Size */
3814 info_to_display(tvb,object_tree,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3815 offset += 4;
3817 /* Rate */
3818 info_to_display(tvb,object_tree,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3819 offset += 4;
3821 /* Slack Term */
3822 info_to_display(tvb,object_tree,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3823 offset += 4;
3825 return offset;
3828 /* Cops - Section : DOCSIS Service Class Name */
3829 static int
3830 cops_docsis_service_class_name(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, unsigned object_len, uint32_t offset) {
3832 proto_tree *stt;
3834 /* Create a subtree */
3835 stt = info_to_cops_subtree(tvb,st,object_len,offset,"DOCSIS Service Class Name");
3836 offset += 4;
3838 /* Envelope */
3839 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3840 offset += 1;
3842 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3843 offset += 3;
3845 if (object_len >= 12) {
3846 proto_tree_add_item(stt, hf_cops_pcmm_docsis_scn, tvb, offset, object_len - 8, ENC_ASCII);
3847 offset += object_len - 8;
3848 } else {
3849 proto_tree_add_expert_format(stt, pinfo, &ei_cops_bad_cops_object_length,
3850 tvb, offset - 8, 2, "Invalid object length: %u", object_len);
3853 return offset;
3856 /* New functions were made with the i04 suffix to maintain backward compatibility with I03
3858 * BEGIN PCMM I04
3862 /* Cops - Section : Best Effort Service */
3863 static int
3864 cops_best_effort_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
3865 proto_tree *stt, *object_tree;
3867 /* Create a subtree */
3868 stt = info_to_cops_subtree(tvb,st,n,offset,"Best Effort Service");
3869 offset += 4;
3871 /* Envelope */
3872 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3873 offset += 1;
3875 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3876 offset += 3;
3878 /* Authorized Envelope */
3879 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 36 : 32, ett_cops_subtree, NULL, "Authorized Envelope");
3881 /* Traffic Priority */
3882 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3883 offset += 1;
3885 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3886 offset += 3;
3888 /* Request Transmission Policy */
3889 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
3890 offset += 4;
3892 /* Maximum Sustained Traffic Rate */
3893 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3894 offset += 4;
3896 /* Maximum Traffic Burst */
3897 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3898 offset += 4;
3900 /* Minimum Reserved Traffic Rate */
3901 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3902 offset += 4;
3904 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3905 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);
3906 offset += 2;
3908 /* Maximum Concatenated Burst */
3909 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
3910 offset += 2;
3912 /* Required Attribute Mask */
3913 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
3914 offset += 4;
3916 /* Forbidden Attribute Mask */
3917 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
3918 offset += 4;
3920 if (i05) {
3921 /* Attribute Aggregation Rule Mask */
3922 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
3923 offset += 4;
3926 if (n < 56) return offset;
3928 /* Reserved Envelope */
3929 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 36 : 32, ett_cops_subtree, NULL, "Reserved Envelope");
3931 /* Traffic Priority */
3932 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3933 offset += 1;
3935 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3936 offset += 3;
3938 /* Request Transmission Policy */
3939 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
3940 offset += 4;
3942 /* Maximum Sustained Traffic Rate */
3943 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3944 offset += 4;
3946 /* Maximum Traffic Burst */
3947 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3948 offset += 4;
3950 /* Minimum Reserved Traffic Rate */
3951 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3952 offset += 4;
3954 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3955 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);
3956 offset += 2;
3958 /* Maximum Concatenated Burst */
3959 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
3960 offset += 2;
3962 /* Required Attribute Mask */
3963 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
3964 offset += 4;
3966 /* Forbidden Attribute Mask */
3967 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
3968 offset += 4;
3970 if (i05) {
3971 /* Attribute Aggregation Rule Mask */
3972 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
3973 offset += 4;
3976 if (n < 80) return offset;
3978 /* Committed Envelope */
3979 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 36 : 32, ett_cops_subtree, NULL, "Committed Envelope");
3981 /* Traffic Priority */
3982 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3983 offset += 1;
3985 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3986 offset += 3;
3988 /* Request Transmission Policy */
3989 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
3990 offset += 4;
3992 /* Maximum Sustained Traffic Rate */
3993 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3994 offset += 4;
3996 /* Maximum Traffic Burst */
3997 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3998 offset += 4;
4000 /* Minimum Reserved Traffic Rate */
4001 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4002 offset += 4;
4004 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4005 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);
4006 offset += 2;
4008 /* Maximum Concatenated Burst */
4009 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4010 offset += 2;
4012 /* Required Attribute Mask */
4013 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4014 offset += 4;
4016 /* Forbidden Attribute Mask */
4017 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4018 offset += 4;
4020 if (i05) {
4021 /* Attribute Aggregation Rule Mask */
4022 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4023 offset += 4;
4026 return offset;
4029 /* Cops - Section : Non-Real-Time Polling Service */
4030 static int
4031 cops_non_real_time_polling_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
4032 proto_tree *stt, *object_tree;
4034 /* Create a subtree */
4035 stt = info_to_cops_subtree(tvb,st,n,offset,"Non-Real-Time Polling Service");
4036 offset += 4;
4038 /* Envelope */
4039 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4040 offset += 1;
4042 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4043 offset += 3;
4045 /* Authorized Envelope */
4046 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, "Authorized Envelope");
4048 /* Traffic Priority */
4049 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4050 offset += 1;
4052 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4053 offset += 3;
4055 /* Request Transmission Policy */
4056 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4057 offset += 4;
4059 /* Maximum Sustained Traffic Rate */
4060 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4061 offset += 4;
4063 /* Maximum Traffic Burst */
4064 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4065 offset += 4;
4067 /* Minimum Reserved Traffic Rate */
4068 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4069 offset += 4;
4071 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4072 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);
4073 offset += 2;
4075 /* Maximum Concatenated Burst */
4076 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4077 offset += 2;
4079 /* Nominal Polling Interval */
4080 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4081 offset += 4;
4083 /* Required Attribute Mask */
4084 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4085 offset += 4;
4087 /* Forbidden Attribute Mask */
4088 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4089 offset += 4;
4091 if (i05) {
4092 /* Attribute Aggregation Rule Mask */
4093 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4094 offset += 4;
4097 if (n < 64) return offset;
4099 /* Reserved Envelope */
4100 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, "Reserved Envelope");
4102 /* Traffic Priority */
4103 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4104 offset += 1;
4106 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4107 offset += 3;
4109 /* Request Transmission Policy */
4110 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4111 offset += 4;
4113 /* Maximum Sustained Traffic Rate */
4114 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4115 offset += 4;
4117 /* Maximum Traffic Burst */
4118 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4119 offset += 4;
4121 /* Minimum Reserved Traffic Rate */
4122 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4123 offset += 4;
4125 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4126 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);
4127 offset += 2;
4129 /* Maximum Concatenated Burst */
4130 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4131 offset += 2;
4133 /* Nominal Polling Interval */
4134 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4135 offset += 4;
4137 /* Required Attribute Mask */
4138 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4139 offset += 4;
4141 /* Forbidden Attribute Mask */
4142 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4143 offset += 4;
4145 if (i05) {
4146 /* Attribute Aggregation Rule Mask */
4147 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4148 offset += 4;
4151 if (n < 92) return offset;
4153 /* Committed Envelope */
4154 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, "Committed Envelope");
4156 /* Traffic Priority */
4157 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4158 offset += 1;
4160 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4161 offset += 3;
4163 /* Request Transmission Policy */
4164 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4165 offset += 4;
4167 /* Maximum Sustained Traffic Rate */
4168 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4169 offset += 4;
4171 /* Maximum Traffic Burst */
4172 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4173 offset += 4;
4175 /* Minimum Reserved Traffic Rate */
4176 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4177 offset += 4;
4179 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4180 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);
4181 offset += 2;
4183 /* Maximum Concatenated Burst */
4184 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4185 offset += 2;
4187 /* Nominal Polling Interval */
4188 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4189 offset += 4;
4191 /* Required Attribute Mask */
4192 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4193 offset += 4;
4195 /* Forbidden Attribute Mask */
4196 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4197 offset += 4;
4199 if (i05) {
4200 /* Attribute Aggregation Rule Mask */
4201 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4202 offset += 4;
4205 return offset;
4208 /* Cops - Section : Real-Time Polling Service */
4209 static int
4210 cops_real_time_polling_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
4211 proto_tree *stt, *object_tree;
4213 /* Create a subtree */
4214 stt = info_to_cops_subtree(tvb,st,n,offset,"Real-Time Polling Service");
4215 offset += 4;
4217 /* Envelope */
4218 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4219 offset += 1;
4221 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4222 offset += 3;
4224 /* Authorized Envelope */
4225 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, "Authorized Envelope");
4227 /* Request Transmission Policy */
4228 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4229 offset += 4;
4231 /* Maximum Sustained Traffic Rate */
4232 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4233 offset += 4;
4235 /* Maximum Traffic Burst */
4236 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4237 offset += 4;
4239 /* Minimum Reserved Traffic Rate */
4240 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4241 offset += 4;
4243 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4244 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);
4245 offset += 2;
4247 /* Maximum Concatenated Burst */
4248 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4249 offset += 2;
4251 /* Nominal Polling Interval */
4252 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4253 offset += 4;
4255 /* Tolerated Poll Jitter */
4256 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4257 offset += 4;
4259 /* Required Attribute Mask */
4260 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4261 offset += 4;
4263 /* Forbidden Attribute Mask */
4264 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4265 offset += 4;
4267 if (i05) {
4268 /* Attribute Aggregation Rule Mask */
4269 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4270 offset += 4;
4273 if (n < 64) return offset;
4275 /* Reserved Envelope */
4276 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, "Reserved Envelope");
4278 /* Request Transmission Policy */
4279 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4280 offset += 4;
4282 /* Maximum Sustained Traffic Rate */
4283 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4284 offset += 4;
4286 /* Maximum Traffic Burst */
4287 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4288 offset += 4;
4290 /* Minimum Reserved Traffic Rate */
4291 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4292 offset += 4;
4294 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4295 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);
4296 offset += 2;
4298 /* Maximum Concatenated Burst */
4299 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4300 offset += 2;
4302 /* Nominal Polling Interval */
4303 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4304 offset += 4;
4306 /* Tolerated Poll Jitter */
4307 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4308 offset += 4;
4310 /* Required Attribute Mask */
4311 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4312 offset += 4;
4314 /* Forbidden Attribute Mask */
4315 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4316 offset += 4;
4318 if (i05) {
4319 /* Attribute Aggregation Rule Mask */
4320 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4321 offset += 4;
4324 if (n < 92) return offset;
4326 /* Committed Envelope */
4327 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, "Committed Envelope");
4329 /* Request Transmission Policy */
4330 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4331 offset += 4;
4333 /* Maximum Sustained Traffic Rate */
4334 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4335 offset += 4;
4337 /* Maximum Traffic Burst */
4338 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4339 offset += 4;
4341 /* Minimum Reserved Traffic Rate */
4342 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4343 offset += 4;
4345 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4346 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);
4347 offset += 2;
4349 /* Maximum Concatenated Burst */
4350 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4351 offset += 2;
4353 /* Nominal Polling Interval */
4354 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4355 offset += 4;
4357 /* Tolerated Poll Jitter */
4358 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4359 offset += 4;
4361 /* Required Attribute Mask */
4362 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4363 offset += 4;
4365 /* Forbidden Attribute Mask */
4366 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4367 offset += 4;
4369 if (i05) {
4370 /* Attribute Aggregation Rule Mask */
4371 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4372 offset += 4;
4375 return offset;
4378 /* Cops - Section : Unsolicited Grant Service */
4379 static int
4380 cops_unsolicited_grant_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
4381 proto_tree *stt, *object_tree;
4383 /* Create a subtree */
4384 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service");
4385 offset += 4;
4387 /* Envelope */
4388 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4389 offset += 1;
4391 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4392 offset += 3;
4394 /* Authorized Envelope */
4395 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 28 : 24, ett_cops_subtree, NULL, "Authorized Envelope");
4397 /* Request Transmission Policy */
4398 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4399 offset += 4;
4401 /* Unsolicited Grant Size */
4402 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4403 offset += 2;
4405 /* Grants Per Interval */
4406 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4407 offset += 1;
4409 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
4410 offset += 1;
4412 /* Nominal Grant Interval */
4413 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4414 offset += 4;
4416 /* Tolerated Grant Jitter */
4417 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4418 offset += 4;
4420 /* Required Attribute Mask */
4421 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4422 offset += 4;
4424 /* Forbidden Attribute Mask */
4425 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4426 offset += 4;
4428 if (i05) {
4429 /* Attribute Aggregation Rule Mask */
4430 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4431 offset += 4;
4434 if (n < 40) return offset;
4436 /* Reserved Envelope */
4437 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 28 : 24, ett_cops_subtree, NULL, "Reserved Envelope");
4439 /* Request Transmission Policy */
4440 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4441 offset += 4;
4443 /* Unsolicited Grant Size */
4444 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4445 offset += 2;
4447 /* Grants Per Interval */
4448 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4449 offset += 1;
4451 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
4452 offset += 1;
4454 /* Nominal Grant Interval */
4455 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4456 offset += 4;
4458 /* Tolerated Grant Jitter */
4459 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4460 offset += 4;
4462 /* Required Attribute Mask */
4463 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4464 offset += 4;
4466 /* Forbidden Attribute Mask */
4467 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4468 offset += 4;
4470 if (i05) {
4471 /* Attribute Aggregation Rule Mask */
4472 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4473 offset += 4;
4476 if (n < 56) return offset;
4478 /* Committed Envelope */
4479 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 28 : 24, ett_cops_subtree, NULL, "Committed Envelope");
4481 /* Request Transmission Policy */
4482 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4483 offset += 4;
4485 /* Unsolicited Grant Size */
4486 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4487 offset += 2;
4489 /* Grants Per Interval */
4490 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4491 offset += 1;
4493 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
4494 offset += 1;
4496 /* Nominal Grant Interval */
4497 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4498 offset += 4;
4500 /* Tolerated Grant Jitter */
4501 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4502 offset += 4;
4504 /* Required Attribute Mask */
4505 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4506 offset += 4;
4508 /* Forbidden Attribute Mask */
4509 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4510 offset += 4;
4512 if (i05) {
4513 /* Attribute Aggregation Rule Mask */
4514 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4515 offset += 4;
4518 return offset;
4521 /* Cops - Section : Unsolicited Grant Service with Activity Detection */
4522 static int
4523 cops_ugs_with_activity_detection_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
4524 proto_tree *stt, *object_tree;
4526 /* Create a subtree */
4527 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service with Activity Detection");
4528 offset += 4;
4530 /* Envelope */
4531 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4532 offset += 1;
4534 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4535 offset += 3;
4537 /* Authorized Envelope */
4538 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 36 : 32, ett_cops_subtree, NULL, "Authorized Envelope");
4540 /* Request Transmission Policy */
4541 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4542 offset += 4;
4544 /* Unsolicited Grant Size */
4545 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4546 offset += 2;
4548 /* Grants Per Interval */
4549 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4550 offset += 1;
4552 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
4553 offset += 1;
4555 /* Nominal Grant Interval */
4556 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4557 offset += 4;
4559 /* Tolerated Grant Jitter */
4560 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4561 offset += 4;
4563 /* Nominal Polling Interval */
4564 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4565 offset += 4;
4567 /* Tolerated Poll Jitter */
4568 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4569 offset += 4;
4571 /* Required Attribute Mask */
4572 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4573 offset += 4;
4575 /* Forbidden Attribute Mask */
4576 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4577 offset += 4;
4579 if (i05) {
4580 /* Attribute Aggregation Rule Mask */
4581 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4582 offset += 4;
4585 if (n < 56) return offset;
4587 /* Reserved Envelope */
4588 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 36 : 32, ett_cops_subtree, NULL, "Reserved Envelope");
4590 /* Request Transmission Policy */
4591 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4592 offset += 4;
4594 /* Unsolicited Grant Size */
4595 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4596 offset += 2;
4598 /* Grants Per Interval */
4599 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4600 offset += 1;
4602 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
4603 offset += 1;
4605 /* Nominal Grant Interval */
4606 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4607 offset += 4;
4609 /* Tolerated Grant Jitter */
4610 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4611 offset += 4;
4613 /* Nominal Polling Interval */
4614 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4615 offset += 4;
4617 /* Tolerated Poll Jitter */
4618 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4619 offset += 4;
4621 /* Required Attribute Mask */
4622 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4623 offset += 4;
4625 /* Forbidden Attribute Mask */
4626 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4627 offset += 4;
4629 if (i05) {
4630 /* Attribute Aggregation Rule Mask */
4631 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4632 offset += 4;
4635 if (n < 80) return offset;
4637 /* Committed Envelope */
4638 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 36 : 32, ett_cops_subtree, NULL, "Committed Envelope");
4640 /* Request Transmission Policy */
4641 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4642 offset += 4;
4644 /* Unsolicited Grant Size */
4645 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4646 offset += 2;
4648 /* Grants Per Interval */
4649 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4650 offset += 1;
4652 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
4653 offset += 1;
4655 /* Nominal Grant Interval */
4656 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4657 offset += 4;
4659 /* Tolerated Grant Jitter */
4660 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4661 offset += 4;
4663 /* Nominal Polling Interval */
4664 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4665 offset += 4;
4667 /* Tolerated Poll Jitter */
4668 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4669 offset += 4;
4671 /* Required Attribute Mask */
4672 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4673 offset += 4;
4675 /* Forbidden Attribute Mask */
4676 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4677 offset += 4;
4679 if (i05) {
4680 /* Attribute Aggregation Rule Mask */
4681 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4682 offset += 4;
4685 return offset;
4688 /* Cops - Section : Downstream Service */
4689 static int
4690 cops_downstream_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
4691 proto_tree *stt, *object_tree;
4693 /* Create a subtree */
4694 stt = info_to_cops_subtree(tvb,st,n,offset,"Downstream Service");
4695 offset += 4;
4697 /* Envelope */
4698 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4699 offset += 1;
4701 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4702 offset += 3;
4704 /* Authorized Envelope */
4705 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, "Authorized Envelope");
4707 /* Traffic Priority */
4708 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4709 offset += 1;
4711 /* Downstream Resequencing */
4712 info_to_display(tvb,object_tree,offset,1,"Downstream Resequencing",NULL,FMT_HEX,&hf_cops_pcmm_down_resequencing);
4713 offset += 1;
4715 proto_tree_add_item(object_tree, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
4716 offset += 2;
4718 /* Maximum Sustained Traffic Rate */
4719 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4720 offset += 4;
4722 /* Maximum Traffic Burst */
4723 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4724 offset += 4;
4726 /* Minimum Reserved Traffic Rate */
4727 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4728 offset += 4;
4730 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4731 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);
4732 offset += 2;
4734 /* Reserved */
4735 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4736 offset += 2;
4738 /* Maximum Downstream Latency */
4739 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
4740 offset += 4;
4742 /* Downstream Peak Traffic Rate */
4743 info_to_display(tvb,object_tree,offset,4,"Downstream Peak Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_down_peak_traffic_rate);
4744 offset += 4;
4746 /* Required Attribute Mask */
4747 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4748 offset += 4;
4750 /* Forbidden Attribute Mask */
4751 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4752 offset += 4;
4754 if (i05) {
4755 /* Attribute Aggregation Rule Mask */
4756 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4757 offset += 4;
4760 if (n < 56) return offset;
4762 /* Reserved Envelope */
4763 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, "Reserved Envelope");
4765 /* Traffic Priority */
4766 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4767 offset += 1;
4769 /* Downstream Resequencing */
4770 info_to_display(tvb,object_tree,offset,1,"Downstream Resequencing",NULL,FMT_HEX,&hf_cops_pcmm_down_resequencing);
4771 offset += 1;
4773 proto_tree_add_item(object_tree, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
4774 offset += 2;
4776 /* Maximum Sustained Traffic Rate */
4777 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4778 offset += 4;
4780 /* Maximum Traffic Burst */
4781 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4782 offset += 4;
4784 /* Minimum Reserved Traffic Rate */
4785 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4786 offset += 4;
4788 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4789 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);
4790 offset += 2;
4792 /* Reserved */
4793 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4794 offset += 2;
4796 /* Maximum Downstream Latency */
4797 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
4798 offset += 4;
4800 /* Downstream Peak Traffic Rate */
4801 info_to_display(tvb,object_tree,offset,4,"Downstream Peak Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_down_peak_traffic_rate);
4802 offset += 4;
4804 /* Required Attribute Mask */
4805 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4806 offset += 4;
4808 /* Forbidden Attribute Mask */
4809 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4810 offset += 4;
4812 if (i05) {
4813 /* Attribute Aggregation Rule Mask */
4814 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4815 offset += 4;
4818 if (n < 80) return offset;
4820 /* Committed Envelope */
4821 object_tree = proto_tree_add_subtree(stt, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, "Committed Envelope");
4823 /* Traffic Priority */
4824 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4825 offset += 1;
4827 /* Downstream Resequencing */
4828 info_to_display(tvb,object_tree,offset,1,"Downstream Resequencing",NULL,FMT_HEX,&hf_cops_pcmm_down_resequencing);
4829 offset += 1;
4831 proto_tree_add_item(object_tree, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
4832 offset += 2;
4834 /* Maximum Sustained Traffic Rate */
4835 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4836 offset += 4;
4838 /* Maximum Traffic Burst */
4839 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4840 offset += 4;
4842 /* Minimum Reserved Traffic Rate */
4843 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4844 offset += 4;
4846 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4847 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);
4848 offset += 2;
4850 /* Reserved */
4851 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4852 offset += 2;
4854 /* Maximum Downstream Latency */
4855 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
4856 offset += 4;
4858 /* Downstream Peak Traffic Rate */
4859 info_to_display(tvb,object_tree,offset,4,"Downstream Peak Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_down_peak_traffic_rate);
4860 offset += 4;
4862 /* Required Attribute Mask */
4863 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4864 offset += 4;
4866 /* Forbidden Attribute Mask */
4867 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4868 offset += 4;
4870 if (i05) {
4871 /* Attribute Aggregation Rule Mask */
4872 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4873 offset += 4;
4876 return offset;
4879 /* Cops - Section : Upstream Drop */
4880 static int
4881 cops_upstream_drop_i04(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
4882 proto_tree *stt;
4884 /* Create a subtree */
4885 stt = info_to_cops_subtree(tvb,st,n,offset,"Upstream Drop");
4886 offset += 4;
4888 /* Envelope */
4889 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4890 offset += 1;
4892 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4893 offset += 3;
4895 return offset;
4898 /* END PCMM I04 */
4900 /* Cops - Section : Best Effort Service */
4901 static int
4902 cops_best_effort_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
4903 proto_tree *stt, *object_tree;
4905 /* Create a subtree */
4906 stt = info_to_cops_subtree(tvb,st,n,offset,"Best Effort Service");
4907 offset += 4;
4909 /* Envelope */
4910 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4911 offset += 1;
4913 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4914 offset += 3;
4916 /* Authorized Envelope */
4917 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Authorized Envelope");
4919 /* Traffic Priority */
4920 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4921 offset += 1;
4923 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4924 offset += 3;
4926 /* Request Transmission Policy */
4927 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4928 offset += 4;
4930 /* Maximum Sustained Traffic Rate */
4931 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4932 offset += 4;
4934 /* Maximum Traffic Burst */
4935 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4936 offset += 4;
4938 /* Minimum Reserved Traffic Rate */
4939 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4940 offset += 4;
4942 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4943 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);
4944 offset += 2;
4946 /* Reserved */
4947 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4948 offset += 2;
4950 if (n < 56) return offset;
4952 /* Reserved Envelope */
4953 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Reserved Envelope");
4955 /* Traffic Priority */
4956 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4957 offset += 1;
4959 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4960 offset += 3;
4962 /* Request Transmission Policy */
4963 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
4964 offset += 4;
4966 /* Maximum Sustained Traffic Rate */
4967 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4968 offset += 4;
4970 /* Maximum Traffic Burst */
4971 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4972 offset += 4;
4974 /* Minimum Reserved Traffic Rate */
4975 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4976 offset += 4;
4978 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4979 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);
4980 offset += 2;
4982 /* Reserved */
4983 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4984 offset += 2;
4986 if (n < 80) return offset;
4988 /* Committed Envelope */
4989 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Committed Envelope");
4991 /* Traffic Priority */
4992 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4993 offset += 1;
4995 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4996 offset += 3;
4998 /* Request Transmission Policy */
4999 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5000 offset += 4;
5002 /* Maximum Sustained Traffic Rate */
5003 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5004 offset += 4;
5006 /* Maximum Traffic Burst */
5007 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5008 offset += 4;
5010 /* Minimum Reserved Traffic Rate */
5011 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5012 offset += 4;
5014 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5015 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);
5016 offset += 2;
5018 /* Reserved */
5019 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5020 offset += 2;
5022 return offset;
5025 /* Cops - Section : Non-Real-Time Polling Service */
5026 static int
5027 cops_non_real_time_polling_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5028 proto_tree *stt, *object_tree;
5030 /* Create a subtree */
5031 stt = info_to_cops_subtree(tvb,st,n,offset,"Non-Real-Time Polling Service");
5032 offset += 4;
5034 /* Envelope */
5035 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5036 offset += 1;
5038 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5039 offset += 3;
5041 /* Authorized Envelope */
5042 object_tree = proto_tree_add_subtree(stt, tvb, offset, 28, ett_cops_subtree, NULL, "Authorized Envelope");
5044 /* Traffic Priority */
5045 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5046 offset += 1;
5048 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5049 offset += 3;
5051 /* Request Transmission Policy */
5052 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5053 offset += 4;
5055 /* Maximum Sustained Traffic Rate */
5056 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5057 offset += 4;
5059 /* Maximum Traffic Burst */
5060 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5061 offset += 4;
5063 /* Minimum Reserved Traffic Rate */
5064 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5065 offset += 4;
5067 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5068 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);
5069 offset += 2;
5071 /* Reserved */
5072 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5073 offset += 2;
5075 /* Nominal Polling Interval */
5076 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5077 offset += 4;
5079 if (n < 64) return offset;
5081 /* Reserved Envelope */
5082 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Reserved Envelope");
5084 /* Traffic Priority */
5085 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5086 offset += 1;
5088 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5089 offset += 3;
5091 /* Request Transmission Policy */
5092 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5093 offset += 4;
5095 /* Maximum Sustained Traffic Rate */
5096 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5097 offset += 4;
5099 /* Maximum Traffic Burst */
5100 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5101 offset += 4;
5103 /* Minimum Reserved Traffic Rate */
5104 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5105 offset += 4;
5107 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5108 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);
5109 offset += 2;
5111 /* Reserved */
5112 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5113 offset += 2;
5115 /* Nominal Polling Interval */
5116 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5117 offset += 4;
5119 if (n < 92) return offset;
5121 /* Committed Envelope */
5122 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Committed Envelope");
5124 /* Traffic Priority */
5125 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5126 offset += 1;
5128 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5129 offset += 3;
5131 /* Request Transmission Policy */
5132 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5133 offset += 4;
5135 /* Maximum Sustained Traffic Rate */
5136 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5137 offset += 4;
5139 /* Maximum Traffic Burst */
5140 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5141 offset += 4;
5143 /* Minimum Reserved Traffic Rate */
5144 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5145 offset += 4;
5147 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5148 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);
5149 offset += 2;
5151 /* Reserved */
5152 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5153 offset += 2;
5155 /* Nominal Polling Interval */
5156 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5157 offset += 4;
5159 return offset;
5162 /* Cops - Section : Real-Time Polling Service */
5163 static int
5164 cops_real_time_polling_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5165 proto_tree *stt, *object_tree;
5167 /* Create a subtree */
5168 stt = info_to_cops_subtree(tvb,st,n,offset,"Real-Time Polling Service");
5169 offset += 4;
5171 /* Envelope */
5172 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5173 offset += 1;
5175 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5176 offset += 3;
5178 /* Authorized Envelope */
5179 object_tree = proto_tree_add_subtree(stt, tvb, offset, 28, ett_cops_subtree, NULL, "Authorized Envelope");
5181 /* Request Transmission Policy */
5182 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5183 offset += 4;
5185 /* Maximum Sustained Traffic Rate */
5186 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5187 offset += 4;
5189 /* Maximum Traffic Burst */
5190 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5191 offset += 4;
5193 /* Minimum Reserved Traffic Rate */
5194 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5195 offset += 4;
5197 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5198 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);
5199 offset += 2;
5201 /* Reserved */
5202 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5203 offset += 2;
5205 /* Nominal Polling Interval */
5206 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5207 offset += 4;
5209 /* Tolerated Poll Jitter */
5210 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5211 offset += 4;
5213 if (n < 64) return offset;
5215 /* Reserved Envelope */
5216 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Reserved Envelope");
5218 /* Request Transmission Policy */
5219 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5220 offset += 4;
5222 /* Maximum Sustained Traffic Rate */
5223 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5224 offset += 4;
5226 /* Maximum Traffic Burst */
5227 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5228 offset += 4;
5230 /* Minimum Reserved Traffic Rate */
5231 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5232 offset += 4;
5234 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5235 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);
5236 offset += 2;
5238 /* Reserved */
5239 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5240 offset += 2;
5242 /* Nominal Polling Interval */
5243 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5244 offset += 4;
5246 /* Tolerated Poll Jitter */
5247 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5248 offset += 4;
5250 if (n < 92) return offset;
5252 /* Committed Envelope */
5253 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Committed Envelope");
5255 /* Request Transmission Policy */
5256 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5257 offset += 4;
5259 /* Maximum Sustained Traffic Rate */
5260 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5261 offset += 4;
5263 /* Maximum Traffic Burst */
5264 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5265 offset += 4;
5267 /* Minimum Reserved Traffic Rate */
5268 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5269 offset += 4;
5271 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5272 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);
5273 offset += 2;
5275 /* Reserved */
5276 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5277 offset += 2;
5279 /* Nominal Polling Interval */
5280 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5281 offset += 4;
5283 /* Tolerated Poll Jitter */
5284 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5285 offset += 4;
5287 return offset;
5290 /* Cops - Section : Unsolicited Grant Service */
5291 static int
5292 cops_unsolicited_grant_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5293 proto_tree *stt, *object_tree;
5295 /* Create a subtree */
5296 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service");
5297 offset += 4;
5299 /* Envelope */
5300 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5301 offset += 1;
5303 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5304 offset += 3;
5306 /* Authorized Envelope */
5307 object_tree = proto_tree_add_subtree(stt, tvb, offset, 16, ett_cops_subtree, NULL, "Authorized Envelope");
5309 /* Request Transmission Policy */
5310 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5311 offset += 4;
5313 /* Unsolicited Grant Size */
5314 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5315 offset += 2;
5317 /* Grants Per Interval */
5318 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5319 offset += 1;
5321 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
5322 offset += 1;
5324 /* Nominal Grant Interval */
5325 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5326 offset += 4;
5328 /* Tolerated Grant Jitter */
5329 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5330 offset += 4;
5332 if (n < 40) return offset;
5334 /* Reserved Envelope */
5335 object_tree = proto_tree_add_subtree(stt, tvb, offset, 16, ett_cops_subtree, NULL, "Reserved Envelope");
5337 /* Request Transmission Policy */
5338 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5339 offset += 4;
5341 /* Unsolicited Grant Size */
5342 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5343 offset += 2;
5345 /* Grants Per Interval */
5346 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5347 offset += 1;
5349 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
5350 offset += 1;
5352 /* Nominal Grant Interval */
5353 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5354 offset += 4;
5356 /* Tolerated Grant Jitter */
5357 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5358 offset += 4;
5360 if (n < 56) return offset;
5362 /* Committed Envelope */
5363 object_tree = proto_tree_add_subtree(stt, tvb, offset, 16, ett_cops_subtree, NULL, "Committed Envelope");
5365 /* Request Transmission Policy */
5366 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5367 offset += 4;
5369 /* Unsolicited Grant Size */
5370 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5371 offset += 2;
5373 /* Grants Per Interval */
5374 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5375 offset += 1;
5377 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
5378 offset += 1;
5380 /* Nominal Grant Interval */
5381 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5382 offset += 4;
5384 /* Tolerated Grant Jitter */
5385 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5386 offset += 4;
5388 return offset;
5391 /* Cops - Section : Unsolicited Grant Service with Activity Detection */
5392 static int
5393 cops_ugs_with_activity_detection(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5394 proto_tree *stt, *object_tree;
5396 /* Create a subtree */
5397 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service with Activity Detection");
5398 offset += 4;
5400 /* Envelope */
5401 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5402 offset += 1;
5404 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5405 offset += 3;
5407 /* Authorized Envelope */
5408 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Authorized Envelope");
5410 /* Request Transmission Policy */
5411 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5412 offset += 4;
5414 /* Unsolicited Grant Size */
5415 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5416 offset += 2;
5418 /* Grants Per Interval */
5419 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5420 offset += 1;
5422 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
5423 offset += 1;
5425 /* Nominal Grant Interval */
5426 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5427 offset += 4;
5429 /* Tolerated Grant Jitter */
5430 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5431 offset += 4;
5433 /* Nominal Polling Interval */
5434 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5435 offset += 4;
5437 /* Tolerated Poll Jitter */
5438 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5439 offset += 4;
5441 if (n < 56) return offset;
5443 /* Reserved Envelope */
5444 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Reserved Envelope");
5446 /* Request Transmission Policy */
5447 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5448 offset += 4;
5450 /* Unsolicited Grant Size */
5451 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5452 offset += 2;
5454 /* Grants Per Interval */
5455 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5456 offset += 1;
5458 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
5459 offset += 1;
5461 /* Nominal Grant Interval */
5462 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5463 offset += 4;
5465 /* Tolerated Grant Jitter */
5466 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5467 offset += 4;
5469 /* Nominal Polling Interval */
5470 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5471 offset += 4;
5473 /* Tolerated Poll Jitter */
5474 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5475 offset += 4;
5477 if (n < 80) return offset;
5479 /* Committed Envelope */
5480 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Committed Envelope");
5482 /* Request Transmission Policy */
5483 decode_docsis_request_transmission_policy(tvb, offset, object_tree);
5484 offset += 4;
5486 /* Unsolicited Grant Size */
5487 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5488 offset += 2;
5490 /* Grants Per Interval */
5491 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5492 offset += 1;
5494 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
5495 offset += 1;
5497 /* Nominal Grant Interval */
5498 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5499 offset += 4;
5501 /* Tolerated Grant Jitter */
5502 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5503 offset += 4;
5505 /* Nominal Polling Interval */
5506 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5507 offset += 4;
5509 /* Tolerated Poll Jitter */
5510 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5511 offset += 4;
5513 return offset;
5516 /* Cops - Section : Downstream Service */
5517 static int
5518 cops_downstream_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5519 proto_tree *stt, *object_tree;
5521 /* Create a subtree */
5522 stt = info_to_cops_subtree(tvb,st,n,offset,"Downstream Service");
5523 offset += 4;
5525 /* Envelope */
5526 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5527 offset += 1;
5529 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5530 offset += 3;
5532 /* Authorized Envelope */
5533 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Authorized Envelope");
5535 /* Traffic Priority */
5536 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5537 offset += 1;
5539 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5540 offset += 3;
5542 /* Maximum Sustained Traffic Rate */
5543 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5544 offset += 4;
5546 /* Maximum Traffic Burst */
5547 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5548 offset += 4;
5550 /* Minimum Reserved Traffic Rate */
5551 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5552 offset += 4;
5554 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5555 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);
5556 offset += 2;
5558 /* Reserved */
5559 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5560 offset += 2;
5562 /* Maximum Downstream Latency */
5563 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
5564 offset += 4;
5566 if (n < 56) return offset;
5568 /* Reserved Envelope */
5569 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Reserved Envelope");
5571 /* Traffic Priority */
5572 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5573 offset += 1;
5575 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5576 offset += 3;
5578 /* Maximum Sustained Traffic Rate */
5579 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5580 offset += 4;
5582 /* Maximum Traffic Burst */
5583 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5584 offset += 4;
5586 /* Minimum Reserved Traffic Rate */
5587 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5588 offset += 4;
5590 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5591 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);
5592 offset += 2;
5594 /* Reserved */
5595 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5596 offset += 2;
5598 /* Maximum Downstream Latency */
5599 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
5600 offset += 4;
5602 if (n < 80) return offset;
5604 /* Committed Envelope */
5605 object_tree = proto_tree_add_subtree(stt, tvb, offset, 24, ett_cops_subtree, NULL, "Committed Envelope");
5607 /* Traffic Priority */
5608 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5609 offset += 1;
5611 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5612 offset += 3;
5614 /* Maximum Sustained Traffic Rate */
5615 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5616 offset += 4;
5618 /* Maximum Traffic Burst */
5619 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5620 offset += 4;
5622 /* Minimum Reserved Traffic Rate */
5623 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5624 offset += 4;
5626 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5627 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);
5628 offset += 2;
5630 /* Reserved */
5631 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5632 offset += 2;
5634 /* Maximum Downstream Latency */
5635 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
5636 offset += 4;
5638 return offset;
5641 /* Cops - Section : PacketCable Multimedia Event Gereration-Info */
5642 static void
5643 cops_mm_event_generation_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5645 proto_tree *stt;
5647 /* Create a subtree */
5648 stt = info_to_cops_subtree(tvb,st,n,offset,"Event Generation Info");
5649 offset += 4;
5651 /* Primary Record Keeping Server IP Address */
5652 info_to_display(tvb,stt,offset,4,"PRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_prks_ip);
5653 offset += 4;
5655 /* Primary Record Keeping Server IP Port */
5656 info_to_display(tvb,stt,offset,2,"PRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_prks_ip_port);
5657 offset += 2;
5659 /* Reserved */
5660 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5661 offset += 2;
5663 /* Secondary Record Keeping Server IP Address */
5664 info_to_display(tvb,stt,offset,4,"SRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_srks_ip);
5665 offset += 4;
5667 /* Secondary Record Keeping Server IP Port */
5668 info_to_display(tvb,stt,offset,2,"SRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_srks_ip_port);
5669 offset += 2;
5671 /* Reserved */
5672 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5673 offset += 2;
5675 /* BCID Timestamp */
5676 info_to_display(tvb,stt,offset,4,"BCID - Timestamp",NULL,FMT_HEX,&hf_cops_pc_bcid_ts);
5677 offset += 4;
5679 /* BCID Element ID */
5680 proto_tree_add_item(stt, hf_cops_pc_bcid_id, tvb, offset, 8, ENC_ASCII);
5681 offset += 8;
5683 /* BCID Time Zone */
5684 proto_tree_add_item(stt, hf_cops_pc_bcid_tz, tvb, offset, 8, ENC_ASCII);
5685 offset += 8;
5687 /* BCID Event Counter */
5688 info_to_display(tvb,stt,offset,4,"BCID - Event Counter",NULL,FMT_DEC,&hf_cops_pc_bcid_ev);
5691 /* Cops - Section : Volume-Based Usage Limit */
5692 static int
5693 cops_volume_based_usage_limit(tvbuff_t *tvb, proto_tree *st, unsigned object_len, uint32_t offset) {
5695 proto_tree *stt;
5697 /* Create a subtree */
5698 stt = info_to_cops_subtree(tvb,st,object_len,offset,"Volume-Based Usage Limit");
5699 offset += 4;
5701 /* Usage Limit */
5702 proto_tree_add_item(stt, hf_cops_pcmm_volume_based_usage_limit, tvb, offset, 8,
5703 ENC_BIG_ENDIAN);
5704 offset += 8;
5706 return offset;
5709 /* Cops - Section : Time-Based Usage Limit */
5710 static int
5711 cops_time_based_usage_limit(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5713 proto_tree *stt;
5715 /* Create a subtree */
5716 stt = info_to_cops_subtree(tvb,st,n,offset,"Time-Based Usage Limit");
5717 offset += 4;
5719 /* Time Limit */
5720 info_to_display(tvb,stt,offset,4,"Time Limit", NULL,FMT_DEC,&hf_cops_pcmm_time_based_usage_limit);
5721 offset += 4;
5723 return offset;
5726 /* Cops - Section : Opaque Data */
5727 static void
5728 cops_opaque_data(tvbuff_t *tvb, proto_tree *st, unsigned object_len, uint32_t offset) {
5730 proto_tree *stt;
5732 /* Create a subtree */
5733 stt = info_to_cops_subtree(tvb,st,object_len,offset,"Opaque Data");
5734 offset += 4;
5736 /* Opaque Data */
5737 proto_tree_add_item(stt, hf_cops_opaque_data, tvb, offset, 8, ENC_NA);
5740 /* Cops - Section : Gate Time Info */
5741 static int
5742 cops_gate_time_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5744 proto_tree *stt;
5746 /* Create a subtree */
5747 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Time Info");
5748 offset += 4;
5750 /* Gate Time Info */
5751 info_to_display(tvb,stt,offset,4,"Time Committed", NULL,FMT_DEC,&hf_cops_pcmm_gate_time_info);
5752 offset += 4;
5754 return offset;
5757 /* Cops - Section : Gate Usage Info */
5758 static void
5759 cops_gate_usage_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5761 proto_tree *stt;
5763 /* Create a subtree */
5764 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Usage Info");
5765 offset += 4;
5767 /* Gate Usage Info */
5768 info_to_display(tvb,stt,offset,8,"Octet Count", NULL,FMT_DEC,&hf_cops_pcmm_gate_usage_info);
5771 /* Cops - Section : PacketCable error */
5772 static int
5773 cops_packetcable_mm_error(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5775 proto_tree *stt;
5776 uint16_t code, subcode;
5778 /* Create a subtree */
5779 stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Error");
5780 offset += 4;
5782 code = tvb_get_ntohs(tvb, offset);
5783 proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_code, tvb, offset, 2, code,
5784 "Error Code: %s (%u)", val_to_str_const(code, pcmm_packetcable_error_code, "Unknown"),
5785 code);
5786 offset += 2;
5788 subcode = tvb_get_ntohs(tvb, offset);
5789 if (code == 6 || code == 7)
5790 proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_subcode,
5791 tvb, offset, 2, code, "Error-Subcode: 0x%02x, S-Num: 0x%02x, S-Type: 0x%02x",
5792 subcode, subcode >> 8, subcode & 0xf);
5793 else
5794 proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_subcode,
5795 tvb, offset, 2, code, "Error-Subcode: 0x%04x", subcode);
5796 offset += 2;
5798 return offset;
5801 /* Cops - Section : Gate State */
5802 static int
5803 cops_gate_state(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5805 proto_tree *stt;
5807 /* Create a subtree */
5808 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate State");
5809 offset += 4;
5811 /* State */
5812 info_to_display(tvb,stt,offset,2,"State",pcmm_gate_state,FMT_DEC,&hf_cops_pcmm_packetcable_gate_state);
5813 offset += 2;
5815 /* Reason */
5816 info_to_display(tvb,stt,offset,2,"Reason",pcmm_gate_state_reason,FMT_DEC,&hf_cops_pcmm_packetcable_gate_state_reason);
5817 offset += 2;
5819 return offset;
5822 /* Cops - Section : Version Info */
5823 static int
5824 cops_version_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5826 proto_tree *stt;
5828 /* Create a subtree */
5829 stt = info_to_cops_subtree(tvb,st,n,offset,"Version Info");
5830 offset += 4;
5832 /* State */
5833 info_to_display(tvb,stt,offset,2,"Major Version Number",NULL,FMT_DEC,&hf_cops_pcmm_packetcable_version_info_major);
5834 offset += 2;
5836 /* Reason */
5837 info_to_display(tvb,stt,offset,2,"Minor Version Number",NULL,FMT_DEC,&hf_cops_pcmm_packetcable_version_info_minor);
5838 offset += 2;
5840 return offset;
5843 /* Cops - Section : PSID */
5844 static void
5845 cops_psid(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5847 proto_tree *stt;
5849 /* Create a subtree */
5850 stt = info_to_cops_subtree(tvb,st,n,offset,"PSID");
5851 offset += 4;
5853 /* PSID */
5854 info_to_display(tvb,stt,offset,4,"PSID", NULL,FMT_DEC,&hf_cops_pcmm_psid);
5857 /* Cops - Section : Synch Options */
5858 static int
5859 cops_synch_options(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5861 proto_tree *stt;
5863 /* Create a subtree */
5864 stt = info_to_cops_subtree(tvb,st,n,offset,"Synch Options");
5865 offset += 4;
5867 proto_tree_add_item(stt, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
5868 offset += 2;
5870 /* Report Type */
5871 info_to_display(tvb,stt,offset,1,"Report Type", pcmm_report_type_vals,FMT_DEC,&hf_cops_pcmm_synch_options_report_type);
5872 offset += 1;
5874 /* Sych Type */
5875 info_to_display(tvb,stt,offset,1,"Synch Type", pcmm_synch_type_vals,FMT_DEC,&hf_cops_pcmm_synch_options_synch_type);
5876 offset += 1;
5878 return offset;
5881 /* Cops - Section : Msg Receipt Key */
5882 static void
5883 cops_msg_receipt_key(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5885 proto_tree *stt;
5887 /* Create a subtree */
5888 stt = info_to_cops_subtree(tvb,st,n,offset,"Msg Receipt Key");
5889 offset += 4;
5891 /* Msg Receipt Key */
5892 info_to_display(tvb,stt,offset,4,"Msg Receipt Key", NULL,FMT_HEX,&hf_cops_pcmm_msg_receipt_key);
5895 /* Cops - Section : UserID */
5896 static void
5897 cops_userid(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5899 proto_tree *stt;
5901 /* Create a subtree */
5902 stt = info_to_cops_subtree(tvb, st, n, offset, "UserID");
5903 offset += 4;
5905 /* UserID */
5906 info_to_display(tvb, stt, offset, n-4, "UserID", NULL, FMT_STR, &hf_cops_pcmm_userid);
5909 /* Cops - Section : SharedResourceID */
5910 static void
5911 cops_sharedresourceid(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
5913 proto_tree *stt;
5915 /* Create a subtree */
5916 stt = info_to_cops_subtree(tvb,st,n,offset,"SharedResourceID");
5917 offset += 4;
5919 /* SharedResourceID */
5920 info_to_display(tvb,stt,offset,4,"SharedResourceID", NULL,FMT_HEX,&hf_cops_pcmm_sharedresourceid);
5923 /* PacketCable D-QoS S-Num/S-Type globs */
5924 #define PCDQ_TRANSACTION_ID 0x0101
5925 #define PCDQ_SUBSCRIBER_IDv4 0x0201
5926 #define PCDQ_SUBSCRIBER_IDv6 0x0202
5927 #define PCDQ_GATE_ID 0x0301
5928 #define PCDQ_ACTIVITY_COUNT 0x0401
5929 #define PCDQ_GATE_SPEC 0x0501
5930 #define PCDQ_REMOTE_GATE_INFO 0x0601
5931 #define PCDQ_EVENT_GENERATION_INFO 0x0701
5932 #define PCDQ_MEDIA_CONNECTION_EVENT_INFO 0x0801
5933 #define PCDQ_PACKETCABLE_ERROR 0x0901
5934 #define PCDQ_PACKETCABLE_REASON 0x0d01
5935 #define PCDQ_ELECTRONIC_SURVEILLANCE 0x0a01
5936 #define PCDQ_SESSION_DESCRIPTION 0x0b01
5938 /* Analyze the PacketCable objects */
5939 static void
5940 cops_analyze_packetcable_dqos_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint8_t op_code, uint32_t offset) {
5942 int remdata;
5943 uint16_t object_len;
5944 uint8_t s_num, s_type;
5945 uint16_t num_type_glob;
5947 /* Only if this option is enabled by the Gui */
5948 if ( cops_packetcable == false ) {
5949 return;
5952 /* Do the remaining client specific objects */
5953 remdata = tvb_reported_length_remaining(tvb, offset);
5954 while (remdata > 4) {
5956 /* In case we have remaining data, then lets try to get this analyzed */
5957 object_len = tvb_get_ntohs(tvb, offset);
5958 if (object_len < 4) {
5959 proto_tree_add_expert_format(tree, pinfo, &ei_cops_bad_cops_object_length, tvb, offset, 2,
5960 "Incorrect PacketCable object length %u < 4", object_len);
5961 return;
5964 s_num = tvb_get_uint8(tvb, offset + 2);
5965 s_type = tvb_get_uint8(tvb, offset + 3);
5967 /* Glom the s_num and s_type together to make switching easier */
5968 num_type_glob = s_num << 8 | s_type;
5970 /* Perform the appropriate functions */
5971 switch (num_type_glob){
5972 case PCDQ_TRANSACTION_ID:
5973 cops_transaction_id(tvb, pinfo, tree, op_code, object_len, offset);
5974 break;
5975 case PCDQ_SUBSCRIBER_IDv4:
5976 cops_subscriber_id_v4(tvb, tree, object_len, offset);
5977 break;
5978 case PCDQ_SUBSCRIBER_IDv6:
5979 cops_subscriber_id_v6(tvb, tree, object_len, offset);
5980 break;
5981 case PCDQ_GATE_ID:
5982 cops_gate_id(tvb, tree, object_len, offset);
5983 break;
5984 case PCDQ_ACTIVITY_COUNT:
5985 cops_activity_count(tvb, tree, object_len, offset);
5986 break;
5987 case PCDQ_GATE_SPEC:
5988 cops_gate_specs(tvb, tree, object_len, offset);
5989 break;
5990 case PCDQ_REMOTE_GATE_INFO:
5991 cops_remote_gate_info(tvb, tree, object_len, offset);
5992 break;
5993 case PCDQ_EVENT_GENERATION_INFO:
5994 cops_event_generation_info(tvb, tree, object_len, offset);
5995 break;
5996 case PCDQ_PACKETCABLE_ERROR:
5997 cops_packetcable_error(tvb, tree, object_len, offset);
5998 break;
5999 case PCDQ_ELECTRONIC_SURVEILLANCE:
6000 cops_surveillance_parameters(tvb, tree, object_len, offset);
6001 break;
6002 case PCDQ_PACKETCABLE_REASON:
6003 cops_packetcable_reason(tvb, tree, object_len, offset);
6004 break;
6007 /* Tune offset */
6008 offset += object_len;
6010 /* See what we can still get from the buffer */
6011 remdata = tvb_reported_length_remaining(tvb, offset);
6015 /* XXX - This duplicates code in the DOCSIS dissector. */
6016 static void
6017 decode_docsis_request_transmission_policy(tvbuff_t *tvb, uint32_t offset, proto_tree *tree) {
6019 static int * const policies[] = {
6020 &hf_cops_pcmm_request_transmission_policy_sf_all_cm,
6021 &hf_cops_pcmm_request_transmission_policy_sf_priority,
6022 &hf_cops_pcmm_request_transmission_policy_sf_request_for_request,
6023 &hf_cops_pcmm_request_transmission_policy_sf_data_for_data,
6024 &hf_cops_pcmm_request_transmission_policy_sf_piggyback,
6025 &hf_cops_pcmm_request_transmission_policy_sf_concatenate,
6026 &hf_cops_pcmm_request_transmission_policy_sf_fragment,
6027 &hf_cops_pcmm_request_transmission_policy_sf_suppress,
6028 &hf_cops_pcmm_request_transmission_policy_sf_drop_packets,
6029 NULL
6032 proto_tree_add_bitmask(tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
6033 ett_docsis_request_transmission_policy,
6034 policies,
6035 ENC_BIG_ENDIAN);
6039 #define PCMM_TRANSACTION_ID 0x0101
6040 #define PCMM_AMID 0x0201
6041 #define PCMM_SUBSCRIBER_ID 0x0301
6042 #define PCMM_SUBSCRIBER_ID_V6 0x0302
6043 #define PCMM_GATE_ID 0x0401
6044 #define PCMM_GATE_SPEC 0x0501
6045 #define PCMM_CLASSIFIER 0x0601
6046 #define PCMM_EXTENDED_CLASSIFIER 0x0602
6047 #define PCMM_IPV6_CLASSIFIER 0x0603
6048 #define PCMM_FLOW_SPEC 0x0701
6049 #define PCMM_DOCSIS_SERVICE_CLASS_NAME 0x0702
6050 #define PCMM_BEST_EFFORT_SERVICE 0x0703
6051 #define PCMM_NON_REAL_TIME_POLLING_SERVICE 0x0704
6052 #define PCMM_REAL_TIME_POLLING_SERVICE 0x0705
6053 #define PCMM_UNSOLICITED_GRANT_SERVICE 0x0706
6054 #define PCMM_UGS_WITH_ACTIVITY_DETECTION 0x0707
6055 #define PCMM_DOWNSTREAM_SERVICE 0x0708
6056 #define PCMM_UPSTREAM_DROP 0x0709
6057 #define PCMM_EVENT_GENERATION_INFO 0x0801
6058 #define PCMM_VOLUME_BASED_USAGE_LIMIT 0x0901
6059 #define PCMM_TIME_BASED_USAGE_LIMIT 0x0a01
6060 #define PCMM_OPAQUE_DATA 0x0b01
6061 #define PCMM_GATE_TIME_INFO 0x0c01
6062 #define PCMM_GATE_USAGE_INFO 0x0d01
6063 #define PCMM_PACKETCABLE_ERROR 0x0e01
6064 #define PCMM_GATE_STATE 0x0f01
6065 #define PCMM_VERSION_INFO 0x1001
6066 #define PCMM_PSID 0x1101
6067 #define PCMM_SYNCH_OPTIONS 0x1201
6068 #define PCMM_MSG_RECEIPT_KEY 0x1301
6069 #define PCMM_USERID 0x1501
6070 #define PCMM_SHAREDRESOURCEID 0x1601
6073 static void
6074 cops_analyze_packetcable_mm_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint8_t op_code, uint32_t offset) {
6076 uint16_t object_len;
6077 uint8_t s_num, s_type;
6078 uint16_t num_type_glob;
6080 /* Only if this option is enabled by the Gui */
6081 if ( cops_packetcable == false ) {
6082 return;
6085 /* Do the remaining client specific objects */
6086 while (tvb_reported_length_remaining(tvb, offset) > 4) {
6088 /* In case we have remaining data, then lets try to get this analyzed */
6089 object_len = tvb_get_ntohs(tvb, offset);
6090 if (object_len < 4) {
6091 proto_tree_add_expert_format(tree, pinfo, &ei_cops_bad_cops_object_length, tvb, offset, 2,
6092 "Incorrect PacketCable object length %u < 4", object_len);
6093 return;
6096 s_num = tvb_get_uint8(tvb, offset + 2);
6097 s_type = tvb_get_uint8(tvb, offset + 3);
6099 /* Glom the s_num and s_type together to make switching easier */
6100 num_type_glob = s_num << 8 | s_type;
6102 /* Perform the appropriate functions */
6103 switch (num_type_glob){
6104 case PCMM_TRANSACTION_ID:
6105 cops_mm_transaction_id(tvb, pinfo, tree, op_code, object_len, offset);
6106 break;
6107 case PCMM_AMID:
6108 cops_amid(tvb, tree, object_len, offset);
6109 break;
6110 case PCMM_SUBSCRIBER_ID:
6111 cops_subscriber_id_v4(tvb, tree, object_len, offset);
6112 break;
6113 case PCMM_SUBSCRIBER_ID_V6:
6114 cops_subscriber_id_v6(tvb, tree, object_len, offset);
6115 break;
6116 case PCMM_GATE_ID:
6117 cops_gate_id(tvb, tree, object_len, offset);
6118 break;
6119 case PCMM_GATE_SPEC:
6120 cops_mm_gate_spec(tvb, tree, object_len, offset);
6121 break;
6122 case PCMM_CLASSIFIER:
6123 cops_classifier(tvb, tree, object_len, offset, false);
6124 break;
6125 case PCMM_EXTENDED_CLASSIFIER:
6126 cops_classifier(tvb, tree, object_len, offset, true);
6127 break;
6128 case PCMM_IPV6_CLASSIFIER:
6129 cops_ipv6_classifier(tvb, tree, object_len, offset);
6130 break;
6131 case PCMM_FLOW_SPEC:
6132 cops_flow_spec(tvb, tree, object_len, offset);
6133 break;
6134 case PCMM_DOCSIS_SERVICE_CLASS_NAME:
6135 cops_docsis_service_class_name(tvb, pinfo, tree, object_len, offset);
6136 break;
6137 case PCMM_BEST_EFFORT_SERVICE:
6138 if (object_len == 44 || object_len == 80 || object_len == 116)
6139 cops_best_effort_service_i04_i05(tvb, tree, object_len, offset, true);
6140 else if (object_len == 40 || object_len == 72 || object_len == 104)
6141 cops_best_effort_service_i04_i05(tvb, tree, object_len, offset, false);
6142 else
6143 cops_best_effort_service(tvb, tree, object_len, offset);
6144 break;
6145 case PCMM_NON_REAL_TIME_POLLING_SERVICE:
6146 if (object_len == 48 || object_len == 88 || object_len == 128)
6147 cops_non_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, true);
6148 else if (object_len == 44 || object_len == 80 || object_len == 116)
6149 cops_non_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, false);
6150 else
6151 cops_non_real_time_polling_service(tvb, tree, object_len, offset);
6152 break;
6153 case PCMM_REAL_TIME_POLLING_SERVICE:
6154 if (object_len == 48 || object_len == 88 || object_len == 128)
6155 cops_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, true);
6156 else if (object_len == 44 || object_len == 80 || object_len == 116)
6157 cops_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, false);
6158 else
6159 cops_real_time_polling_service(tvb, tree, object_len, offset);
6160 break;
6161 case PCMM_UNSOLICITED_GRANT_SERVICE:
6162 if (object_len == 36 || object_len == 64 || object_len == 92)
6163 cops_unsolicited_grant_service_i04_i05(tvb, tree, object_len, offset, true);
6164 else if (object_len == 32 || object_len == 56 || object_len == 80)
6165 cops_unsolicited_grant_service_i04_i05(tvb, tree, object_len, offset, false);
6166 else
6167 cops_unsolicited_grant_service(tvb, tree, object_len, offset);
6168 break;
6169 case PCMM_UGS_WITH_ACTIVITY_DETECTION:
6170 if (object_len == 44 || object_len == 80 || object_len == 116)
6171 cops_ugs_with_activity_detection_i04_i05(tvb, tree, object_len, offset, true);
6172 else if (object_len == 40 || object_len == 72 || object_len == 104)
6173 cops_ugs_with_activity_detection_i04_i05(tvb, tree, object_len, offset, false);
6174 else
6175 cops_ugs_with_activity_detection(tvb, tree, object_len, offset);
6176 break;
6177 case PCMM_DOWNSTREAM_SERVICE:
6178 if (object_len == 48 || object_len == 88 || object_len == 128)
6179 cops_downstream_service_i04_i05(tvb, tree, object_len, offset, true);
6180 else if (object_len == 40 || object_len == 72 || object_len == 104)
6181 cops_downstream_service_i04_i05(tvb, tree, object_len, offset, false);
6182 else
6183 cops_downstream_service(tvb, tree, object_len, offset);
6184 break;
6185 case PCMM_UPSTREAM_DROP:
6186 cops_upstream_drop_i04(tvb, tree, object_len, offset);
6187 break;
6188 case PCMM_EVENT_GENERATION_INFO:
6189 cops_mm_event_generation_info(tvb, tree, object_len, offset);
6190 break;
6191 case PCMM_VOLUME_BASED_USAGE_LIMIT:
6192 cops_volume_based_usage_limit(tvb, tree, object_len, offset);
6193 break;
6194 case PCMM_TIME_BASED_USAGE_LIMIT:
6195 cops_time_based_usage_limit(tvb, tree, object_len, offset);
6196 break;
6197 case PCMM_OPAQUE_DATA:
6198 cops_opaque_data(tvb, tree, object_len, offset);
6199 break;
6200 case PCMM_GATE_TIME_INFO:
6201 cops_gate_time_info(tvb, tree, object_len, offset);
6202 break;
6203 case PCMM_GATE_USAGE_INFO:
6204 cops_gate_usage_info(tvb, tree, object_len, offset);
6205 break;
6206 case PCMM_PACKETCABLE_ERROR:
6207 cops_packetcable_mm_error(tvb, tree, object_len, offset);
6208 break;
6209 case PCMM_GATE_STATE:
6210 cops_gate_state(tvb, tree, object_len, offset);
6211 break;
6212 case PCMM_VERSION_INFO:
6213 cops_version_info(tvb, tree, object_len, offset);
6214 break;
6215 case PCMM_PSID:
6216 cops_psid(tvb, tree, object_len, offset);
6217 break;
6218 case PCMM_SYNCH_OPTIONS:
6219 cops_synch_options(tvb, tree, object_len, offset);
6220 break;
6221 case PCMM_MSG_RECEIPT_KEY:
6222 cops_msg_receipt_key(tvb, tree, object_len, offset);
6223 break;
6224 case PCMM_USERID:
6225 cops_userid(tvb, tree, object_len, offset);
6226 break;
6227 case PCMM_SHAREDRESOURCEID:
6228 cops_sharedresourceid(tvb, tree, object_len, offset);
6229 break;
6233 /* Tune offset */
6234 offset += object_len;
6239 /* End of PacketCable Addition */
6242 * Editor modelines - https://www.wireshark.org/tools/modelines.html
6244 * Local variables:
6245 * c-basic-offset: 4
6246 * tab-width: 8
6247 * indent-tabs-mode: nil
6248 * End:
6250 * vi: set shiftwidth=4 tabstop=8 expandtab:
6251 * :indentSize=4:tabSize=8:noTabs=true: