MSWSP: add two more Property Sets
[wireshark-wip.git] / epan / dissectors / packet-cops.c
blob887ae5e9df63a8ccc88deb7b6f1ddb45d9376311
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 * $Id$
27 * Wireshark - Network traffic analyzer
28 * By Gerald Combs <gerald@wireshark.org>
29 * Copyright 1998 Gerald Combs
31 * This program is free software; you can redistribute it and/or
32 * modify it under the terms of the GNU General Public License
33 * as published by the Free Software Foundation; either version 2
34 * of the License, or (at your option) any later version.
36 * This program is distributed in the hope that it will be useful,
37 * but WITHOUT ANY WARRANTY; without even the implied warranty of
38 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39 * GNU General Public License for more details.
41 * You should have received a copy of the GNU General Public License
42 * along with this program; if not, write to the Free Software
43 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
47 * Some of the development of the COPS protocol decoder was sponsored by
48 * Cable Television Laboratories, Inc. ("CableLabs") based upon proprietary
49 * CableLabs' specifications. Your license and use of this protocol decoder
50 * does not mean that you are licensed to use the CableLabs'
51 * specifications. If you have questions about this protocol, contact
52 * jf.mule [AT] cablelabs.com or c.stuart [AT] cablelabs.com for additional
53 * information.
57 #include "config.h"
59 #include <string.h>
61 #include <glib.h>
63 #include <epan/packet.h>
64 #include <epan/conversation.h>
65 #include <epan/wmem/wmem.h>
66 #include <epan/emem.h>
67 #include "packet-tcp.h"
69 #include <epan/oids.h>
70 #include <epan/prefs.h>
71 #include <epan/expert.h>
72 #include <epan/asn1.h>
73 #include "packet-ber.h"
75 /* XXX - The "plain" COPS port (3288) can be overridden in the prefs.
76 The PacketCable port cannot - should this be the case? */
77 #define TCP_PORT_COPS 3288
78 #define TCP_PORT_PKTCABLE_COPS 2126
79 #define TCP_PORT_PKTCABLE_MM_COPS 3918
81 void proto_register_cops(void);
83 /* Preference: Variable to hold the tcp port preference */
84 static guint global_cops_tcp_port = TCP_PORT_COPS;
86 /* Preference: desegmentation of COPS */
87 static gboolean cops_desegment = TRUE;
89 #define COPS_OBJECT_HDR_SIZE 4
91 #if 0
92 /* Null string of type "guchar[]". */
93 static const guchar nullstring[] = "";
95 #define SAFE_STRING(s) (((s) != NULL) ? (s) : nullstring)
96 #endif
98 static const value_string cops_flags_vals[] = {
99 { 0x00, "None" },
100 { 0x01, "Solicited Message Flag Bit" },
101 { 0, NULL },
104 /* The different COPS message types */
105 enum cops_op_code {
106 COPS_NO_MSG, /* Not a COPS Message type */
108 COPS_MSG_REQ, /* Request (REQ) */
109 COPS_MSG_DEC, /* Decision (DEC) */
110 COPS_MSG_RPT, /* Report State (RPT) */
111 COPS_MSG_DRQ, /* Delete Request State (DRQ) */
112 COPS_MSG_SSQ, /* Synchronize State Req (SSQ) */
113 COPS_MSG_OPN, /* Client-Open (OPN) */
114 COPS_MSG_CAT, /* Client-Accept (CAT) */
115 COPS_MSG_CC, /* Client-Close (CC) */
116 COPS_MSG_KA, /* Keep-Alive (KA) */
117 COPS_MSG_SSC, /* Synchronize Complete (SSC) */
119 COPS_LAST_OP_CODE /* For error checking */
122 static const value_string cops_op_code_vals[] = {
123 { COPS_MSG_REQ, "Request (REQ)" },
124 { COPS_MSG_DEC, "Decision (DEC)" },
125 { COPS_MSG_RPT, "Report State (RPT)" },
126 { COPS_MSG_DRQ, "Delete Request State (DRQ)" },
127 { COPS_MSG_SSQ, "Synchronize State Req (SSQ)" },
128 { COPS_MSG_OPN, "Client-Open (OPN)" },
129 { COPS_MSG_CAT, "Client-Accept (CAT)" },
130 { COPS_MSG_CC, "Client-Close (CC)" },
131 { COPS_MSG_KA, "Keep-Alive (KA)" },
132 { COPS_MSG_SSC, "Synchronize Complete (SSC)" },
133 { 0, NULL },
137 /* The different objects in COPS messages */
138 enum cops_c_num {
139 COPS_NO_OBJECT, /* Not a COPS Object type */
141 COPS_OBJ_HANDLE, /* Handle Object (Handle) */
142 COPS_OBJ_CONTEXT, /* Context Object (Context) */
143 COPS_OBJ_IN_INT, /* In-Interface Object (IN-Int) */
144 COPS_OBJ_OUT_INT, /* Out-Interface Object (OUT-Int) */
145 COPS_OBJ_REASON, /* Reason Object (Reason) */
146 COPS_OBJ_DECISION, /* Decision Object (Decision) */
147 COPS_OBJ_LPDPDECISION, /* LPDP Decision Object (LPDPDecision) */
148 COPS_OBJ_ERROR, /* Error Object (Error) */
149 COPS_OBJ_CLIENTSI, /* Client Specific Information Object (ClientSI) */
150 COPS_OBJ_KATIMER, /* Keep-Alive Timer Object (KATimer) */
151 COPS_OBJ_PEPID, /* PEP Identification Object (PEPID) */
152 COPS_OBJ_REPORT_TYPE, /* Report-Type Object (Report-Type) */
153 COPS_OBJ_PDPREDIRADDR, /* PDP Redirect Address Object (PDPRedirAddr) */
154 COPS_OBJ_LASTPDPADDR, /* Last PDP Address (LastPDPaddr) */
155 COPS_OBJ_ACCTTIMER, /* Accounting Timer Object (AcctTimer) */
156 COPS_OBJ_INTEGRITY, /* Message Integrity Object (Integrity) */
157 COPS_LAST_C_NUM /* For error checking */
160 static const value_string cops_c_num_vals[] = {
161 { COPS_OBJ_HANDLE, "Handle Object (Handle)" },
162 { COPS_OBJ_CONTEXT, "Context Object (Context)" },
163 { COPS_OBJ_IN_INT, "In-Interface Object (IN-Int)" },
164 { COPS_OBJ_OUT_INT, "Out-Interface Object (OUT-Int)" },
165 { COPS_OBJ_REASON, "Reason Object (Reason)" },
166 { COPS_OBJ_DECISION, "Decision Object (Decision)" },
167 { COPS_OBJ_LPDPDECISION, "LPDP Decision Object (LPDPDecision)" },
168 { COPS_OBJ_ERROR, "Error Object (Error)" },
169 { COPS_OBJ_CLIENTSI, "Client Specific Information Object (ClientSI)" },
170 { COPS_OBJ_KATIMER, "Keep-Alive Timer Object (KATimer)" },
171 { COPS_OBJ_PEPID, "PEP Identification Object (PEPID)" },
172 { COPS_OBJ_REPORT_TYPE, "Report-Type Object (Report-Type)" },
173 { COPS_OBJ_PDPREDIRADDR, "PDP Redirect Address Object (PDPRedirAddr)" },
174 { COPS_OBJ_LASTPDPADDR, "Last PDP Address (LastPDPaddr)" },
175 { COPS_OBJ_ACCTTIMER, "Accounting Timer Object (AcctTimer)" },
176 { COPS_OBJ_INTEGRITY, "Message Integrity Object (Integrity)" },
177 { 0, NULL },
181 /* The different objects in COPS-PR messages */
182 enum cops_s_num {
183 COPS_NO_PR_OBJECT, /* Not a COPS-PR Object type */
184 COPS_OBJ_PRID, /* Provisioning Instance Identifier (PRID) */
185 COPS_OBJ_PPRID, /* Prefix Provisioning Instance Identifier (PPRID) */
186 COPS_OBJ_EPD, /* Encoded Provisioning Instance Data (EPD) */
187 COPS_OBJ_GPERR, /* Global Provisioning Error Object (GPERR) */
188 COPS_OBJ_CPERR, /* PRC Class Provisioning Error Object (CPERR) */
189 COPS_OBJ_ERRPRID, /* Error Provisioning Instance Identifier (ErrorPRID)*/
191 COPS_LAST_S_NUM /* For error checking */
195 static const value_string cops_s_num_vals[] = {
196 { COPS_OBJ_PRID, "Provisioning Instance Identifier (PRID)" },
197 { COPS_OBJ_PPRID, "Prefix Provisioning Instance Identifier (PPRID)" },
198 { COPS_OBJ_EPD, "Encoded Provisioning Instance Data (EPD)" },
199 { COPS_OBJ_GPERR, "Global Provisioning Error Object (GPERR)" },
200 { COPS_OBJ_CPERR, "PRC Class Provisioning Error Object (CPERR)" },
201 { COPS_OBJ_ERRPRID, "Error Provisioning Instance Identifier (ErrorPRID)" },
202 { 0, NULL },
206 /* R-Type is carried within the Context Object */
207 static const value_string cops_r_type_vals[] = {
208 { 0x01, "Incoming-Message/Admission Control request" },
209 { 0x02, "Resource-Allocation request" },
210 { 0x04, "Outgoing-Message request" },
211 { 0x08, "Configuration request" },
212 { 0, NULL },
214 /* S-Type is carried within the ClientSI Object for COPS-PR*/
215 static const value_string cops_s_type_vals[] = {
216 { 0x01, "BER" },
217 { 0, NULL },
220 /* Reason-Code is carried within the Reason object */
221 static const value_string cops_reason_vals[] = {
222 { 1, "Unspecified" },
223 { 2, "Management" },
224 { 3, "Preempted (Another request state takes precedence)" },
225 { 4, "Tear (Used to communicate a signaled state removal)" },
226 { 5, "Timeout (Local state has timed-out)" },
227 { 6, "Route Change (Change invalidates request state)" },
228 { 7, "Insufficient Resources (No local resource available)" },
229 { 8, "PDP's Directive (PDP decision caused the delete)" },
230 { 9, "Unsupported decision (PDP decision not supported)" },
231 { 10, "Synchronize Handle Unknown" },
232 { 11, "Transient Handle (stateless event)" },
233 { 12, "Malformed Decision (could not recover)" },
234 { 13, "Unknown COPS Object from PDP" },
235 { 0, NULL },
238 /* Command-Code is carried within the Decision object if C-Type is 1 */
239 static const value_string cops_dec_cmd_code_vals[] = {
240 { 0, "NULL Decision (No configuration data available)" },
241 { 1, "Install (Admit request/Install configuration)" },
242 { 2, "Remove (Remove request/Remove configuration)" },
243 { 0, NULL },
246 /* Decision flags are also carried with the Decision object if C-Type is 1 */
247 static const value_string cops_dec_cmd_flag_vals[] = {
248 { 0x00, "<None set>" },
249 { 0x01, "Trigger Error (Trigger error message if set)" },
250 { 0, NULL },
253 /* Error-Code from Error object */
254 static const value_string cops_error_vals[] = {
255 {1, "Bad handle" },
256 {2, "Invalid handle reference" },
257 {3, "Bad message format (Malformed Message)" },
258 {4, "Unable to process (server gives up on query)" },
259 {5, "Mandatory client-specific info missing" },
260 {6, "Unsupported client" },
261 {7, "Mandatory COPS object missing" },
262 {8, "Client Failure" },
263 {9, "Communication Failure" },
264 {10, "Unspecified" },
265 {11, "Shutting down" },
266 {12, "Redirect to Preferred Server" },
267 {13, "Unknown COPS Object" },
268 {14, "Authentication Failure" },
269 {15, "Authentication Required" },
270 {0, NULL },
272 /* Error-Code from GPERR object */
273 static const value_string cops_gperror_vals[] = {
274 {1, "AvailMemLow" },
275 {2, "AvailMemExhausted" },
276 {3, "unknownASN.1Tag" },
277 {4, "maxMsgSizeExceeded" },
278 {5, "unknownError" },
279 {6, "maxRequestStatesOpen" },
280 {7, "invalidASN.1Length" },
281 {8, "invalidObjectPad" },
282 {9, "unknownPIBData" },
283 {10, "unknownCOPSPRObject" },
284 {11, "malformedDecision" },
285 {0, NULL },
288 /* Error-Code from CPERR object */
289 static const value_string cops_cperror_vals[] = {
290 {1, "priSpaceExhausted" },
291 {2, "priInstanceInvalid" },
292 {3, "attrValueInvalid" },
293 {4, "attrValueSupLimited" },
294 {5, "attrEnumSupLimited" },
295 {6, "attrMaxLengthExceeded" },
296 {7, "attrReferenceUnknown" },
297 {8, "priNotifyOnly" },
298 {9, "unknownPrc" },
299 {10, "tooFewAttrs" },
300 {11, "invalidAttrType" },
301 {12, "deletedInRef" },
302 {13, "priSpecificError" },
303 {0, NULL },
307 /* Report-Type from Report-Type object */
308 static const value_string cops_report_type_vals[] = {
309 {1, " Success : Decision was successful at the PEP" },
310 {2, " Failure : Decision could not be completed by PEP" },
311 {3, " Accounting: Accounting update for an installed state" },
312 {0, NULL },
316 /* Client-type descriptions */
317 /* http://www.iana.org/assignments/cops-parameters */
319 /* PacketCable Types */
321 /* static dissector_handle_t sdp_handle; */
323 #define COPS_CLIENT_PC_DQOS 0x8008
324 #define COPS_CLIENT_PC_MM 0x800a
326 static const value_string cops_client_type_vals[] = {
327 {0, "None"},
328 {1, "RSVP"},
329 {2, "DiffServ QoS"},
330 {0x8001, "IP Highway"},
331 {0x8002, "IP Highway"},
332 {0x8003, "IP Highway"},
333 {0x8004, "IP Highway"},
334 {0x8005, "Fujitsu"},
335 {0x8006, "HP OpenView PolicyXpert"},
336 {0x8007, "HP OpenView PolicyXpert"},
337 {COPS_CLIENT_PC_DQOS, "PacketCable Dynamic Quality-of-Service"},
338 {0x8009, "3GPP"},
339 {COPS_CLIENT_PC_MM, "PacketCable Multimedia"},
340 {0x800b, "Juniper"},
341 {0x800c, "Q.3303.1 (Rw interface) COPS alternative"},
342 {0x800d, "Q.3304.1 (Rc interface) COPS alternative"},
343 {0, NULL},
346 /* The next tables are for PacketCable */
348 /* Transaction ID table */
349 static const value_string table_cops_dqos_transaction_id[] =
351 { 0x1, "Gate Alloc" },
352 { 0x2, "Gate Alloc Ack" },
353 { 0x3, "Gate Alloc Err" },
354 { 0x4, "Gate Set" },
355 { 0x5, "Gate Set Ack" },
356 { 0x6, "Gate Set Err" },
357 { 0x7, "Gate Info" },
358 { 0x8, "Gate Info Ack" },
359 { 0x9, "Gate Info Err" },
360 { 0xa, "Gate Delete" },
361 { 0xb, "Gate Delete Ack" },
362 { 0xc, "Gate Delete Err" },
363 { 0xd, "Gate Open" },
364 { 0xe, "Gate Close" },
365 { 0, NULL },
368 /* Direction */
369 static const value_string table_cops_direction[] =
371 { 0x0, "Downstream gate" },
372 { 0x1, "Upstream gate" },
373 { 0, NULL },
376 /* Session Class */
377 static const value_string table_cops_session_class[] =
379 { 0x0, "Unspecified" },
380 { 0x1, "Normal priority VoIP session" },
381 { 0x2, "High priority VoIP session" },
382 { 0x3, "Reserved" },
383 { 0, NULL },
386 /* Reason Code */
387 static const value_string table_cops_reason_code[] =
389 { 0x0, "Gate Delete Operation" },
390 { 0x1, "Gate Close Operation" },
391 { 0, NULL },
394 /* Reason Sub Code - Delete */
395 static const value_string table_cops_reason_subcode_delete[] =
397 { 0x0, "Normal Operation" },
398 { 0x1, "Local Gate-coordination not completed" },
399 { 0x2, "Remote Gate-coordination not completed" },
400 { 0x3, "Authorization revoked" },
401 { 0x4, "Unexpected Gate-Open" },
402 { 0x5, "Local Gate-Close failure" },
403 { 0x127,"Unspecified error" },
404 { 0, NULL },
407 /* Reason Sub Code - Close */
408 static const value_string table_cops_reason_subcode_close[] =
410 { 0x0, "Client initiated release (normal operation)" },
411 { 0x1, "Reservation reassignment (e.g., for priority session)" },
412 { 0x2, "Lack of reservation maintenance (e.g., RSVP refreshes)" },
413 { 0x3, "Lack of Docsis Mac-layer responses (e.g., station maintenance)" },
414 { 0x4, "Timer T0 expiration; no Gate-Set received from CMS" },
415 { 0x5, "Timer T1 expiration; no Commit received from MTA" },
416 { 0x6, "Timer T7 expiration; Service Flow reservation timeout" },
417 { 0x7, "Timer T8 expiration; Service Flow inactivity in the upstream direction" },
418 { 0x127,"Unspecified error" },
419 { 0, NULL },
422 /* PacketCable Error */
423 static const value_string table_cops_packetcable_error[] =
425 { 0x1, "No gates urrently available" },
426 { 0x2, "Unknown Gate ID" },
427 { 0x3, "Illegal Session Class value" },
428 { 0x4, "Subscriber exceeded gate limit" },
429 { 0x5, "Gate already set" },
430 { 0x6, "Missing Required Object" },
431 { 0x7, "Invalid Object" },
432 { 0x127,"Unspecified error" },
433 { 0, NULL },
437 /* PacketCable Multimedia */
439 static const value_string table_cops_mm_transaction_id[] = {
440 {1, "Reserved"},
441 {2, "Reserved"},
442 {3, "Reserved"},
443 {4, "Gate Set"},
444 {5, "Gate Set Ack"},
445 {6, "Gate Set Err"},
446 {7, "Gate Info"},
447 {8, "Gate Info Ack"},
448 {9, "Gate Info Err"},
449 {10, "Gate Delete"},
450 {11, "Gate Delete Ack"},
451 {12, "Gate Delete Err"},
452 {13, "Gate Open"},
453 {14, "Gate Close"},
454 {15, "Gate Report State"},
455 {16, "Invalid Gate Cmd Err"},
456 {17, "PDP Config"},
457 {18, "PDP Config Ack"},
458 {19, "PDP Config Error"},
459 {20, "Synch Request"},
460 {21, "Synch Report"},
461 {22, "Synch Complete"},
462 {23, "Message Receipt"},
463 {0, NULL },
466 static const value_string pcmm_activation_state_vals[] = {
467 {0, "Inactive"},
468 {1, "Active"},
469 {0, NULL },
472 static const value_string pcmm_action_vals[] = {
473 {0, "Add classifier"},
474 {1, "Replace classifier"},
475 {2, "Delete classifier"},
476 {3, "No change"},
477 {0, NULL },
480 static const value_string pcmm_flow_spec_service_vals[] = {
481 {2, "Guaranteed Rate"},
482 {5, "Controlled Load"},
483 {0, NULL },
486 static const value_string pcmm_report_type_vals[] = {
487 {0, "Standard Report Data"},
488 {1, "Complete Gate Data"},
489 {0, NULL},
492 static const value_string pcmm_synch_type_vals[] = {
493 {0, "Full Synchronization"},
494 {1, "Incremental Synchronization"},
495 {0, NULL},
498 static const value_string pcmm_packetcable_error_code[] = {
499 {1, "Insufficient Resources"},
500 {2, "Unknown GateID"},
501 {6, "Missing Required Object"},
502 {7, "Invalid Object"},
503 {8, "Volume-Based Usage Limit Exceeded"},
504 {9, "Time-Based Usage Limit Exceeded"},
505 {10, "Session Class Limit Exceeded"},
506 {11, "Undefined Service Class Name"},
507 {12, "Incompatible Envelope"},
508 {13, "Invalid SubscriberID"},
509 {14, "Unauthorized AMID"},
510 {15, "Number of Classifiers Not Supported"},
511 {16, "Policy Exception"},
512 {17, "Invalid Field Value in Object"},
513 {18, "Transport Error"},
514 {19, "Unknown Gate Command"},
515 {20, "Unauthorized PSID"},
516 {21, "No State for PDP"},
517 {22, "Unsupported Synch Type"},
518 {23, "Incremental Data Incomplete"},
519 {127, "Other, Unspecified Error"},
520 {0, NULL},
523 static const value_string pcmm_gate_state[] = {
524 {1, "Idle/Closed"},
525 {2, "Authorized"},
526 {3, "Reserved"},
527 {4, "Committed"},
528 {5, "Committed-Recovery"},
529 {0, NULL},
532 static const value_string pcmm_gate_state_reason[] = {
533 {1, "Close initiated by CMTS due to reservation reassignment"},
534 {2, "Close initiated by CMTS due to lack of DOCSIS MAC-layer responses"},
535 {3, "Close initiated by CMTS due to timer T1 expiration"},
536 {4, "Close initiated by CMTS due to timer T2 expiration"},
537 {5, "Inactivity timer expired due to Service Flow inactivity (timer T3 expiration)"},
538 {6, "Close initiated by CMTS due to lack of Reservation Maintenance"},
539 {7, "Gate state unchanged, but volume limit reached"},
540 {8, "Close initiated by CMTS due to timer T4 expiration"},
541 {9, "Gate state unchanged, but timer T2 expiration caused reservation reduction"},
542 {10, "Gate state unchanged, but time limit reached"},
543 {11, "Close initiated by Policy Server or CMTS, volume limit reached"},
544 {12, "Close initiated by Policy Server or CMTS, time limit reached"},
545 {13, "Close initiated by CMTS, other"},
546 {65535, "Other"},
547 {0, NULL},
551 /* End of PacketCable Tables */
554 /* Initialize the protocol and registered fields */
555 static gint proto_cops = -1;
556 static gint hf_cops_ver_flags = -1;
557 static gint hf_cops_version = -1;
558 static gint hf_cops_flags = -1;
560 static gint hf_cops_response_in = -1;
561 static gint hf_cops_response_to = -1;
562 static gint hf_cops_response_time = -1;
564 static gint hf_cops_op_code = -1;
565 static gint hf_cops_client_type = -1;
566 static gint hf_cops_msg_len = -1;
568 static gint hf_cops_obj_len = -1;
569 static gint hf_cops_obj_c_num = -1;
570 static gint hf_cops_obj_c_type = -1;
572 static gint hf_cops_obj_s_num = -1;
573 static gint hf_cops_obj_s_type = -1;
575 static gint hf_cops_handle = -1;
577 static gint hf_cops_r_type_flags = -1;
578 static gint hf_cops_m_type_flags = -1;
580 static gint hf_cops_in_int_ipv4 = -1;
581 static gint hf_cops_in_int_ipv6 = -1;
582 static gint hf_cops_out_int_ipv4 = -1;
583 static gint hf_cops_out_int_ipv6 = -1;
584 static gint hf_cops_int_ifindex = -1;
586 static gint hf_cops_reason = -1;
587 static gint hf_cops_reason_sub = -1;
589 static gint hf_cops_dec_cmd_code = -1;
590 static gint hf_cops_dec_flags = -1;
592 static gint hf_cops_error = -1;
593 static gint hf_cops_error_sub = -1;
595 static gint hf_cops_gperror = -1;
596 static gint hf_cops_gperror_sub = -1;
598 static gint hf_cops_cperror = -1;
599 static gint hf_cops_cperror_sub = -1;
601 static gint hf_cops_katimer = -1;
603 static gint hf_cops_pepid = -1;
605 static gint hf_cops_report_type = -1;
607 static gint hf_cops_pdprediraddr_ipv4 = -1;
608 static gint hf_cops_pdprediraddr_ipv6 = -1;
609 static gint hf_cops_lastpdpaddr_ipv4 = -1;
610 static gint hf_cops_lastpdpaddr_ipv6 = -1;
611 static gint hf_cops_pdp_tcp_port = -1;
613 static gint hf_cops_accttimer = -1;
615 static gint hf_cops_key_id = -1;
616 static gint hf_cops_seq_num = -1;
618 static gint hf_cops_prid_oid = -1;
619 static gint hf_cops_pprid_oid = -1;
620 static gint hf_cops_errprid_oid = -1;
621 static gint hf_cops_epd_null = -1;
622 static gint hf_cops_epd_int = -1;
623 static gint hf_cops_epd_octets = -1;
624 static gint hf_cops_epd_oid = -1;
625 static gint hf_cops_epd_ipv4 = -1;
626 static gint hf_cops_epd_u32 = -1;
627 static gint hf_cops_epd_ticks = -1;
628 static gint hf_cops_epd_opaque = -1;
629 static gint hf_cops_epd_i64 = -1;
630 static gint hf_cops_epd_u64 = -1;
631 static gint hf_cops_epd_unknown = -1;
632 static gint hf_cops_reserved8 = -1;
633 static gint hf_cops_reserved16 = -1;
634 static gint hf_cops_reserved24 = -1;
637 /* For PacketCable D-QoS */
638 static gint hf_cops_subtree = -1;
639 static gint hf_cops_pc_activity_count = -1;
640 static gint hf_cops_pc_algorithm = -1;
641 static gint hf_cops_pc_close_subcode = -1;
642 static gint hf_cops_pc_cmts_ip = -1;
643 static gint hf_cops_pc_cmts_ip_port = -1;
644 static gint hf_cops_pc_prks_ip = -1;
645 static gint hf_cops_pc_prks_ip_port = -1;
646 static gint hf_cops_pc_srks_ip = -1;
647 static gint hf_cops_pc_srks_ip_port = -1;
648 static gint hf_cops_pc_delete_subcode = -1;
649 static gint hf_cops_pc_dest_ip = -1;
650 static gint hf_cops_pc_dest_port = -1;
651 static gint hf_cops_pc_direction = -1;
652 static gint hf_cops_pc_ds_field = -1;
653 static gint hf_cops_pc_gate_id = -1;
654 static gint hf_cops_pc_gate_spec_flags = -1;
655 static gint hf_cops_pc_gate_command_type = -1;
656 static gint hf_cops_pc_key = -1;
657 static gint hf_cops_pc_max_packet_size = -1;
658 static gint hf_cops_pc_min_policed_unit = -1;
659 static gint hf_cops_pc_packetcable_err_code = -1;
660 static gint hf_cops_pc_packetcable_sub_code = -1;
661 static gint hf_cops_pc_peak_data_rate = -1;
662 static gint hf_cops_pc_protocol_id = -1;
663 static gint hf_cops_pc_reason_code = -1;
664 static gint hf_cops_pc_remote_flags = -1;
665 static gint hf_cops_pc_remote_gate_id = -1;
666 static gint hf_cops_pc_reserved = -1;
667 static gint hf_cops_pc_session_class = -1;
668 static gint hf_cops_pc_slack_term = -1;
669 static gint hf_cops_pc_spec_rate = -1;
670 static gint hf_cops_pc_src_ip = -1;
671 static gint hf_cops_pc_src_port = -1;
672 static gint hf_cops_pc_subscriber_id_ipv4 = -1;
673 static gint hf_cops_pc_subscriber_id_ipv6 = -1;
674 static gint hf_cops_pc_t1_value = -1;
675 static gint hf_cops_pc_t7_value = -1;
676 static gint hf_cops_pc_t8_value = -1;
677 static gint hf_cops_pc_token_bucket_rate = -1;
678 static gint hf_cops_pc_token_bucket_size = -1;
679 static gint hf_cops_pc_transaction_id = -1;
680 static gint hf_cops_pc_bcid_ts = -1;
681 /* static gint hf_cops_pc_bcid = -1; */
682 static gint hf_cops_pc_bcid_ev = -1;
683 static gint hf_cops_pc_dfcdc_ip = -1;
684 static gint hf_cops_pc_dfccc_ip = -1;
685 static gint hf_cops_pc_dfcdc_ip_port = -1;
686 static gint hf_cops_pc_dfccc_ip_port = -1;
687 static gint hf_cops_pc_dfccc_id = -1;
689 /* PacketCable Multimedia */
690 static gint hf_cops_pcmm_amid_app_type = -1;
691 static gint hf_cops_pcmm_amid_am_tag = -1;
692 static gint hf_cops_pcmm_gate_spec_flags = -1;
693 static gint hf_cops_pcmm_gate_spec_flags_gate = -1;
694 static gint hf_cops_pcmm_gate_spec_flags_dscp_overwrite = -1;
695 static gint hf_cops_pcmm_gate_spec_dscp_tos_field = -1;
696 static gint hf_cops_pcmm_gate_spec_dscp_tos_mask = -1;
697 static gint hf_cops_pcmm_gate_spec_session_class_id = -1;
698 static gint hf_cops_pcmm_gate_spec_session_class_id_priority = -1;
699 static gint hf_cops_pcmm_gate_spec_session_class_id_preemption = -1;
700 static gint hf_cops_pcmm_gate_spec_session_class_id_configurable = -1;
701 static gint hf_cops_pcmm_gate_spec_timer_t1 = -1;
702 static gint hf_cops_pcmm_gate_spec_timer_t2 = -1;
703 static gint hf_cops_pcmm_gate_spec_timer_t3 = -1;
704 static gint hf_cops_pcmm_gate_spec_timer_t4 = -1;
705 static gint hf_cops_pcmm_classifier_protocol_id = -1;
706 static gint hf_cops_pcmm_classifier_dscp_tos_field = -1;
707 static gint hf_cops_pcmm_classifier_dscp_tos_mask = -1;
708 static gint hf_cops_pcmm_classifier_src_addr = -1;
709 static gint hf_cops_pcmm_classifier_src_mask = -1;
710 static gint hf_cops_pcmm_classifier_dst_addr = -1;
711 static gint hf_cops_pcmm_classifier_dst_mask = -1;
712 static gint hf_cops_pcmm_classifier_src_port = -1;
713 static gint hf_cops_pcmm_classifier_src_port_end = -1;
714 static gint hf_cops_pcmm_classifier_dst_port = -1;
715 static gint hf_cops_pcmm_classifier_dst_port_end = -1;
716 static gint hf_cops_pcmm_classifier_priority = -1;
717 static gint hf_cops_pcmm_classifier_classifier_id = -1;
718 static gint hf_cops_pcmm_classifier_activation_state = -1;
719 static gint hf_cops_pcmm_classifier_action = -1;
720 static gint hf_cops_pcmm_classifier_flags = -1;
721 static gint hf_cops_pcmm_classifier_tc_low = -1;
722 static gint hf_cops_pcmm_classifier_tc_high = -1;
723 static gint hf_cops_pcmm_classifier_tc_mask = -1;
724 static gint hf_cops_pcmm_classifier_flow_label = -1;
725 static gint hf_cops_pcmm_classifier_next_header_type = -1;
726 static gint hf_cops_pcmm_classifier_source_prefix_length = -1;
727 static gint hf_cops_pcmm_classifier_destination_prefix_length = -1;
728 static gint hf_cops_pcmm_classifier_src_addr_v6 = -1;
729 static gint hf_cops_pcmm_classifier_dst_addr_v6 = -1;
730 static gint hf_cops_pcmm_flow_spec_envelope = -1;
731 static gint hf_cops_pcmm_flow_spec_service_number = -1;
732 static gint hf_cops_pcmm_docsis_scn = -1;
733 static gint hf_cops_pcmm_envelope = -1;
734 static gint hf_cops_pcmm_traffic_priority = -1;
735 static gint hf_cops_pcmm_request_transmission_policy = -1;
736 static gint hf_cops_pcmm_max_sustained_traffic_rate = -1;
737 static gint hf_cops_pcmm_max_traffic_burst = -1;
738 static gint hf_cops_pcmm_min_reserved_traffic_rate = -1;
739 static gint hf_cops_pcmm_ass_min_rtr_packet_size = -1;
740 static gint hf_cops_pcmm_max_concat_burst = -1;
741 static gint hf_cops_pcmm_req_att_mask = -1;
742 static gint hf_cops_pcmm_forbid_att_mask = -1;
743 static gint hf_cops_pcmm_att_aggr_rule_mask = -1;
744 static gint hf_cops_pcmm_nominal_polling_interval = -1;
745 static gint hf_cops_pcmm_tolerated_poll_jitter = -1;
746 static gint hf_cops_pcmm_unsolicited_grant_size = -1;
747 static gint hf_cops_pcmm_grants_per_interval = -1;
748 static gint hf_cops_pcmm_nominal_grant_interval = -1;
749 static gint hf_cops_pcmm_tolerated_grant_jitter = -1;
750 static gint hf_cops_pcmm_down_resequencing = -1;
751 static gint hf_cops_pcmm_down_peak_traffic_rate = -1;
752 static gint hf_cops_pcmm_max_downstream_latency = -1;
753 static gint hf_cops_pcmm_volume_based_usage_limit = -1;
754 static gint hf_cops_pcmm_time_based_usage_limit = -1;
755 static gint hf_cops_pcmm_gate_time_info = -1;
756 static gint hf_cops_pcmm_gate_usage_info = -1;
757 static gint hf_cops_pcmm_packetcable_error_code = -1;
758 static gint hf_cops_pcmm_packetcable_error_subcode = -1;
759 static gint hf_cops_pcmm_packetcable_gate_state = -1;
760 static gint hf_cops_pcmm_packetcable_gate_state_reason = -1;
761 static gint hf_cops_pcmm_packetcable_version_info_major = -1;
762 static gint hf_cops_pcmm_packetcable_version_info_minor = -1;
763 static gint hf_cops_pcmm_psid = -1;
764 static gint hf_cops_pcmm_synch_options_report_type = -1;
765 static gint hf_cops_pcmm_synch_options_synch_type = -1;
766 static gint hf_cops_pcmm_msg_receipt_key = -1;
767 static gint hf_cops_pcmm_userid = -1;
768 static gint hf_cops_pcmm_sharedresourceid = -1;
771 /* Initialize the subtree pointers */
772 static gint ett_cops = -1;
773 static gint ett_cops_ver_flags = -1;
774 static gint ett_cops_obj = -1;
775 static gint ett_cops_pr_obj = -1;
776 static gint ett_cops_obj_data = -1;
777 static gint ett_cops_r_type_flags = -1;
778 static gint ett_cops_itf = -1;
779 static gint ett_cops_reason = -1;
780 static gint ett_cops_decision = -1;
781 static gint ett_cops_error = -1;
782 static gint ett_cops_clientsi = -1;
783 static gint ett_cops_asn1 = -1;
784 static gint ett_cops_gperror = -1;
785 static gint ett_cops_cperror = -1;
786 static gint ett_cops_pdp = -1;
788 static expert_field ei_cops_pepid_not_null = EI_INIT;
789 static expert_field ei_cops_trailing_garbage = EI_INIT;
790 static expert_field ei_cops_bad_cops_object_length = EI_INIT;
791 static expert_field ei_cops_bad_cops_pr_object_length = EI_INIT;
792 static expert_field ei_cops_unknown_c_num = EI_INIT;
793 static expert_field ei_cops_unknown_s_num = EI_INIT;
795 /* For PacketCable */
796 static gint ett_cops_subtree = -1;
798 static gint ett_docsis_request_transmission_policy = -1;
800 /* For request/response matching */
801 typedef struct _cops_conv_info_t {
802 wmem_tree_t *pdus_tree;
803 } cops_conv_info_t;
805 typedef struct _cops_call_t
807 guint8 op_code;
808 gboolean solicited;
809 guint32 req_num;
810 guint32 rsp_num;
811 nstime_t req_time;
812 } cops_call_t;
814 void proto_reg_handoff_cops(void);
815 static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, guint8 op_code, guint32 offset, proto_tree *tree, guint16 client_type, guint32* handle_value);
816 static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, proto_tree *tree,
817 guint8 op_code, guint16 client_type, guint8 c_num, guint8 c_type, int len, guint32* handle_value);
819 static void dissect_cops_pr_objects(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, proto_tree *tree, int pr_len,
820 oid_info_t** oid_info_p, guint32** pprid_subids_p, guint* pprid_subids_len_p);
821 static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, proto_tree *tree,
822 guint8 s_num, guint8 s_type, int len,
823 oid_info_t** oid_info_p, guint32** pprid_subids, guint* pprid_subids_len);
825 /* Added for PacketCable */
826 static proto_tree *info_to_cops_subtree(tvbuff_t *, proto_tree *, int, int, const char *);
827 static proto_item *info_to_display(tvbuff_t *, proto_item *, int, int, const char *, const value_string *, int, gint *);
829 static void cops_transaction_id(tvbuff_t *, packet_info *, proto_tree *, guint8, guint, guint32);
830 static void cops_subscriber_id_v4(tvbuff_t *, proto_tree *, guint, guint32);
831 static void cops_subscriber_id_v6(tvbuff_t *, proto_tree *, guint, guint32);
832 static void cops_gate_id(tvbuff_t *, proto_tree *, guint, guint32);
833 static void cops_activity_count(tvbuff_t *, proto_tree *, guint, guint32);
834 static void cops_gate_specs(tvbuff_t *, proto_tree *, guint, guint32);
835 static void cops_remote_gate_info(tvbuff_t *, proto_tree *, guint, guint32);
836 static void cops_packetcable_reason(tvbuff_t *, proto_tree *, guint, guint32);
837 static void cops_packetcable_error(tvbuff_t *, proto_tree *, guint, guint32);
838 static void cops_event_generation_info(tvbuff_t *, proto_tree *, guint, guint32);
839 static void cops_surveillance_parameters(tvbuff_t *, proto_tree *, guint, guint32);
841 static void cops_amid(tvbuff_t *, proto_tree *, guint, guint32);
843 static void decode_docsis_request_transmission_policy(tvbuff_t *tvb, guint32 offset, proto_tree *tree, gint hf);
845 static void cops_analyze_packetcable_dqos_obj(tvbuff_t *, packet_info *, proto_tree *, guint8, guint32);
846 static void cops_analyze_packetcable_mm_obj(tvbuff_t *, packet_info *, proto_tree *, guint8, guint32);
848 static gboolean cops_packetcable = TRUE;
850 /* End of addition for PacketCable */
852 /* COPS PR Tags */
854 #define COPS_IPA 0 /* IP Address */
855 #define COPS_U32 2 /* Unsigned 32*/
856 #define COPS_TIT 3 /* TimeTicks */
857 #define COPS_OPQ 4 /* Opaque */
858 #define COPS_I64 10 /* Integer64 */
859 #define COPS_U64 11 /* Uinteger64 */
861 /* COPS PR Types */
863 #define COPS_NULL 0
864 #define COPS_INTEGER 1 /* l */
865 #define COPS_OCTETSTR 2 /* c */
866 #define COPS_OBJECTID 3 /* ul */
867 #define COPS_IPADDR 4 /* uc */
868 #define COPS_UNSIGNED32 5 /* ul */
869 #define COPS_TIMETICKS 7 /* ul */
870 #define COPS_OPAQUE 8 /* c */
871 #define COPS_INTEGER64 10 /* ll */
872 #define COPS_UNSIGNED64 11 /* ull */
874 typedef struct _COPS_CNV COPS_CNV;
876 struct _COPS_CNV
878 guint ber_class;
879 guint tag;
880 gint syntax;
881 const gchar *name;
882 int* hfidp;
885 static const true_false_string tfs_upstream_downstream = { "Upstream", "Downstream" };
887 static COPS_CNV CopsCnv [] =
889 {BER_CLASS_UNI, BER_UNI_TAG_NULL, COPS_NULL, "NULL" , &hf_cops_epd_null},
890 {BER_CLASS_UNI, BER_UNI_TAG_INTEGER, COPS_INTEGER, "INTEGER", &hf_cops_epd_int},
891 {BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, COPS_OCTETSTR, "OCTET STRING", &hf_cops_epd_octets},
892 {BER_CLASS_UNI, BER_UNI_TAG_OID, COPS_OBJECTID, "OBJECTID", &hf_cops_epd_oid},
893 {BER_CLASS_APP, COPS_IPA, COPS_IPADDR, "IPADDR", &hf_cops_epd_ipv4},
894 {BER_CLASS_APP, COPS_U32, COPS_UNSIGNED32,"UNSIGNED32", &hf_cops_epd_u32},
895 {BER_CLASS_APP, COPS_TIT, COPS_TIMETICKS, "TIMETICKS", &hf_cops_epd_ticks},
896 {BER_CLASS_APP, COPS_OPQ, COPS_OPAQUE, "OPAQUE", &hf_cops_epd_opaque},
897 {BER_CLASS_APP, COPS_I64, COPS_INTEGER64, "INTEGER64", &hf_cops_epd_i64},
898 {BER_CLASS_APP, COPS_U64, COPS_UNSIGNED64, "UNSIGNED64", &hf_cops_epd_u64},
899 {BER_CLASS_ANY, 0, -1, NULL, NULL}
902 static int cops_tag_cls2syntax ( guint tag, guint cls ) {
903 COPS_CNV *cnv;
906 cnv = CopsCnv;
907 while (cnv->syntax != -1)
909 if (cnv->tag == tag && cnv->ber_class == cls)
911 return *(cnv->hfidp);
913 cnv++;
915 return hf_cops_epd_unknown;
918 static guint
919 get_cops_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
922 * Get the length of the COPS message.
924 return tvb_get_ntohl(tvb, offset + 4);
927 static int
928 dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
930 guint8 op_code;
931 guint16 client_type;
932 int object_len;
933 proto_item *ti, *tv;
934 proto_tree *cops_tree, *ver_flags_tree;
935 guint32 msg_len;
936 guint32 offset = 0;
937 guint8 ver_flags;
938 gint garbage;
939 guint32 handle_value = 0;
941 /* variables for Request/Response tracking */
942 guint i;
943 gboolean is_solicited, is_request, is_response;
944 conversation_t *conversation;
945 cops_conv_info_t *cops_conv_info;
946 cops_call_t *cops_call;
947 GPtrArray* pdus_array;
948 nstime_t delta;
950 col_set_str(pinfo->cinfo, COL_PROTOCOL, "COPS");
951 col_clear(pinfo->cinfo, COL_INFO);
953 op_code = tvb_get_guint8(tvb, 1);
954 col_add_fstr(pinfo->cinfo, COL_INFO, "COPS %s",
955 val_to_str_const(op_code, cops_op_code_vals, "Unknown Op Code"));
957 /* Currently used by PacketCable */
958 client_type = tvb_get_ntohs(tvb, 2);
960 ti = proto_tree_add_item(tree, proto_cops, tvb, offset, -1, ENC_NA);
961 cops_tree = proto_item_add_subtree(ti, ett_cops);
963 /* Version and flags share the same byte, put them in a subtree */
964 ver_flags = tvb_get_guint8(tvb, offset);
965 is_solicited = (lo_nibble(ver_flags) == 0x01);
966 tv = proto_tree_add_uint_format(cops_tree, hf_cops_ver_flags, tvb, offset, 1,
967 ver_flags, "Version: %u, Flags: %s",
968 hi_nibble(ver_flags),
969 val_to_str_const(lo_nibble(ver_flags), cops_flags_vals, "Unknown"));
970 ver_flags_tree = proto_item_add_subtree(tv, ett_cops_ver_flags);
971 proto_tree_add_uint(ver_flags_tree, hf_cops_version, tvb, offset, 1, ver_flags);
972 proto_tree_add_uint(ver_flags_tree, hf_cops_flags, tvb, offset, 1, ver_flags);
973 offset++;
975 proto_tree_add_item(cops_tree, hf_cops_op_code, tvb, offset, 1, ENC_BIG_ENDIAN);
976 offset ++;
977 proto_tree_add_item(cops_tree, hf_cops_client_type, tvb, offset, 2, ENC_BIG_ENDIAN);
978 offset += 2;
980 msg_len = tvb_get_ntohl(tvb, offset);
981 proto_tree_add_uint(cops_tree, hf_cops_msg_len, tvb, offset, 4, msg_len);
982 offset += 4;
984 while (tvb_reported_length_remaining(tvb, offset) >= COPS_OBJECT_HDR_SIZE) {
985 object_len = dissect_cops_object(tvb, pinfo, op_code, offset, cops_tree, client_type, &handle_value);
986 if (object_len < 0)
987 return offset;
988 offset += object_len;
991 garbage = tvb_length_remaining(tvb, offset);
992 if (garbage > 0) {
993 proto_tree_add_expert_format(tree, pinfo, &ei_cops_trailing_garbage, tvb, offset, garbage, "Trailing garbage: %d byte%s", garbage, plurality(garbage, "", "s"));
996 /* Start request/response matching */
998 /* handle is 0(or not present), and op_code doesn't allow null handle, return */
999 /* TODO, add expert info for this abnormal */
1000 if (handle_value == 0 &&
1001 ( op_code != COPS_MSG_SSQ &&
1002 op_code != COPS_MSG_OPN &&
1003 op_code != COPS_MSG_CAT &&
1004 op_code != COPS_MSG_CC &&
1005 op_code != COPS_MSG_KA &&
1006 op_code != COPS_MSG_SSC) ) {
1007 return offset;
1011 is_request =
1012 op_code == COPS_MSG_REQ || /* expects DEC */
1013 (op_code == COPS_MSG_DEC && !is_solicited) || /* expects RPT|DRQ */
1014 /* COPS_MSG_RPT doesn't expect response */
1015 /* COPS_MSG_DRQ doesn't expect response */
1016 op_code == COPS_MSG_SSQ || /* expects RPT|DRQ|SSC */
1017 op_code == COPS_MSG_OPN || /* expects CAT|CC */
1018 /* COPS_MSG_CAT doesn't expect response */
1019 /* COPS_MSG_CC doesn't expect response */
1020 (op_code == COPS_MSG_KA && !is_solicited); /* expects KA from PDP, always initialized by PEP */
1021 /* COPS_MSG_SSC doesn't expect response */
1023 is_response =
1024 /* COPS_MSG_REQ request only */
1025 (op_code == COPS_MSG_DEC && is_solicited) || /* response only if reply REQ */
1026 (op_code == COPS_MSG_RPT && is_solicited) || /* response only if reply DEC/SSQ */
1027 (op_code == COPS_MSG_DRQ && is_solicited) || /* response only if reply DEC/SSQ */
1028 /* COPS_MSG_SSQ request only */
1029 /* COPS_MSG_OPN request only */
1030 op_code == COPS_MSG_CAT || /* response for OPN */
1031 (op_code == COPS_MSG_CC && is_solicited) || /* response for OPN */
1032 (op_code == COPS_MSG_KA && is_solicited) || /* response for KA from PEP */
1033 op_code == COPS_MSG_SSC; /* response for SSQ */
1035 conversation = find_or_create_conversation(pinfo);
1036 cops_conv_info = (cops_conv_info_t *)conversation_get_proto_data(conversation, proto_cops);
1037 if (!cops_conv_info) {
1038 cops_conv_info = (cops_conv_info_t *)wmem_alloc(wmem_file_scope(), sizeof(cops_conv_info_t));
1040 cops_conv_info->pdus_tree = wmem_tree_new(wmem_file_scope());
1041 conversation_add_proto_data(conversation, proto_cops, cops_conv_info);
1044 if ( is_request ||
1045 (op_code == COPS_MSG_DEC && is_solicited) ) { /* DEC as response for REQ is considered as request, because it expects RPT|DRQ */
1047 pdus_array = (GPtrArray *)wmem_tree_lookup32(cops_conv_info->pdus_tree, handle_value);
1048 if (pdus_array == NULL) { /* This is the first request we've seen with this handle_value */
1049 pdus_array = g_ptr_array_new();
1050 wmem_tree_insert32(cops_conv_info->pdus_tree, handle_value, pdus_array);
1053 if (!pinfo->fd->flags.visited) {
1054 cops_call = wmem_new(wmem_file_scope(), cops_call_t);
1055 cops_call->op_code = op_code;
1056 cops_call->solicited = is_solicited;
1057 cops_call->req_num = PINFO_FD_NUM(pinfo);
1058 cops_call->rsp_num = 0;
1059 cops_call->req_time = pinfo->fd->abs_ts;
1060 g_ptr_array_add(pdus_array, cops_call);
1062 else {
1063 for (i=0; i < pdus_array->len; i++) {
1064 cops_call = (cops_call_t*)g_ptr_array_index(pdus_array, i);
1065 if ( cops_call->req_num == PINFO_FD_NUM(pinfo)
1066 && cops_call->rsp_num != 0) {
1067 ti = proto_tree_add_uint_format(cops_tree, hf_cops_response_in, tvb, 0, 0, cops_call->rsp_num,
1068 "Response to this request is in frame %u", cops_call->rsp_num);
1069 PROTO_ITEM_SET_GENERATED(ti);
1075 if (is_response) {
1076 pdus_array = (GPtrArray *)wmem_tree_lookup32(cops_conv_info->pdus_tree, handle_value);
1078 if (pdus_array == NULL) /* There's no request with this handle value */
1079 return offset;
1081 if (!pinfo->fd->flags.visited) {
1082 for (i=0; i < pdus_array->len; i++) {
1083 cops_call = (cops_call_t*)g_ptr_array_index(pdus_array, i);
1085 if (nstime_cmp(&pinfo->fd->abs_ts, &cops_call->req_time) <= 0 || cops_call->rsp_num != 0)
1086 continue;
1088 if (
1089 ( (cops_call->op_code == COPS_MSG_REQ) &&
1090 (op_code == COPS_MSG_DEC && is_solicited) ) ||
1091 ( (cops_call->op_code == COPS_MSG_DEC) &&
1092 ( (op_code == COPS_MSG_RPT && is_solicited) ||
1093 (op_code == COPS_MSG_DRQ && is_solicited) ) ) ||
1094 ( (cops_call->op_code == COPS_MSG_SSQ) &&
1095 ( (op_code == COPS_MSG_RPT && is_solicited) ||
1096 (op_code == COPS_MSG_DRQ && is_solicited) ||
1097 (op_code == COPS_MSG_SSC) ) ) ||
1098 ( (cops_call->op_code == COPS_MSG_OPN) &&
1099 (op_code == COPS_MSG_CAT ||
1100 op_code == COPS_MSG_CC) ) ||
1101 ( (cops_call->op_code == COPS_MSG_KA && !(cops_call->solicited)) &&
1102 (op_code == COPS_MSG_KA && is_solicited) ) ) {
1103 cops_call->rsp_num = PINFO_FD_NUM(pinfo);
1104 break;
1108 else {
1109 for (i=0; i < pdus_array->len; i++) {
1110 cops_call = (cops_call_t*)g_ptr_array_index(pdus_array, i);
1111 if ( cops_call->rsp_num == PINFO_FD_NUM(pinfo) ) {
1112 ti = proto_tree_add_uint_format(cops_tree, hf_cops_response_to, tvb, 0, 0, cops_call->req_num,
1113 "Response to a request in frame %u", cops_call->req_num);
1114 PROTO_ITEM_SET_GENERATED(ti);
1116 nstime_delta(&delta, &pinfo->fd->abs_ts, &cops_call->req_time);
1117 ti = proto_tree_add_time(cops_tree, hf_cops_response_time, tvb, 0, 0, &delta);
1118 PROTO_ITEM_SET_GENERATED(ti);
1120 break;
1126 return tvb_length(tvb);
1129 /* Code to actually dissect the packets */
1130 static int
1131 dissect_cops(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1133 tcp_dissect_pdus(tvb, pinfo, tree, cops_desegment, 8,
1134 get_cops_pdu_len, dissect_cops_pdu, data);
1135 return tvb_length(tvb);
1138 static const char *cops_c_type_to_str(guint8 c_num, guint8 c_type)
1140 switch (c_num) {
1141 case COPS_OBJ_HANDLE:
1142 if (c_type == 1)
1143 return "Client Handle";
1144 break;
1145 case COPS_OBJ_IN_INT:
1146 case COPS_OBJ_OUT_INT:
1147 if (c_type == 1)
1148 return "IPv4 Address + Interface";
1149 else if (c_type == 2)
1150 return "IPv6 Address + Interface";
1151 break;
1152 case COPS_OBJ_DECISION:
1153 case COPS_OBJ_LPDPDECISION:
1154 if (c_type == 1)
1155 return "Decision Flags (Mandatory)";
1156 else if (c_type == 2)
1157 return "Stateless Data";
1158 else if (c_type == 3)
1159 return "Replacement Data";
1160 else if (c_type == 4)
1161 return "Client Specific Decision Data";
1162 else if (c_type == 5)
1163 return "Named Decision Data";
1164 break;
1165 case COPS_OBJ_CLIENTSI:
1166 if (c_type == 1)
1167 return "Signaled ClientSI";
1168 else if (c_type == 2)
1169 return "Named ClientSI";
1170 break;
1171 case COPS_OBJ_KATIMER:
1172 if (c_type == 1)
1173 return "Keep-alive timer value";
1174 break;
1175 case COPS_OBJ_PDPREDIRADDR:
1176 case COPS_OBJ_LASTPDPADDR:
1177 if (c_type == 1)
1178 return "IPv4 Address + TCP Port";
1179 else if (c_type == 2)
1180 return "IPv6 Address + TCP Port";
1181 break;
1182 case COPS_OBJ_ACCTTIMER:
1183 if (c_type == 1)
1184 return "Accounting timer value";
1185 break;
1186 case COPS_OBJ_INTEGRITY:
1187 if (c_type == 1)
1188 return "HMAC digest";
1189 break;
1192 return "";
1195 static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, guint8 op_code, guint32 offset, proto_tree *tree, guint16 client_type, guint32* handle_value)
1197 int object_len, contents_len;
1198 guint8 c_num, c_type;
1199 proto_item *ti;
1200 proto_tree *obj_tree;
1201 const char *type_str;
1203 object_len = tvb_get_ntohs(tvb, offset);
1204 if (object_len < COPS_OBJECT_HDR_SIZE) {
1205 /* Bogus! */
1206 ti = proto_tree_add_uint(tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1207 expert_add_info_format(pinfo, ti, &ei_cops_bad_cops_object_length,
1208 "Bad COPS object length: %u, should be at least %u",
1209 object_len, COPS_OBJECT_HDR_SIZE);
1210 return -1;
1212 c_num = tvb_get_guint8(tvb, offset + 2);
1213 c_type = tvb_get_guint8(tvb, offset + 3);
1215 ti = proto_tree_add_uint_format(tree, hf_cops_obj_c_num, tvb, offset, object_len, c_num,
1216 "%s: %s", val_to_str_const(c_num, cops_c_num_vals, "Unknown"),
1217 cops_c_type_to_str(c_num, c_type));
1218 obj_tree = proto_item_add_subtree(ti, ett_cops_obj);
1220 proto_tree_add_uint(obj_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1221 offset += 2;
1223 proto_tree_add_uint(obj_tree, hf_cops_obj_c_num, tvb, offset, 1, c_num);
1224 offset++;
1226 type_str = cops_c_type_to_str(c_num, c_type);
1227 proto_tree_add_uint_format_value(obj_tree, hf_cops_obj_c_type, tvb, offset, 1, c_type,
1228 "%s%s%u%s",
1229 type_str,
1230 strlen(type_str) ? " (" : "",
1231 c_type,
1232 strlen(type_str) ? ")" : "");
1233 offset++;
1235 contents_len = object_len - COPS_OBJECT_HDR_SIZE;
1236 dissect_cops_object_data(tvb, pinfo, offset, obj_tree, op_code, client_type, c_num, c_type, contents_len, handle_value);
1238 /* Pad to 32bit boundary */
1239 if (object_len % sizeof (guint32))
1240 object_len += ((int)sizeof (guint32) - object_len % (int)sizeof (guint32));
1242 return object_len;
1245 static void dissect_cops_pr_objects(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, proto_tree *tree, int pr_len,
1246 oid_info_t** oid_info_p, guint32** pprid_subids_p, guint* pprid_subids_len_p)
1248 int object_len, contents_len;
1249 guint8 s_num, s_type;
1250 const char *type_str;
1251 int ret;
1252 proto_tree *cops_pr_tree, *obj_tree;
1253 proto_item *ti;
1255 cops_pr_tree = proto_item_add_subtree(tree, ett_cops_pr_obj);
1257 while (pr_len >= COPS_OBJECT_HDR_SIZE) {
1258 object_len = tvb_get_ntohs(tvb, offset);
1259 if (object_len < COPS_OBJECT_HDR_SIZE) {
1260 /* Bogus! */
1261 ti = proto_tree_add_uint(cops_pr_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1262 expert_add_info_format(pinfo, ti, &ei_cops_bad_cops_pr_object_length,
1263 "Bad COPS-PR object length: %u, should be at least %u",
1264 object_len, COPS_OBJECT_HDR_SIZE);
1265 return;
1267 s_num = tvb_get_guint8(tvb, offset + 2);
1269 ti = proto_tree_add_uint_format(cops_pr_tree, hf_cops_obj_s_num, tvb, offset, object_len, s_num,
1270 "%s", val_to_str_const(s_num, cops_s_num_vals, "Unknown"));
1271 obj_tree = proto_item_add_subtree(ti, ett_cops_pr_obj);
1273 proto_tree_add_uint(obj_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1274 offset += 2;
1275 pr_len -= 2;
1277 proto_tree_add_uint(obj_tree, hf_cops_obj_s_num, tvb, offset, 1, s_num);
1278 offset++;
1279 pr_len--;
1281 s_type = tvb_get_guint8(tvb, offset);
1282 type_str = val_to_str_const(s_type, cops_s_type_vals, "Unknown");
1283 proto_tree_add_uint_format_value(obj_tree, hf_cops_obj_s_type, tvb, offset, 1, s_type,
1284 "%s%s%u%s",
1285 type_str,
1286 strlen(type_str) ? " (" : "",
1287 s_type,
1288 strlen(type_str) ? ")" : "");
1289 offset++;
1290 pr_len--;
1292 contents_len = object_len - COPS_OBJECT_HDR_SIZE;
1293 ret = dissect_cops_pr_object_data(tvb, pinfo, offset, obj_tree, s_num, s_type, contents_len,
1294 oid_info_p, pprid_subids_p, pprid_subids_len_p);
1295 if (ret < 0)
1296 break;
1298 /* Pad to 32bit boundary */
1299 if (object_len % sizeof (guint32))
1300 object_len += ((int)sizeof (guint32) - object_len % (int)sizeof (guint32));
1302 pr_len -= object_len - COPS_OBJECT_HDR_SIZE;
1303 offset += object_len - COPS_OBJECT_HDR_SIZE;
1307 static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, proto_tree *tree,
1308 guint8 op_code, guint16 client_type, guint8 c_num, guint8 c_type, int len, guint32* handle_value)
1310 proto_item *ti;
1311 proto_tree *r_type_tree, *itf_tree, *reason_tree, *dec_tree, *error_tree, *clientsi_tree, *pdp_tree;
1312 guint16 r_type, m_type, reason, reason_sub, cmd_code, cmd_flags, error, error_sub,
1313 tcp_port, katimer, accttimer;
1314 guint32 ipv4addr, ifindex;
1315 struct e_in6_addr ipv6addr;
1316 oid_info_t* oid_info = NULL;
1317 guint32* pprid_subids = NULL;
1318 guint pprid_subids_len = 0;
1320 switch (c_num) {
1321 case COPS_OBJ_HANDLE: /* handle is a variable-length field, however 32bit seems enough for most of the applications */
1322 if (len >= 4) {
1323 offset += (len-4); /* for handle longer than 32bit, only take lowest 32 bits as handle */
1324 *handle_value = tvb_get_ntohl(tvb, offset);
1325 proto_tree_add_item(tree, hf_cops_handle, tvb, offset, 4, ENC_BIG_ENDIAN);
1327 break;
1328 case COPS_OBJ_CONTEXT:
1329 r_type = tvb_get_ntohs(tvb, offset);
1330 m_type = tvb_get_ntohs(tvb, offset + 2);
1331 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: R-Type: %s, M-Type: %u",
1332 val_to_str_const(r_type, cops_r_type_vals, "Unknown"),
1333 m_type);
1335 r_type_tree = proto_item_add_subtree(ti, ett_cops_r_type_flags);
1336 proto_tree_add_uint(r_type_tree, hf_cops_r_type_flags, tvb, offset, 2, r_type);
1337 offset += 2;
1338 proto_tree_add_uint(r_type_tree, hf_cops_m_type_flags, tvb, offset, 2, m_type);
1340 break;
1341 case COPS_OBJ_IN_INT:
1342 case COPS_OBJ_OUT_INT:
1343 if (c_type == 1) { /* IPv4 */
1344 ipv4addr = tvb_get_ipv4(tvb, offset);
1345 ifindex = tvb_get_ntohl(tvb, offset + 4);
1346 ti = proto_tree_add_text(tree, tvb, offset, 8, "Contents: IPv4 address %s, ifIndex: %u",
1347 ip_to_str((guint8 *)&ipv4addr), ifindex);
1348 itf_tree = proto_item_add_subtree(ti, ett_cops_itf);
1349 proto_tree_add_ipv4(itf_tree,
1350 (c_num == COPS_OBJ_IN_INT) ? hf_cops_in_int_ipv4 : hf_cops_out_int_ipv4,
1351 tvb, offset, 4, ipv4addr);
1352 offset += 4;
1353 } else if (c_type == 2) { /* IPv6 */
1354 tvb_get_ipv6(tvb, offset, &ipv6addr);
1355 ifindex = tvb_get_ntohl(tvb, offset + (int)sizeof ipv6addr);
1356 ti = proto_tree_add_text(tree, tvb, offset, 20, "Contents: IPv6 address %s, ifIndex: %u",
1357 ip6_to_str(&ipv6addr), ifindex);
1358 itf_tree = proto_item_add_subtree(ti, ett_cops_itf);
1359 proto_tree_add_ipv6(itf_tree,
1360 (c_num == COPS_OBJ_IN_INT) ? hf_cops_in_int_ipv6 : hf_cops_out_int_ipv6,
1361 tvb, offset, 16, (guint8 *)&ipv6addr);
1362 offset += 16;
1363 } else {
1364 break;
1366 proto_tree_add_uint(itf_tree, hf_cops_int_ifindex, tvb, offset, 4, ifindex);
1368 break;
1369 case COPS_OBJ_REASON:
1370 reason = tvb_get_ntohs(tvb, offset);
1371 reason_sub = tvb_get_ntohs(tvb, offset + 2);
1372 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Reason-Code: %s, Reason Sub-code: 0x%04x",
1373 val_to_str_const(reason, cops_reason_vals, "<Unknown value>"), reason_sub);
1374 reason_tree = proto_item_add_subtree(ti, ett_cops_reason);
1375 proto_tree_add_uint(reason_tree, hf_cops_reason, tvb, offset, 2, reason);
1376 offset += 2;
1377 if (reason == 13) { /* RFC 2748 2.2.5 */
1378 proto_tree_add_text(reason_tree, tvb, offset, 2, "Reason Sub-code: "
1379 "Unknown object's C-Num %u, C-Type %u",
1380 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
1381 } else
1382 proto_tree_add_uint(reason_tree, hf_cops_reason_sub, tvb, offset, 2, reason_sub);
1384 break;
1385 case COPS_OBJ_DECISION:
1386 case COPS_OBJ_LPDPDECISION:
1387 if (c_type == 1) {
1388 cmd_code = tvb_get_ntohs(tvb, offset);
1389 cmd_flags = tvb_get_ntohs(tvb, offset + 2);
1390 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Command-Code: %s, Flags: %s",
1391 val_to_str_const(cmd_code, cops_dec_cmd_code_vals, "<Unknown value>"),
1392 val_to_str_const(cmd_flags, cops_dec_cmd_flag_vals, "<Unknown flag>"));
1393 dec_tree = proto_item_add_subtree(ti, ett_cops_decision);
1394 proto_tree_add_uint(dec_tree, hf_cops_dec_cmd_code, tvb, offset, 2, cmd_code);
1395 offset += 2;
1396 proto_tree_add_uint(dec_tree, hf_cops_dec_flags, tvb, offset, 2, cmd_flags);
1397 } else if (c_type == 5) { /*COPS-PR Data*/
1398 ti = proto_tree_add_text(tree, tvb, offset, len, "Contents: %d bytes", len);
1399 dec_tree = proto_item_add_subtree(ti, ett_cops_decision);
1400 dissect_cops_pr_objects(tvb, pinfo, offset, dec_tree, len, &oid_info, &pprid_subids, &pprid_subids_len);
1403 /* PacketCable : Analyze the remaining data if available */
1404 if (client_type == COPS_CLIENT_PC_DQOS && c_type == 4) {
1405 cops_analyze_packetcable_dqos_obj(tvb, pinfo, tree, op_code, offset);
1406 } else if (client_type == COPS_CLIENT_PC_MM && c_type == 4) {
1407 cops_analyze_packetcable_mm_obj(tvb, pinfo, tree, op_code, offset);
1410 break;
1411 case COPS_OBJ_ERROR:
1412 if (c_type != 1)
1413 break;
1415 error = tvb_get_ntohs(tvb, offset);
1416 error_sub = tvb_get_ntohs(tvb, offset + 2);
1417 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1418 val_to_str_const(error, cops_error_vals, "<Unknown value>"), error_sub);
1419 error_tree = proto_item_add_subtree(ti, ett_cops_error);
1420 proto_tree_add_uint(error_tree, hf_cops_error, tvb, offset, 2, error);
1421 offset += 2;
1422 if (error == 13) { /* RFC 2748 2.2.8 */
1423 proto_tree_add_text(error_tree, tvb, offset, 2, "Error Sub-code: "
1424 "Unknown object's C-Num %u, C-Type %u",
1425 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
1426 } else
1427 proto_tree_add_uint(error_tree, hf_cops_error_sub, tvb, offset, 2, error_sub);
1429 break;
1430 case COPS_OBJ_CLIENTSI:
1432 /* For PacketCable */
1433 if (client_type == COPS_CLIENT_PC_DQOS && c_type == 1) {
1434 cops_analyze_packetcable_dqos_obj(tvb, pinfo, tree, op_code, offset);
1435 break;
1436 } else if (client_type == COPS_CLIENT_PC_MM && c_type == 1) {
1437 cops_analyze_packetcable_mm_obj(tvb, pinfo, tree, op_code, offset);
1438 break;
1441 if (c_type != 2) /*Not COPS-PR data*/
1442 break;
1444 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: %d bytes", len);
1445 clientsi_tree = proto_item_add_subtree(ti, ett_cops_clientsi);
1447 dissect_cops_pr_objects(tvb, pinfo, offset, clientsi_tree, len, &oid_info, &pprid_subids, &pprid_subids_len);
1449 break;
1450 case COPS_OBJ_KATIMER:
1451 if (c_type != 1)
1452 break;
1454 katimer = tvb_get_ntohs(tvb, offset + 2);
1455 if (katimer == 0) {
1456 proto_tree_add_uint_format_value(tree, hf_cops_katimer, tvb, offset + 2, 2, katimer, "0 (infinity)");
1457 } else {
1458 proto_tree_add_item(tree, hf_cops_katimer, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1460 break;
1461 case COPS_OBJ_PEPID:
1462 if (c_type != 1)
1463 break;
1465 if (tvb_strnlen(tvb, offset, len) == -1) {
1466 ti = proto_tree_add_item(tree, hf_cops_pepid, tvb, offset, len, ENC_ASCII|ENC_NA);
1467 expert_add_info(pinfo, ti, &ei_cops_pepid_not_null);
1469 else
1470 proto_tree_add_item(tree, hf_cops_pepid, tvb, offset,
1471 tvb_strnlen(tvb, offset, len) + 1, ENC_ASCII|ENC_NA);
1473 break;
1474 case COPS_OBJ_REPORT_TYPE:
1475 if (c_type != 1)
1476 break;
1478 proto_tree_add_item(tree, hf_cops_report_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1480 break;
1481 case COPS_OBJ_PDPREDIRADDR:
1482 case COPS_OBJ_LASTPDPADDR:
1483 if (c_type == 1) { /* IPv4 */
1484 ipv4addr = tvb_get_ipv4(tvb, offset);
1485 tcp_port = tvb_get_ntohs(tvb, offset + 4 + 2);
1486 ti = proto_tree_add_text(tree, tvb, offset, 8, "Contents: IPv4 address %s, TCP Port Number: %u",
1487 ip_to_str((guint8 *)&ipv4addr), tcp_port);
1488 pdp_tree = proto_item_add_subtree(ti, ett_cops_pdp);
1489 proto_tree_add_ipv4(pdp_tree,
1490 (c_num == COPS_OBJ_PDPREDIRADDR) ? hf_cops_pdprediraddr_ipv4 : hf_cops_lastpdpaddr_ipv4,
1491 tvb, offset, 4, ipv4addr);
1492 offset += 4;
1493 } else if (c_type == 2) { /* IPv6 */
1494 tvb_get_ipv6(tvb, offset, &ipv6addr);
1495 tcp_port = tvb_get_ntohs(tvb, offset + (int)sizeof ipv6addr + 2);
1496 ti = proto_tree_add_text(tree, tvb, offset, 20, "Contents: IPv6 address %s, TCP Port Number: %u",
1497 ip6_to_str(&ipv6addr), tcp_port);
1498 pdp_tree = proto_item_add_subtree(ti, ett_cops_pdp);
1499 proto_tree_add_ipv6(pdp_tree,
1500 (c_num == COPS_OBJ_PDPREDIRADDR) ? hf_cops_pdprediraddr_ipv6 : hf_cops_lastpdpaddr_ipv6,
1501 tvb, offset, 16, (guint8 *)&ipv6addr);
1502 offset += 16;
1503 } else {
1504 break;
1506 offset += 2;
1507 proto_tree_add_uint(pdp_tree, hf_cops_pdp_tcp_port, tvb, offset, 2, tcp_port);
1509 break;
1510 case COPS_OBJ_ACCTTIMER:
1511 if (c_type != 1)
1512 break;
1514 accttimer = tvb_get_ntohs(tvb, offset + 2);
1515 if (accttimer == 0) {
1516 proto_tree_add_uint_format_value(tree, hf_cops_accttimer, tvb, offset + 2, 2, accttimer,
1517 "0 (there SHOULD be no unsolicited accounting updates)");
1518 } else {
1519 proto_tree_add_item(tree, hf_cops_accttimer, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1521 break;
1522 case COPS_OBJ_INTEGRITY:
1523 if (c_type != 1)
1524 break; /* Not HMAC digest */
1526 proto_tree_add_item(tree, hf_cops_key_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1527 proto_tree_add_item(tree, hf_cops_seq_num, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1528 proto_tree_add_text(tree, tvb, offset + 8 , len - 8, "Contents: Keyed Message Digest");
1530 break;
1531 default:
1532 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);
1533 break;
1537 static guint redecode_oid(guint32* pprid_subids, guint pprid_subids_len, guint8* encoded_subids, guint encoded_len, guint32** subids_p) {
1538 guint i;
1539 guint n = 0;
1540 guint32 subid = 0;
1541 guint32* subids;
1542 guint32* subid_overflow;
1544 for (i=0; i<encoded_len; i++) { if (! (encoded_subids[i] & 0x80 )) n++; }
1546 *subids_p = subids = (guint32 *)wmem_alloc(wmem_packet_scope(), sizeof(guint32)*(n+pprid_subids_len));
1547 subid_overflow = subids+n+pprid_subids_len;
1548 for (i=0;i<pprid_subids_len;i++) subids[i] = pprid_subids[i];
1550 subids += pprid_subids_len;
1553 for (i=0; i<encoded_len; i++){
1554 guint8 byte = encoded_subids[i];
1556 subid <<= 7;
1557 subid |= byte & 0x7F;
1559 if (byte & 0x80) {
1560 continue;
1563 DISSECTOR_ASSERT(subids < subid_overflow);
1564 *subids++ = subid;
1565 subid = 0;
1568 return pprid_subids_len+n;
1572 static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, proto_tree *tree,
1573 guint8 s_num, guint8 s_type, int len,
1574 oid_info_t** oid_info_p, guint32** pprid_subids, guint* pprid_subids_len) {
1575 proto_item *ti;
1576 proto_tree *asn_tree, *gperror_tree, *cperror_tree;
1577 guint16 gperror=0, gperror_sub=0, cperror=0, cperror_sub=0;
1578 asn1_ctx_t actx;
1580 memset(&actx,0,sizeof(actx));
1581 actx.pinfo = pinfo;
1583 switch (s_num){
1584 case COPS_OBJ_PPRID: {
1585 tvbuff_t* oid_tvb = NULL;
1587 if (s_type != 1) /* Not Prefix Provisioning Instance Identifier (PPRID) */
1588 break;
1589 /* Never tested this branch */
1590 ti = proto_tree_add_text(tree, tvb, offset, len, "Contents:");
1591 asn_tree = proto_item_add_subtree(ti, ett_cops_asn1);
1593 dissect_ber_object_identifier(FALSE, &actx, asn_tree, tvb, offset, hf_cops_pprid_oid, &oid_tvb);
1595 if (oid_tvb) {
1596 gint encoid_len;
1597 guint8* encoid;
1599 encoid_len = tvb_length_remaining(oid_tvb,0);
1600 if (encoid_len > 0) {
1601 encoid = (guint8*)tvb_memdup(wmem_packet_scope(),oid_tvb,0,encoid_len);
1602 (*pprid_subids_len) = oid_encoded2subid(encoid, encoid_len, pprid_subids);
1605 break;
1607 case COPS_OBJ_PRID: {
1608 guint32* subids;
1609 guint subids_len;
1610 guint matched;
1611 guint left;
1612 gint8 ber_class;
1613 gboolean ber_pc;
1614 gint32 ber_tag;
1615 guint encoid_len;
1616 guint8* encoid;
1617 oid_info_t* oid_info;
1619 if (s_type != 1) break; /* Not Provisioning Instance Identifier (PRID) */
1621 ti=proto_tree_add_text(tree, tvb, offset, len, "Contents:");
1622 asn_tree = proto_item_add_subtree(ti, ett_cops_asn1);
1624 offset = get_ber_identifier(tvb, offset, &ber_class, &ber_pc, &ber_tag);
1625 offset = get_ber_length(tvb, offset, &encoid_len, NULL);
1627 /* TODO: check pc, class and tag */
1629 encoid = (guint8*)tvb_memdup(wmem_packet_scope(),tvb,offset,encoid_len);
1631 if (*pprid_subids) {
1632 /* Never tested this branch */
1633 subids_len = redecode_oid(*pprid_subids, *pprid_subids_len, encoid, encoid_len, &subids);
1634 encoid_len = oid_subid2encoded(subids_len, subids, &encoid);
1635 } else {
1636 subids_len = oid_encoded2subid(encoid, encoid_len, &subids);
1639 proto_tree_add_oid(asn_tree,hf_cops_prid_oid,tvb,offset,encoid_len,encoid);
1641 oid_info = oid_get(subids_len, subids, &matched, &left);
1644 TODO: from RFC 3159 find-out how the values are mapped;
1645 when instead of an oid for an xxEntry
1646 we have one describing a scalar or something else;
1647 what's below works in most cases but is not complete.
1649 if (left <= 1 && oid_info->kind == OID_KIND_ROW) {
1650 *oid_info_p = oid_info;
1651 } else {
1652 *oid_info_p = NULL;
1655 break;
1657 case COPS_OBJ_EPD: {
1658 oid_info_t* oid_info;
1659 guint end_offset = offset + len;
1661 if (s_type != 1) break;/* Not Encoded Provisioning Instance Data (EPD) */
1663 ti = proto_tree_add_text(tree, tvb, offset, len, "Contents:");
1664 asn_tree = proto_item_add_subtree(ti, ett_cops_asn1);
1667 * XXX: LAZYNESS WARNING:
1668 * We are assuming that for the first element in the sequence
1669 * that describes an entry subid==1, and, that the subsequent elements
1670 * use ++subid; This is true for all IETF's PIBs (and good sense
1671 * indicates it should be this way) but AFAIK there's nothing in
1672 * SMIv2 that imposes this restriction. -- a lazy lego
1675 if(*oid_info_p) {
1676 if ((*oid_info_p)->kind == OID_KIND_ROW) {
1677 oid_info = (oid_info_t *)wmem_tree_lookup32((*oid_info_p)->children,1);
1678 } else {
1679 oid_info = NULL;
1681 } else {
1682 oid_info = NULL;
1686 while(offset < end_offset) {
1687 gint8 ber_class;
1688 gboolean ber_pc;
1689 gint32 ber_tag;
1690 guint32 ber_length;
1691 gboolean ber_ind;
1692 int hfid;
1694 offset = get_ber_identifier(tvb, offset, &ber_class, &ber_pc, &ber_tag);
1695 offset = get_ber_length(tvb, offset, &ber_length, &ber_ind);
1697 if (oid_info) {
1699 * XXX: LAZYNESS WARNING:
1700 * We are assuming that the value of the sequenced item is of
1701 * the right class, the right type and the right length.
1702 * We should check that to avoid throwing a Malformed packet and
1703 * keep dissecting.
1704 * We should verify the class and the tag match what we expect as well,
1705 * but COPS and SNMP use different tags (&#@$!) so the typedata in oid_info_t
1706 * does not work here.
1707 * -- a lazy lego
1709 hfid = oid_info->value_hfid;
1710 oid_info = (oid_info_t *)wmem_tree_lookup32((*oid_info_p)->children,oid_info->subid+1);
1711 } else
1712 hfid = cops_tag_cls2syntax( ber_tag, ber_class );
1713 switch (proto_registrar_get_ftype(hfid)) {
1715 case FT_INT8:
1716 case FT_INT16:
1717 case FT_INT24:
1718 case FT_INT32:
1719 case FT_INT64:
1720 case FT_UINT8:
1721 case FT_UINT16:
1722 case FT_UINT24:
1723 case FT_UINT32:
1724 case FT_UINT64:
1725 case FT_BOOLEAN:
1726 case FT_FLOAT:
1727 case FT_DOUBLE:
1728 case FT_IPv4:
1729 proto_tree_add_item(asn_tree,hfid,tvb,offset,ber_length,ENC_BIG_ENDIAN);
1730 break;
1732 case FT_STRING:
1733 proto_tree_add_item(asn_tree,hfid,tvb,offset,ber_length,ENC_ASCII|ENC_NA);
1734 break;
1736 default:
1737 proto_tree_add_item(asn_tree,hfid,tvb,offset,ber_length,ENC_NA);
1738 break;
1741 offset += ber_length;
1744 (*oid_info_p) = NULL;
1745 break;
1747 case COPS_OBJ_ERRPRID: {
1748 if (s_type != 1) break; /*Not Error Provisioning Instance Identifier (ErrorPRID)*/
1750 ti = proto_tree_add_text(tree, tvb, offset, len, "Contents:");
1751 asn_tree = proto_item_add_subtree(ti, ett_cops_asn1);
1753 dissect_ber_object_identifier(FALSE, &actx, asn_tree, tvb, offset, hf_cops_errprid_oid, NULL);
1755 break;
1757 case COPS_OBJ_GPERR:
1758 if (s_type != 1) /* Not Global Provisioning Error Object (GPERR) */
1759 break;
1761 gperror = tvb_get_ntohs(tvb, offset);
1762 gperror_sub = tvb_get_ntohs(tvb, offset + 2);
1763 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1764 val_to_str_const(gperror, cops_gperror_vals, "<Unknown value>"), gperror_sub);
1765 gperror_tree = proto_item_add_subtree(ti, ett_cops_gperror);
1766 proto_tree_add_uint(gperror_tree, hf_cops_gperror, tvb, offset, 2, gperror);
1767 offset += 2;
1768 if (gperror == 13) { /* RFC 3084 4.4 */
1769 proto_tree_add_text(gperror_tree, tvb, offset, 2, "Error Sub-code: "
1770 "Unknown object's C-Num %u, C-Type %u",
1771 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
1772 } else
1773 proto_tree_add_uint(gperror_tree, hf_cops_gperror_sub, tvb, offset, 2, gperror_sub);
1775 break;
1776 case COPS_OBJ_CPERR:
1777 if (s_type != 1) /*Not PRC Class Provisioning Error Object (CPERR) */
1778 break;
1780 cperror = tvb_get_ntohs(tvb, offset);
1781 cperror_sub = tvb_get_ntohs(tvb, offset + 2);
1782 ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1783 val_to_str_const(cperror, cops_cperror_vals, "<Unknown value>"), cperror_sub);
1784 cperror_tree = proto_item_add_subtree(ti, ett_cops_cperror);
1785 proto_tree_add_uint(cperror_tree, hf_cops_cperror, tvb, offset, 2, cperror);
1786 offset += 2;
1787 if (cperror == 13) { /* RFC 3084 4.5 */
1788 proto_tree_add_text(cperror_tree, tvb, offset, 2, "Error Sub-code: "
1789 "Unknown object's S-Num %u, C-Type %u",
1790 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
1791 } else
1792 proto_tree_add_uint(cperror_tree, hf_cops_cperror_sub, tvb, offset, 2, cperror_sub);
1794 break;
1795 default:
1796 proto_tree_add_text(tree, tvb, offset, len, "Contents: %d bytes", len);
1797 break;
1800 return 0;
1804 /* Register the protocol with Wireshark */
1805 void proto_register_cops(void)
1807 /* Setup list of header fields */
1808 static hf_register_info hf[] = {
1809 { &hf_cops_ver_flags,
1810 { "Version and Flags", "cops.ver_flags",
1811 FT_UINT8, BASE_HEX, NULL, 0x0,
1812 "Version and Flags in COPS Common Header", HFILL }
1814 { &hf_cops_version,
1815 { "Version", "cops.version",
1816 FT_UINT8, BASE_DEC, NULL, 0xF0,
1817 "Version in COPS Common Header", HFILL }
1819 { &hf_cops_flags,
1820 { "Flags", "cops.flags",
1821 FT_UINT8, BASE_HEX, VALS(cops_flags_vals), 0x0F,
1822 "Flags in COPS Common Header", HFILL }
1824 { &hf_cops_response_in,
1825 { "Response In", "cops.response_in",
1826 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1827 "The response to this COPS request is in this frame", HFILL }
1829 { &hf_cops_response_to,
1830 { "Request In", "cops.response_to",
1831 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1832 "This is a response to the COPS request in this frame", HFILL }
1834 { &hf_cops_response_time,
1835 { "Response Time", "cops.response_time",
1836 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
1837 "The time between the Call and the Reply", HFILL }
1839 { &hf_cops_op_code,
1840 { "Op Code", "cops.op_code",
1841 FT_UINT8, BASE_DEC, VALS(cops_op_code_vals), 0x0,
1842 "Op Code in COPS Common Header", HFILL }
1844 { &hf_cops_client_type,
1845 { "Client Type", "cops.client_type",
1846 FT_UINT16, BASE_DEC, VALS(cops_client_type_vals), 0x0,
1847 "Client Type in COPS Common Header", HFILL }
1849 { &hf_cops_msg_len,
1850 { "Message Length", "cops.msg_len",
1851 FT_UINT32, BASE_DEC, NULL, 0x0,
1852 "Message Length in COPS Common Header", HFILL }
1854 { &hf_cops_obj_len,
1855 { "Object Length", "cops.obj.len",
1856 FT_UINT32, BASE_DEC, NULL, 0x0,
1857 "Object Length in COPS Object Header", HFILL }
1859 { &hf_cops_obj_c_num,
1860 { "C-Num", "cops.c_num",
1861 FT_UINT8, BASE_DEC, VALS(cops_c_num_vals), 0x0,
1862 "C-Num in COPS Object Header", HFILL }
1864 { &hf_cops_obj_c_type,
1865 { "C-Type", "cops.c_type",
1866 FT_UINT8, BASE_DEC, NULL, 0x0,
1867 "C-Type in COPS Object Header", HFILL }
1870 { &hf_cops_obj_s_num,
1871 { "S-Num", "cops.s_num",
1872 FT_UINT8, BASE_DEC, VALS(cops_s_num_vals), 0x0,
1873 "S-Num in COPS-PR Object Header", HFILL }
1875 { &hf_cops_obj_s_type,
1876 { "S-Type", "cops.s_type",
1877 FT_UINT8, BASE_DEC, NULL, 0x0,
1878 "S-Type in COPS-PR Object Header", HFILL }
1880 { &hf_cops_handle,
1881 { "Handle", "cops.handle",
1882 FT_UINT32, BASE_HEX, NULL, 0x0,
1883 "Handle in COPS Handle Object", HFILL }
1885 { &hf_cops_r_type_flags,
1886 { "R-Type", "cops.context.r_type",
1887 FT_UINT16, BASE_HEX, VALS(cops_r_type_vals), 0xFFFF,
1888 "R-Type in COPS Context Object", HFILL }
1890 { &hf_cops_m_type_flags,
1891 { "M-Type", "cops.context.m_type",
1892 FT_UINT16, BASE_HEX, NULL, 0xFFFF,
1893 "M-Type in COPS Context Object", HFILL }
1895 { &hf_cops_in_int_ipv4,
1896 { "IPv4 address", "cops.in-int.ipv4",
1897 FT_IPv4, BASE_NONE, NULL, 0,
1898 "IPv4 address in COPS IN-Int object", HFILL }
1900 { &hf_cops_in_int_ipv6,
1901 { "IPv6 address", "cops.in-int.ipv6",
1902 FT_IPv6, BASE_NONE, NULL, 0,
1903 "IPv6 address in COPS IN-Int object", HFILL }
1905 { &hf_cops_out_int_ipv4,
1906 { "IPv4 address", "cops.out-int.ipv4",
1907 FT_IPv4, BASE_NONE, NULL, 0,
1908 "IPv4 address in COPS OUT-Int object", HFILL }
1910 { &hf_cops_out_int_ipv6,
1911 { "IPv6 address", "cops.out-int.ipv6",
1912 FT_IPv6, BASE_NONE, NULL, 0,
1913 "IPv6 address in COPS OUT-Int", HFILL }
1915 { &hf_cops_int_ifindex,
1916 { "ifIndex", "cops.in-out-int.ifindex",
1917 FT_UINT32, BASE_DEC, NULL, 0x0,
1918 "If SNMP is supported, corresponds to MIB-II ifIndex", HFILL }
1920 { &hf_cops_reason,
1921 { "Reason", "cops.reason",
1922 FT_UINT16, BASE_DEC, VALS(cops_reason_vals), 0,
1923 "Reason in Reason object", HFILL }
1925 { &hf_cops_reason_sub,
1926 { "Reason Sub-code", "cops.reason_sub",
1927 FT_UINT16, BASE_HEX, NULL, 0,
1928 "Reason Sub-code in Reason object", HFILL }
1930 { &hf_cops_dec_cmd_code,
1931 { "Command-Code", "cops.decision.cmd",
1932 FT_UINT16, BASE_DEC, VALS(cops_dec_cmd_code_vals), 0,
1933 "Command-Code in Decision/LPDP Decision object", HFILL }
1935 { &hf_cops_dec_flags,
1936 { "Flags", "cops.decision.flags",
1937 FT_UINT16, BASE_HEX, VALS(cops_dec_cmd_flag_vals), 0xffff,
1938 "Flags in Decision/LPDP Decision object", HFILL }
1940 { &hf_cops_error,
1941 { "Error", "cops.error",
1942 FT_UINT16, BASE_DEC, VALS(cops_error_vals), 0,
1943 "Error in Error object", HFILL }
1945 { &hf_cops_error_sub,
1946 { "Error Sub-code", "cops.error_sub",
1947 FT_UINT16, BASE_HEX, NULL, 0,
1948 "Error Sub-code in Error object", HFILL }
1950 { &hf_cops_katimer,
1951 { "Contents: KA Timer Value", "cops.katimer.value",
1952 FT_UINT16, BASE_DEC, NULL, 0,
1953 "Keep-Alive Timer Value in KATimer object", HFILL }
1955 { &hf_cops_pepid,
1956 { "Contents: PEP Id", "cops.pepid.id",
1957 FT_STRING, BASE_NONE, NULL, 0,
1958 "PEP Id in PEPID object", HFILL }
1960 { &hf_cops_report_type,
1961 { "Contents: Report-Type", "cops.report_type",
1962 FT_UINT16, BASE_DEC, VALS(cops_report_type_vals), 0,
1963 "Report-Type in Report-Type object", HFILL }
1965 { &hf_cops_pdprediraddr_ipv4,
1966 { "IPv4 address", "cops.pdprediraddr.ipv4",
1967 FT_IPv4, BASE_NONE, NULL, 0,
1968 "IPv4 address in COPS PDPRedirAddr object", HFILL }
1970 { &hf_cops_pdprediraddr_ipv6,
1971 { "IPv6 address", "cops.pdprediraddr.ipv6",
1972 FT_IPv6, BASE_NONE, NULL, 0,
1973 "IPv6 address in COPS PDPRedirAddr object", HFILL }
1975 { &hf_cops_lastpdpaddr_ipv4,
1976 { "IPv4 address", "cops.lastpdpaddr.ipv4",
1977 FT_IPv4, BASE_NONE, NULL, 0,
1978 "IPv4 address in COPS LastPDPAddr object", HFILL }
1980 { &hf_cops_lastpdpaddr_ipv6,
1981 { "IPv6 address", "cops.lastpdpaddr.ipv6",
1982 FT_IPv6, BASE_NONE, NULL, 0,
1983 "IPv6 address in COPS LastPDPAddr object", HFILL }
1985 { &hf_cops_pdp_tcp_port,
1986 { "TCP Port Number", "cops.pdp.tcp_port",
1987 FT_UINT32, BASE_DEC, NULL, 0x0,
1988 "TCP Port Number of PDP in PDPRedirAddr/LastPDPAddr object", HFILL }
1990 { &hf_cops_accttimer,
1991 { "Contents: ACCT Timer Value", "cops.accttimer.value",
1992 FT_UINT16, BASE_DEC, NULL, 0,
1993 "Accounting Timer Value in AcctTimer object", HFILL }
1995 { &hf_cops_key_id,
1996 { "Contents: Key ID", "cops.integrity.key_id",
1997 FT_UINT32, BASE_DEC, NULL, 0,
1998 "Key ID in Integrity object", HFILL }
2000 { &hf_cops_seq_num,
2001 { "Contents: Sequence Number", "cops.integrity.seq_num",
2002 FT_UINT32, BASE_DEC, NULL, 0,
2003 "Sequence Number in Integrity object", HFILL }
2005 { &hf_cops_gperror,
2006 { "Error", "cops.gperror",
2007 FT_UINT16, BASE_DEC, VALS(cops_gperror_vals), 0,
2008 "Error in Error object", HFILL }
2010 { &hf_cops_gperror_sub,
2011 { "Error Sub-code", "cops.gperror_sub",
2012 FT_UINT16, BASE_HEX, NULL, 0,
2013 "Error Sub-code in Error object", HFILL }
2015 { &hf_cops_cperror,
2016 { "Error", "cops.cperror",
2017 FT_UINT16, BASE_DEC, VALS(cops_cperror_vals), 0,
2018 "Error in Error object", HFILL }
2020 { &hf_cops_cperror_sub,
2021 { "Error Sub-code", "cops.cperror_sub",
2022 FT_UINT16, BASE_HEX, NULL, 0,
2023 "Error Sub-code in Error object", HFILL }
2026 { &hf_cops_reserved8, { "Reserved", "cops.reserved", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } },
2027 { &hf_cops_reserved16, { "Reserved", "cops.reserved", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } },
2028 { &hf_cops_reserved24, { "Reserved", "cops.reserved", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL } },
2030 { &hf_cops_prid_oid, { "PRID Instance Identifier", "cops.prid.instance_id", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
2031 { &hf_cops_pprid_oid, { "Prefix Identifier", "cops.pprid.prefix_id", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
2032 { &hf_cops_errprid_oid, { "ErrorPRID Instance Identifier", "cops.errprid.instance_id", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
2033 { &hf_cops_epd_unknown, { "EPD Unknown Data", "cops.epd.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
2034 { &hf_cops_epd_null, { "EPD Null Data", "cops.epd.null", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
2035 { &hf_cops_epd_int, { "EPD Integer Data", "cops.epd.int", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2036 { &hf_cops_epd_octets, { "EPD Octet String Data", "cops.epd.octets", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
2037 { &hf_cops_epd_oid, { "EPD OID Data", "cops.epd.oid", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
2038 { &hf_cops_epd_ipv4, { "EPD IPAddress Data", "cops.epd.ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } },
2039 { &hf_cops_epd_u32, { "EPD Unsigned32 Data", "cops.epd.unsigned32", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2040 { &hf_cops_epd_ticks, { "EPD TimeTicks Data", "cops.epd.timeticks", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2041 { &hf_cops_epd_opaque, { "EPD Opaque Data", "cops.epd.opaque", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
2042 { &hf_cops_epd_i64, { "EPD Inetger64 Data", "cops.epd.integer64", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2043 { &hf_cops_epd_u64, { "EPD Unsigned64 Data", "cops.epd.unsigned64", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
2045 /* Added for PacketCable */
2047 { &hf_cops_subtree,
2048 { "Object Subtree", "cops.pc_subtree",
2049 FT_NONE, BASE_NONE, NULL, 0,
2050 NULL, HFILL }
2052 { &hf_cops_pc_ds_field,
2053 { "DS Field (DSCP or TOS)", "cops.pc_ds_field",
2054 FT_UINT8, BASE_HEX, NULL, 0x00,
2055 NULL, HFILL }
2057 { &hf_cops_pc_direction,
2058 { "Direction", "cops.pc_direction",
2059 FT_UINT8, BASE_HEX, NULL, 0x00,
2060 NULL, HFILL }
2062 { &hf_cops_pc_gate_spec_flags,
2063 { "Flags", "cops.pc_gate_spec_flags",
2064 FT_UINT8, BASE_HEX, NULL, 0x00,
2065 NULL, HFILL }
2067 { &hf_cops_pc_protocol_id,
2068 { "Protocol ID", "cops.pc_protocol_id",
2069 FT_UINT8, BASE_HEX, NULL, 0x00,
2070 NULL, HFILL }
2072 { &hf_cops_pc_session_class,
2073 { "Session Class", "cops.pc_session_class",
2074 FT_UINT8, BASE_HEX, NULL, 0x00,
2075 NULL, HFILL }
2077 { &hf_cops_pc_algorithm,
2078 { "Algorithm", "cops.pc_algorithm",
2079 FT_UINT16, BASE_HEX, NULL, 0x00,
2080 NULL, HFILL }
2082 { &hf_cops_pc_cmts_ip_port,
2083 { "CMTS IP Port", "cops.pc_cmts_ip_port",
2084 FT_UINT16, BASE_HEX, NULL, 0x00,
2085 NULL, HFILL }
2087 { &hf_cops_pc_prks_ip_port,
2088 { "PRKS IP Port", "cops.pc_prks_ip_port",
2089 FT_UINT16, BASE_HEX, NULL, 0x00,
2090 NULL, HFILL }
2092 { &hf_cops_pc_srks_ip_port,
2093 { "SRKS IP Port", "cops.pc_srks_ip_port",
2094 FT_UINT16, BASE_HEX, NULL, 0x00,
2095 NULL, HFILL }
2097 { &hf_cops_pc_dest_port,
2098 { "Destination IP Port", "cops.pc_dest_port",
2099 FT_UINT16, BASE_HEX, NULL, 0x00,
2100 NULL, HFILL }
2102 { &hf_cops_pc_packetcable_err_code,
2103 { "Error Code", "cops.pc_packetcable_err_code",
2104 FT_UINT16, BASE_HEX, NULL, 0x00,
2105 NULL, HFILL }
2107 { &hf_cops_pc_packetcable_sub_code,
2108 { "Error Sub Code", "cops.pc_packetcable_sub_code",
2109 FT_UINT16, BASE_HEX, NULL, 0x00,
2110 NULL, HFILL }
2112 { &hf_cops_pc_remote_flags,
2113 { "Flags", "cops.pc_remote_flags",
2114 FT_UINT16, BASE_HEX, NULL, 0x00,
2115 NULL, HFILL }
2117 { &hf_cops_pc_close_subcode,
2118 { "Reason Sub Code", "cops.pc_close_subcode",
2119 FT_UINT16, BASE_HEX, NULL, 0x00,
2120 NULL, HFILL }
2122 { &hf_cops_pc_gate_command_type,
2123 { "Gate Command Type", "cops.pc_gate_command_type",
2124 FT_UINT16, BASE_HEX, NULL, 0x00,
2125 NULL, HFILL }
2127 { &hf_cops_pc_reason_code,
2128 { "Reason Code", "cops.pc_reason_code",
2129 FT_UINT16, BASE_HEX, NULL, 0x00,
2130 NULL, HFILL }
2132 { &hf_cops_pc_delete_subcode,
2133 { "Reason Sub Code", "cops.pc_delete_subcode",
2134 FT_UINT16, BASE_HEX, NULL, 0x00,
2135 NULL, HFILL }
2137 { &hf_cops_pc_src_port,
2138 { "Source IP Port", "cops.pc_src_port",
2139 FT_UINT16, BASE_HEX, NULL, 0x00,
2140 NULL, HFILL }
2142 { &hf_cops_pc_t1_value,
2143 { "Timer T1 Value (sec)", "cops.pc_t1_value",
2144 FT_UINT16, BASE_HEX, NULL, 0x00,
2145 NULL, HFILL }
2147 { &hf_cops_pc_t7_value,
2148 { "Timer T7 Value (sec)", "cops.pc_t7_value",
2149 FT_UINT16, BASE_HEX, NULL, 0x00,
2150 NULL, HFILL }
2152 { &hf_cops_pc_t8_value,
2153 { "Timer T8 Value (sec)", "cops.pc_t8_value",
2154 FT_UINT16, BASE_HEX, NULL, 0x00,
2155 NULL, HFILL }
2157 { &hf_cops_pc_transaction_id,
2158 { "Transaction Identifier", "cops.pc_transaction_id",
2159 FT_UINT16, BASE_HEX, NULL, 0x00,
2160 NULL, HFILL }
2162 { &hf_cops_pc_cmts_ip,
2163 { "CMTS IP Address", "cops.pc_cmts_ip",
2164 FT_IPv4, BASE_NONE, NULL, 0x00,
2165 NULL, HFILL }
2167 { &hf_cops_pc_prks_ip,
2168 { "PRKS IP Address", "cops.pc_prks_ip",
2169 FT_IPv4, BASE_NONE, NULL, 0x00,
2170 NULL, HFILL }
2172 { &hf_cops_pc_srks_ip,
2173 { "SRKS IP Address", "cops.pc_srks_ip",
2174 FT_IPv4, BASE_NONE, NULL, 0x00,
2175 NULL, HFILL }
2177 { &hf_cops_pc_dfcdc_ip,
2178 { "DF IP Address CDC", "cops.pc_dfcdc_ip",
2179 FT_IPv4, BASE_NONE, NULL, 0x00,
2180 NULL, HFILL }
2182 { &hf_cops_pc_dfccc_ip,
2183 { "DF IP Address CCC", "cops.pc_dfccc_ip",
2184 FT_IPv4, BASE_NONE, NULL, 0x00,
2185 NULL, HFILL }
2187 { &hf_cops_pc_dfcdc_ip_port,
2188 { "DF IP Port CDC", "cops.pc_dfcdc_ip_port",
2189 FT_UINT16, BASE_HEX, NULL, 0x00,
2190 NULL, HFILL }
2192 { &hf_cops_pc_dfccc_ip_port,
2193 { "DF IP Port CCC", "cops.pc_dfccc_ip_port",
2194 FT_UINT16, BASE_HEX, NULL, 0x00,
2195 NULL, HFILL }
2197 { &hf_cops_pc_dfccc_id,
2198 { "CCC ID", "cops.pc_dfccc_id",
2199 FT_UINT32, BASE_DEC, NULL, 0x00,
2200 NULL, HFILL }
2202 { &hf_cops_pc_activity_count,
2203 { "Count", "cops.pc_activity_count",
2204 FT_UINT32, BASE_HEX, NULL, 0x00,
2205 NULL, HFILL }
2207 { &hf_cops_pc_dest_ip,
2208 { "Destination IP Address", "cops.pc_dest_ip",
2209 FT_IPv4, BASE_NONE, NULL, 0x00,
2210 NULL, HFILL }
2212 { &hf_cops_pc_gate_id,
2213 { "Gate Identifier", "cops.pc_gate_id",
2214 FT_UINT32, BASE_HEX, NULL, 0x00,
2215 NULL, HFILL }
2217 { &hf_cops_pc_max_packet_size,
2218 { "Maximum Packet Size", "cops.pc_max_packet_size",
2219 FT_UINT32, BASE_HEX, NULL, 0x00,
2220 NULL, HFILL }
2222 { &hf_cops_pc_min_policed_unit,
2223 { "Minimum Policed Unit", "cops.pc_min_policed_unit",
2224 FT_UINT32, BASE_HEX, NULL, 0x00,
2225 NULL, HFILL }
2227 { &hf_cops_pc_peak_data_rate,
2228 { "Peak Data Rate", "cops.pc_peak_data_rate",
2229 FT_FLOAT, BASE_NONE, NULL, 0x00,
2230 NULL, HFILL }
2232 { &hf_cops_pc_spec_rate,
2233 { "Rate", "cops.pc_spec_rate",
2234 FT_FLOAT, BASE_NONE, NULL, 0x00,
2235 NULL, HFILL }
2237 { &hf_cops_pc_remote_gate_id,
2238 { "Remote Gate ID", "cops.pc_remote_gate_id",
2239 FT_UINT32, BASE_HEX, NULL, 0x00,
2240 NULL, HFILL }
2242 { &hf_cops_pc_reserved,
2243 { "Reserved", "cops.pc_reserved",
2244 FT_UINT32, BASE_HEX, NULL, 0x00,
2245 NULL, HFILL }
2247 { &hf_cops_pc_key,
2248 { "Security Key", "cops.pc_key",
2249 FT_UINT32, BASE_HEX, NULL, 0x00,
2250 NULL, HFILL }
2252 { &hf_cops_pc_slack_term,
2253 { "Slack Term", "cops.pc_slack_term",
2254 FT_UINT32, BASE_HEX, NULL, 0x00,
2255 NULL, HFILL }
2257 { &hf_cops_pc_src_ip,
2258 { "Source IP Address", "cops.pc_src_ip",
2259 FT_IPv4, BASE_NONE, NULL, 0x00,
2260 NULL, HFILL }
2262 { &hf_cops_pc_subscriber_id_ipv4,
2263 { "Subscriber Identifier (IPv4)", "cops.pc_subscriber_id4",
2264 FT_IPv4, BASE_NONE, NULL, 0x00,
2265 NULL, HFILL }
2267 { &hf_cops_pc_subscriber_id_ipv6,
2268 { "Subscriber Identifier (IPv6)", "cops.pc_subscriber_id6",
2269 FT_IPv6, BASE_NONE, NULL, 0x00,
2270 NULL, HFILL }
2272 { &hf_cops_pc_token_bucket_rate,
2273 { "Token Bucket Rate", "cops.pc_token_bucket_rate",
2274 FT_FLOAT, BASE_NONE, NULL, 0x00,
2275 NULL, HFILL }
2277 { &hf_cops_pc_token_bucket_size,
2278 { "Token Bucket Size", "cops.pc_token_bucket_size",
2279 FT_FLOAT, BASE_NONE, NULL, 0x00,
2280 NULL, HFILL }
2282 #if 0
2283 { &hf_cops_pc_bcid,
2284 { "Billing Correlation ID", "cops.pc_bcid",
2285 FT_UINT32, BASE_HEX, NULL, 0x00,
2286 NULL, HFILL }
2288 #endif
2289 { &hf_cops_pc_bcid_ts,
2290 { "BDID Timestamp", "cops.pc_bcid_ts",
2291 FT_UINT32, BASE_HEX, NULL, 0x00,
2292 "BCID Timestamp", HFILL }
2294 { &hf_cops_pc_bcid_ev,
2295 { "BDID Event Counter", "cops.pc_bcid_ev",
2296 FT_UINT32, BASE_HEX, NULL, 0x00,
2297 "BCID Event Counter", HFILL }
2300 { &hf_cops_pcmm_amid_app_type,
2301 { "AMID Application Type", "cops.pc_mm_amid_application_type",
2302 FT_UINT32, BASE_DEC, NULL, 0,
2303 "PacketCable Multimedia AMID Application Type", HFILL }
2305 { &hf_cops_pcmm_amid_am_tag,
2306 { "AMID Application Manager Tag", "cops.pc_mm_amid_am_tag",
2307 FT_UINT32, BASE_DEC, NULL, 0,
2308 "PacketCable Multimedia AMID Application Manager Tag", HFILL }
2311 { &hf_cops_pcmm_gate_spec_flags,
2312 { "Flags", "cops.pc_mm_gs_flags",
2313 FT_UINT8, BASE_HEX, NULL, 0,
2314 "PacketCable Multimedia GateSpec Flags", HFILL }
2317 { &hf_cops_pcmm_gate_spec_flags_gate,
2318 { "Gate", "cops.pc_mm_gs_flags.gate",
2319 FT_BOOLEAN, 8, TFS(&tfs_upstream_downstream), 0x1,
2320 NULL, HFILL }
2323 { &hf_cops_pcmm_gate_spec_flags_dscp_overwrite,
2324 { "DSCP/TOS overwrite", "cops.pc_mm_gs_flags.dscp_overwrite",
2325 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x2,
2326 NULL, HFILL }
2329 { &hf_cops_pcmm_gate_spec_dscp_tos_field,
2330 { "DSCP/TOS Field", "cops.pc_mm_gs_dscp",
2331 FT_UINT8, BASE_HEX, NULL, 0,
2332 "PacketCable Multimedia GateSpec DSCP/TOS Field", HFILL }
2334 { &hf_cops_pcmm_gate_spec_dscp_tos_mask,
2335 { "DSCP/TOS Mask", "cops.pc_mm_gs_dscp_mask",
2336 FT_UINT8, BASE_HEX, NULL, 0,
2337 "PacketCable Multimedia GateSpec DSCP/TOS Mask", HFILL }
2339 { &hf_cops_pcmm_gate_spec_session_class_id,
2340 { "SessionClassID", "cops.pc_mm_gs_scid",
2341 FT_UINT8, BASE_DEC, NULL, 0,
2342 "PacketCable Multimedia GateSpec SessionClassID", HFILL }
2344 { &hf_cops_pcmm_gate_spec_session_class_id_priority,
2345 { "SessionClassID Priority", "cops.pc_mm_gs_scid_prio",
2346 FT_UINT8, BASE_DEC, NULL, 0x07,
2347 "PacketCable Multimedia GateSpec SessionClassID Priority", HFILL }
2349 { &hf_cops_pcmm_gate_spec_session_class_id_preemption,
2350 { "SessionClassID Preemption", "cops.pc_mm_gs_scid_preempt",
2351 FT_UINT8, BASE_DEC, NULL, 0x08,
2352 "PacketCable Multimedia GateSpec SessionClassID Preemption", HFILL }
2354 { &hf_cops_pcmm_gate_spec_session_class_id_configurable,
2355 { "SessionClassID Configurable", "cops.pc_mm_gs_scid_conf",
2356 FT_UINT8, BASE_DEC, NULL, 0xf0,
2357 "PacketCable Multimedia GateSpec SessionClassID Configurable", HFILL }
2359 { &hf_cops_pcmm_gate_spec_timer_t1,
2360 { "Timer T1", "cops.pc_mm_gs_timer_t1",
2361 FT_UINT16, BASE_DEC, NULL, 0,
2362 "PacketCable Multimedia GateSpec Timer T1", HFILL }
2364 { &hf_cops_pcmm_gate_spec_timer_t2,
2365 { "Timer T2", "cops.pc_mm_gs_timer_t2",
2366 FT_UINT16, BASE_DEC, NULL, 0,
2367 "PacketCable Multimedia GateSpec Timer T2", HFILL }
2369 { &hf_cops_pcmm_gate_spec_timer_t3,
2370 { "Timer T3", "cops.pc_mm_gs_timer_t3",
2371 FT_UINT16, BASE_DEC, NULL, 0,
2372 "PacketCable Multimedia GateSpec Timer T3", HFILL }
2374 { &hf_cops_pcmm_gate_spec_timer_t4,
2375 { "Timer T4", "cops.pc_mm_gs_timer_t4",
2376 FT_UINT16, BASE_DEC, NULL, 0,
2377 "PacketCable Multimedia GateSpec Timer T4", HFILL }
2380 { &hf_cops_pcmm_classifier_protocol_id,
2381 { "Protocol ID", "cops.pc_mm_classifier_proto_id",
2382 FT_UINT16, BASE_HEX, NULL, 0,
2383 "PacketCable Multimedia Classifier Protocol ID", HFILL }
2385 { &hf_cops_pcmm_classifier_dscp_tos_field,
2386 { "DSCP/TOS Field", "cops.pc_mm_classifier_dscp",
2387 FT_UINT8, BASE_HEX, NULL, 0,
2388 "PacketCable Multimedia Classifier DSCP/TOS Field", HFILL }
2390 { &hf_cops_pcmm_classifier_dscp_tos_mask,
2391 { "DSCP/TOS Mask", "cops.pc_mm_classifier_dscp_mask",
2392 FT_UINT8, BASE_HEX, NULL, 0,
2393 "PacketCable Multimedia Classifier DSCP/TOS Mask", HFILL }
2395 { &hf_cops_pcmm_classifier_src_addr,
2396 { "Source address", "cops.pc_mm_classifier_src_addr",
2397 FT_IPv4, BASE_NONE, NULL, 0,
2398 "PacketCable Multimedia Classifier Source IP Address", HFILL }
2400 { &hf_cops_pcmm_classifier_src_mask,
2401 { "Source mask", "cops.pc_mm_classifier_src_mask",
2402 FT_IPv4, BASE_NONE, NULL, 0,
2403 "PacketCable Multimedia Classifier Source Mask", HFILL }
2405 { &hf_cops_pcmm_classifier_dst_addr,
2406 { "Destination address", "cops.pc_mm_classifier_dst_addr",
2407 FT_IPv4, BASE_NONE, NULL, 0,
2408 "PacketCable Multimedia Classifier Destination IP Address", HFILL }
2410 { &hf_cops_pcmm_classifier_dst_mask,
2411 { "Destination mask", "cops.pc_mm_classifier_dst_mask",
2412 FT_IPv4, BASE_NONE, NULL, 0,
2413 "PacketCable Multimedia Classifier Destination Mask", HFILL }
2415 { &hf_cops_pcmm_classifier_src_port,
2416 { "Source Port", "cops.pc_mm_classifier_src_port",
2417 FT_UINT16, BASE_DEC, NULL, 0,
2418 "PacketCable Multimedia Classifier Source Port", HFILL }
2420 { &hf_cops_pcmm_classifier_src_port_end,
2421 { "Source Port End", "cops.pc_mm_classifier_src_port_end",
2422 FT_UINT16, BASE_DEC, NULL, 0,
2423 "PacketCable Multimedia Classifier Source Port End", HFILL }
2425 { &hf_cops_pcmm_classifier_dst_port,
2426 { "Destination Port", "cops.pc_mm_classifier_dst_port",
2427 FT_UINT16, BASE_DEC, NULL, 0,
2428 "PacketCable Multimedia Classifier Source Port", HFILL }
2430 { &hf_cops_pcmm_classifier_dst_port_end,
2431 { "Destination Port End", "cops.pc_mm_classifier_dst_port_end",
2432 FT_UINT16, BASE_DEC, NULL, 0,
2433 "PacketCable Multimedia Classifier Source Port End", HFILL }
2435 { &hf_cops_pcmm_classifier_priority,
2436 { "Priority", "cops.pc_mm_classifier_priority",
2437 FT_UINT8, BASE_HEX, NULL, 0,
2438 "PacketCable Multimedia Classifier Priority", HFILL }
2440 { &hf_cops_pcmm_classifier_classifier_id,
2441 { "Classifier Id", "cops.pc_mm_classifier_id",
2442 FT_UINT16, BASE_HEX, NULL, 0,
2443 "PacketCable Multimedia Classifier ID", HFILL }
2445 { &hf_cops_pcmm_classifier_activation_state,
2446 { "Activation State", "cops.pc_mm_classifier_activation_state",
2447 FT_UINT8, BASE_HEX, pcmm_activation_state_vals, 0,
2448 "PacketCable Multimedia Classifier Activation State", HFILL }
2450 { &hf_cops_pcmm_classifier_action,
2451 { "Action", "cops.pc_mm_classifier_action",
2452 FT_UINT8, BASE_HEX, pcmm_action_vals, 0,
2453 "PacketCable Multimedia Classifier Action", HFILL }
2455 { &hf_cops_pcmm_classifier_flags,
2456 { "Flags", "cops.pc_mm_classifier_flags",
2457 FT_UINT8, BASE_HEX, NULL, 0,
2458 "PacketCable Multimedia Classifier Flags", HFILL }
2460 { &hf_cops_pcmm_classifier_tc_low,
2461 { "tc-low", "cops.pc_mm_classifier_tc_low",
2462 FT_UINT8, BASE_HEX, NULL, 0,
2463 "PacketCable Multimedia Classifier tc-low", HFILL }
2465 { &hf_cops_pcmm_classifier_tc_high,
2466 { "tc-high", "cops.pc_mm_classifier_tc_high",
2467 FT_UINT8, BASE_HEX, NULL, 0,
2468 "PacketCable Multimedia Classifier tc-high", HFILL }
2470 { &hf_cops_pcmm_classifier_tc_mask,
2471 { "tc-mask", "cops.pc_mm_classifier_tc_mask",
2472 FT_UINT8, BASE_HEX, NULL, 0,
2473 "PacketCable Multimedia Classifier tc-mask", HFILL }
2475 { &hf_cops_pcmm_classifier_flow_label,
2476 { "Flow Label", "cops.pc_mm_classifier_flow_label",
2477 FT_UINT32, BASE_HEX, NULL, 0,
2478 "PacketCable Multimedia Classifier Flow Label", HFILL }
2480 { &hf_cops_pcmm_classifier_next_header_type,
2481 { "Next Header Type", "cops.pc_mm_classifier_next_header_type",
2482 FT_UINT16, BASE_HEX, NULL, 0,
2483 "PacketCable Multimedia Classifier Next Header Type", HFILL }
2485 { &hf_cops_pcmm_classifier_source_prefix_length,
2486 { "Source Prefix Length", "cops.pc_mm_classifier_source_prefix_length",
2487 FT_UINT8, BASE_HEX, NULL, 0,
2488 "PacketCable Multimedia Classifier Source Prefix Length", HFILL }
2490 { &hf_cops_pcmm_classifier_destination_prefix_length,
2491 { "Destination Prefix Length", "cops.pc_mm_classifier_destination_prefix_length",
2492 FT_UINT8, BASE_HEX, NULL, 0,
2493 "PacketCable Multimedia Classifier Destination Prefix Length", HFILL }
2495 { &hf_cops_pcmm_classifier_src_addr_v6,
2496 { "IPv6 Source Address", "cops.pc_mm_classifier_src_addr_v6",
2497 FT_IPv6, BASE_NONE, NULL, 0,
2498 "PacketCable Multimedia Classifier IPv6 Source Address", HFILL }
2500 { &hf_cops_pcmm_classifier_dst_addr_v6,
2501 { "IPv6 Destination Address", "cops.pc_mm_classifier_dst_addr_v6",
2502 FT_IPv6, BASE_NONE, NULL, 0,
2503 "PacketCable Multimedia Classifier IPv6 Destination Address", HFILL }
2506 { &hf_cops_pcmm_flow_spec_envelope,
2507 { "Envelope", "cops.pc_mm_fs_envelope",
2508 FT_UINT8, BASE_DEC, NULL, 0,
2509 "PacketCable Multimedia Flow Spec Envelope", HFILL }
2511 { &hf_cops_pcmm_flow_spec_service_number,
2512 { "Service Number", "cops.pc_mm_fs_svc_num",
2513 FT_UINT8, BASE_DEC, pcmm_flow_spec_service_vals, 0,
2514 "PacketCable Multimedia Flow Spec Service Number", HFILL }
2517 { &hf_cops_pcmm_docsis_scn,
2518 { "Service Class Name", "cops.pc_mm_docsis_scn",
2519 FT_STRINGZ, BASE_NONE, NULL, 0,
2520 "PacketCable Multimedia DOCSIS Service Class Name", HFILL }
2523 { &hf_cops_pcmm_envelope,
2524 { "Envelope", "cops.pc_mm_envelope",
2525 FT_UINT8, BASE_DEC, NULL, 0,
2526 "PacketCable Multimedia Envelope", HFILL }
2529 { &hf_cops_pcmm_traffic_priority,
2530 { "Traffic Priority", "cops.pc_mm_tp",
2531 FT_UINT8, BASE_DEC, NULL, 0,
2532 "PacketCable Multimedia Committed Envelope Traffic Priority", HFILL }
2534 { &hf_cops_pcmm_request_transmission_policy,
2535 { "Request Transmission Policy", "cops.pc_mm_rtp",
2536 FT_UINT32, BASE_HEX, NULL, 0,
2537 "PacketCable Multimedia Committed Envelope Traffic Priority", HFILL }
2539 { &hf_cops_pcmm_max_sustained_traffic_rate,
2540 { "Maximum Sustained Traffic Rate", "cops.pc_mm_mstr",
2541 FT_UINT32, BASE_DEC, NULL, 0,
2542 "PacketCable Multimedia Committed Envelope Maximum Sustained Traffic Rate", HFILL }
2544 { &hf_cops_pcmm_max_traffic_burst,
2545 { "Maximum Traffic Burst", "cops.pc_mm_mtb",
2546 FT_UINT32, BASE_DEC, NULL, 0,
2547 "PacketCable Multimedia Committed Envelope Maximum Traffic Burst", HFILL }
2549 { &hf_cops_pcmm_min_reserved_traffic_rate,
2550 { "Minimum Reserved Traffic Rate", "cops.pc_mm_mrtr",
2551 FT_UINT32, BASE_DEC, NULL, 0,
2552 "PacketCable Multimedia Committed Envelope Minimum Reserved Traffic Rate", HFILL }
2554 { &hf_cops_pcmm_ass_min_rtr_packet_size,
2555 { "Assumed Minimum Reserved Traffic Rate Packet Size", "cops.pc_mm_amrtrps",
2556 FT_UINT16, BASE_DEC, NULL, 0,
2557 "PacketCable Multimedia Committed Envelope Assumed Minimum Reserved Traffic Rate Packet Size", HFILL }
2559 { &hf_cops_pcmm_max_concat_burst,
2560 { "Maximum Concatenated Burst", "cops.pc_mm_mcburst",
2561 FT_UINT16, BASE_DEC, NULL, 0,
2562 "PacketCable Multimedia Committed Envelope Maximum Concatenated Burst", HFILL }
2564 { &hf_cops_pcmm_req_att_mask,
2565 { "Required Attribute Mask", "cops.pc_mm_ramask",
2566 FT_UINT16, BASE_DEC, NULL, 0,
2567 "PacketCable Multimedia Committed Envelope Required Attribute Mask", HFILL }
2569 { &hf_cops_pcmm_forbid_att_mask,
2570 { "Forbidden Attribute Mask", "cops.pc_mm_famask",
2571 FT_UINT16, BASE_DEC, NULL, 0,
2572 "PacketCable Multimedia Committed Envelope Forbidden Attribute Mask", HFILL }
2574 { &hf_cops_pcmm_att_aggr_rule_mask,
2575 { "Attribute Aggregation Rule Mask", "cops.pc_mm_aarmask",
2576 FT_UINT16, BASE_DEC, NULL, 0,
2577 "PacketCable Multimedia Committed Envelope Attribute Aggregation Rule Mask", HFILL }
2580 { &hf_cops_pcmm_nominal_polling_interval,
2581 { "Nominal Polling Interval", "cops.pc_mm_npi",
2582 FT_UINT32, BASE_DEC, NULL, 0,
2583 "PacketCable Multimedia Nominal Polling Interval", HFILL }
2586 { &hf_cops_pcmm_tolerated_poll_jitter,
2587 { "Tolerated Poll Jitter", "cops.pc_mm_tpj",
2588 FT_UINT32, BASE_DEC, NULL, 0,
2589 "PacketCable Multimedia Tolerated Poll Jitter", HFILL }
2592 { &hf_cops_pcmm_unsolicited_grant_size,
2593 { "Unsolicited Grant Size", "cops.pc_mm_ugs",
2594 FT_UINT16, BASE_DEC, NULL, 0,
2595 "PacketCable Multimedia Unsolicited Grant Size", HFILL }
2597 { &hf_cops_pcmm_grants_per_interval,
2598 { "Grants Per Interval", "cops.pc_mm_gpi",
2599 FT_UINT8, BASE_DEC, NULL, 0,
2600 "PacketCable Multimedia Grants Per Interval", HFILL }
2602 { &hf_cops_pcmm_nominal_grant_interval,
2603 { "Nominal Grant Interval", "cops.pc_mm_ngi",
2604 FT_UINT32, BASE_DEC, NULL, 0,
2605 "PacketCable Multimedia Nominal Grant Interval", HFILL }
2607 { &hf_cops_pcmm_tolerated_grant_jitter,
2608 { "Tolerated Grant Jitter", "cops.pc_mm_tgj",
2609 FT_UINT32, BASE_DEC, NULL, 0,
2610 "PacketCable Multimedia Tolerated Grant Jitter", HFILL }
2613 { &hf_cops_pcmm_down_resequencing,
2614 { "Downstream Resequencing", "cops.pc_mm_downres",
2615 FT_UINT32, BASE_DEC, NULL, 0,
2616 "PacketCable Multimedia Downstream Resequencing", HFILL }
2619 { &hf_cops_pcmm_down_peak_traffic_rate,
2620 { "Downstream Peak Traffic Rate", "cops.pc_mm_downpeak",
2621 FT_UINT32, BASE_DEC, NULL, 0,
2622 "PacketCable Multimedia Downstream Peak Traffic Rate", HFILL }
2625 { &hf_cops_pcmm_max_downstream_latency,
2626 { "Maximum Downstream Latency", "cops.pc_mm_mdl",
2627 FT_UINT32, BASE_DEC, NULL, 0,
2628 "PacketCable Multimedia Maximum Downstream Latency", HFILL }
2631 { &hf_cops_pcmm_volume_based_usage_limit,
2632 { "Usage Limit", "cops.pc_mm_vbul_ul",
2633 FT_UINT64, BASE_DEC, NULL, 0,
2634 "PacketCable Multimedia Volume-Based Usage Limit", HFILL }
2637 { &hf_cops_pcmm_time_based_usage_limit,
2638 { "Usage Limit", "cops.pc_mm_tbul_ul",
2639 FT_UINT32, BASE_DEC, NULL, 0,
2640 "PacketCable Multimedia Time-Based Usage Limit", HFILL }
2643 { &hf_cops_pcmm_gate_time_info,
2644 { "Gate Time Info", "cops.pc_mm_gti",
2645 FT_UINT32, BASE_DEC, NULL, 0,
2646 "PacketCable Multimedia Gate Time Info", HFILL }
2649 { &hf_cops_pcmm_gate_usage_info,
2650 { "Gate Usage Info", "cops.pc_mm_gui",
2651 FT_UINT64, BASE_DEC, NULL, 0,
2652 "PacketCable Multimedia Gate Usage Info", HFILL }
2655 { &hf_cops_pcmm_packetcable_error_code,
2656 { "Error-Code", "cops.pc_mm_error_ec",
2657 FT_UINT16, BASE_DEC, NULL, 0,
2658 "PacketCable Multimedia PacketCable-Error Error-Code", HFILL }
2660 { &hf_cops_pcmm_packetcable_error_subcode,
2661 { "Error-code", "cops.pc_mm_error_esc",
2662 FT_UINT16, BASE_HEX, NULL, 0,
2663 "PacketCable Multimedia PacketCable-Error Error Sub-code", HFILL }
2666 { &hf_cops_pcmm_packetcable_gate_state,
2667 { "State", "cops.pc_mm_gs_state",
2668 FT_UINT16, BASE_DEC, NULL, 0,
2669 "PacketCable Multimedia Gate State", HFILL }
2671 { &hf_cops_pcmm_packetcable_gate_state_reason,
2672 { "Reason", "cops.pc_mm_gs_reason",
2673 FT_UINT16, BASE_HEX, NULL, 0,
2674 "PacketCable Multimedia Gate State Reason", HFILL }
2676 { &hf_cops_pcmm_packetcable_version_info_major,
2677 { "Major Version Number", "cops.pc_mm_vi_major",
2678 FT_UINT16, BASE_DEC, NULL, 0,
2679 "PacketCable Multimedia Major Version Number", HFILL }
2681 { &hf_cops_pcmm_packetcable_version_info_minor,
2682 { "Minor Version Number", "cops.pc_mm_vi_minor",
2683 FT_UINT16, BASE_DEC, NULL, 0,
2684 "PacketCable Multimedia Minor Version Number", HFILL }
2687 { &hf_cops_pcmm_psid,
2688 { "PSID", "cops.pc_mm_psid",
2689 FT_UINT32, BASE_DEC, NULL, 0,
2690 "PacketCable Multimedia PSID", HFILL }
2693 { &hf_cops_pcmm_synch_options_report_type,
2694 { "Report Type", "cops.pc_mm_synch_options_report_type",
2695 FT_UINT8, BASE_DEC, pcmm_report_type_vals, 0,
2696 "PacketCable Multimedia Synch Options Report Type", HFILL }
2698 { &hf_cops_pcmm_synch_options_synch_type,
2699 { "Synch Type", "cops.pc_mm_synch_options_synch_type",
2700 FT_UINT8, BASE_DEC, pcmm_synch_type_vals, 0,
2701 "PacketCable Multimedia Synch Options Synch Type", HFILL }
2704 { &hf_cops_pcmm_msg_receipt_key,
2705 { "Msg Receipt Key", "cops.pc_mm_msg_receipt_key",
2706 FT_UINT32, BASE_HEX, NULL, 0,
2707 "PacketCable Multimedia Msg Receipt Key", HFILL }
2710 { &hf_cops_pcmm_userid,
2711 { "UserID", "cops.pc_mm_userid",
2712 FT_STRING, BASE_NONE, NULL, 0,
2713 "PacketCable Multimedia UserID", HFILL }
2716 { &hf_cops_pcmm_sharedresourceid,
2717 { "SharedResourceID", "cops.pc_mm_sharedresourceid",
2718 FT_UINT32, BASE_HEX, NULL, 0,
2719 "PacketCable Multimedia SharedResourceID", HFILL }
2722 /* End of addition for PacketCable */
2726 /* Setup protocol subtree array */
2727 static gint *ett[] = {
2728 &ett_cops,
2729 &ett_cops_ver_flags,
2730 &ett_cops_obj,
2731 &ett_cops_pr_obj,
2732 &ett_cops_obj_data,
2733 &ett_cops_r_type_flags,
2734 &ett_cops_itf,
2735 &ett_cops_reason,
2736 &ett_cops_decision,
2737 &ett_cops_error,
2738 &ett_cops_clientsi,
2739 &ett_cops_asn1,
2740 &ett_cops_gperror,
2741 &ett_cops_cperror,
2742 &ett_cops_pdp,
2743 &ett_cops_subtree,
2744 &ett_docsis_request_transmission_policy,
2747 static ei_register_info ei[] = {
2748 { &ei_cops_pepid_not_null, { "cops.pepid.not_null", PI_MALFORMED, PI_NOTE, "PEP Id is not a NULL terminated ASCII string", EXPFILL }},
2749 { &ei_cops_trailing_garbage, { "cops.trailing_garbage", PI_UNDECODED, PI_NOTE, "Trailing garbage", EXPFILL }},
2750 { &ei_cops_bad_cops_object_length, { "cops.bad_cops_object_length", PI_MALFORMED, PI_ERROR, "COPS object length is too short", EXPFILL }},
2751 { &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 }},
2752 { &ei_cops_unknown_c_num, { "cops.unknown_c_num", PI_UNDECODED, PI_NOTE, "Unknown C-Num value", EXPFILL }},
2753 { &ei_cops_unknown_s_num, { "cops.unknown_s_num", PI_UNDECODED, PI_NOTE, "Unknown S-Num value", EXPFILL }},
2757 module_t* cops_module;
2758 expert_module_t* expert_cops;
2760 /* Register the protocol name and description */
2761 proto_cops = proto_register_protocol("Common Open Policy Service",
2762 "COPS", "cops");
2764 /* Required function calls to register the header fields and subtrees used */
2765 proto_register_field_array(proto_cops, hf, array_length(hf));
2766 proto_register_subtree_array(ett, array_length(ett));
2767 expert_cops = expert_register_protocol(proto_cops);
2768 expert_register_field_array(expert_cops, ei, array_length(ei));
2770 /* Make dissector findable by name */
2771 new_register_dissector("cops", dissect_cops, proto_cops);
2773 /* Register our configuration options for cops */
2774 cops_module = prefs_register_protocol(proto_cops, proto_reg_handoff_cops);
2775 prefs_register_uint_preference(cops_module,"tcp.cops_port",
2776 "COPS TCP Port",
2777 "Set the TCP port for COPS messages",
2778 10,&global_cops_tcp_port);
2779 prefs_register_bool_preference(cops_module, "desegment",
2780 "Reassemble COPS messages spanning multiple TCP segments",
2781 "Whether the COPS dissector should reassemble messages spanning multiple TCP segments."
2782 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
2783 &cops_desegment);
2785 /* For PacketCable */
2786 prefs_register_bool_preference(cops_module, "packetcable",
2787 "Decode for PacketCable clients",
2788 "Decode the COPS messages using PacketCable clients. (Select port 2126)",
2789 &cops_packetcable);
2791 prefs_register_static_text_preference(cops_module, "info_pibs",
2792 "PIB settings can be changed in the Name Resolution preferences",
2793 "PIB settings can be changed in the Name Resolution preferences");
2795 prefs_register_obsolete_preference(cops_module, "typefrommib");
2798 void proto_reg_handoff_cops(void)
2800 static gboolean cops_prefs_initialized = FALSE;
2801 static dissector_handle_t cops_handle;
2802 static guint cops_tcp_port;
2804 if (!cops_prefs_initialized) {
2805 cops_handle = find_dissector("cops");
2806 dissector_add_uint("tcp.port", TCP_PORT_PKTCABLE_COPS, cops_handle);
2807 dissector_add_uint("tcp.port", TCP_PORT_PKTCABLE_MM_COPS, cops_handle);
2808 cops_prefs_initialized = TRUE;
2809 } else {
2810 dissector_delete_uint("tcp.port",cops_tcp_port,cops_handle);
2812 cops_tcp_port = global_cops_tcp_port;
2814 dissector_add_uint("tcp.port", cops_tcp_port, cops_handle);
2818 /* Additions for PacketCable ( Added by Dick Gooris, Lucent Technologies ) */
2820 /* Definitions for print formatting */
2821 /* XXX - Why don't we just use ftenum types here? */
2822 #define FMT_DEC 0
2823 #define FMT_HEX 1
2824 #define FMT_IPv4 2
2825 #define FMT_IPv6 3
2826 #define FMT_FLT 4
2827 #define FMT_STR 5
2829 /* Print the translated information in the display gui in a formatted way
2831 * octets = The number of octets to obtain from the buffer
2833 * vsp = If not a NULL pointer, it points to an array with text
2835 * mode = 0 -> print decimal value
2836 * 1 -> print hexadecimal vaue
2837 * 2 -> print value as an IPv4 address
2838 * 3 -> print value as an IPv6 address
2839 * 4 -> print value as an IEEE float
2840 * 5 -> print value as a string
2842 * This function in combination with the separate function info_to_cops_subtree() for subtrees.
2846 static proto_item *
2847 info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, const char *str, const value_string *vsp, int mode,gint *hf_proto_parameter)
2849 proto_item *pi = NULL;
2850 guint8 *codestr;
2851 guint8 code8 = 0;
2852 guint16 code16 = 0;
2853 guint32 codeipv4 = 0;
2854 guint32 code32 = 0;
2855 guint64 code64 = 0;
2856 float codefl = 0.0f;
2858 /* Special section for printing strings */
2859 if (mode==FMT_STR) {
2860 codestr = tvb_get_string(wmem_packet_scope(), tvb, offset, octets);
2861 pi = proto_tree_add_string_format(stt, *hf_proto_parameter, tvb,
2862 offset, octets, codestr, "%-28s : %s", str, codestr);
2863 return pi;
2866 /* Print information elements in the specified way */
2867 switch (octets) {
2869 case 1:
2870 /* Get the octet */
2871 code8 = tvb_get_guint8( tvb, offset );
2872 if (vsp == NULL) {
2873 /* Hexadecimal format */
2874 if (mode==FMT_HEX)
2875 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2876 offset, octets, code8,"%-28s : 0x%02x",str,code8);
2877 else
2878 /* Print an 8 bits integer */
2879 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2880 offset, octets, code8,"%-28s : %u",str,code8);
2881 } else {
2882 if (mode==FMT_HEX)
2883 /* Hexadecimal format */
2884 pi = proto_tree_add_uint_format(
2885 stt, *hf_proto_parameter,tvb, offset, octets, code8,
2886 "%-28s : %s (0x%02x)",str,val_to_str_const(code8, vsp, "Unknown"),code8);
2887 else
2888 /* String table indexed */
2889 pi = proto_tree_add_uint_format(
2890 stt, *hf_proto_parameter,tvb, offset, octets, code8,
2891 "%-28s : %s (%u)",str,val_to_str_const(code8, vsp, "Unknown"),code8);
2893 break;
2895 case 2:
2897 /* Get the next two octets */
2898 code16 = tvb_get_ntohs(tvb,offset);
2899 if (vsp == NULL) {
2900 /* Hexadecimal format */
2901 if (mode==FMT_HEX)
2902 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2903 offset, octets, code16,"%-28s : 0x%04x",str,code16);
2904 else
2905 /* Print a 16 bits integer */
2906 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2907 offset, octets, code16,"%-28s : %u",str,code16);
2908 } else {
2909 if (mode==FMT_HEX)
2910 /* Hexadecimal format */
2911 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2912 offset, octets, code16,"%-28s : %s (0x%04x)", str,
2913 val_to_str(code16, vsp, "Unknown (0x%04x)"),code16);
2914 else
2915 /* Print a 16 bits integer */
2916 pi = proto_tree_add_uint_format(
2917 stt, *hf_proto_parameter,tvb, offset, octets, code16,
2918 "%-28s : %s (%u)",str,val_to_str(code16, vsp, "Unknown (0x%04x)"),code16);
2920 break;
2922 case 4:
2924 /* Get the next four octets */
2925 switch (mode) {
2926 case FMT_FLT: codefl = tvb_get_ntohieee_float(tvb,offset);
2927 break;
2928 case FMT_IPv4: codeipv4 = tvb_get_ipv4(tvb, offset);
2929 break;
2930 default: code32 = tvb_get_ntohl(tvb,offset);
2933 if (vsp == NULL) {
2934 /* Hexadecimal format */
2935 if (mode==FMT_HEX) {
2936 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb,
2937 offset, octets, code32,"%-28s : 0x%08x",str,code32);
2938 break;
2940 /* Ip address format*/
2941 if (mode==FMT_IPv4) {
2942 pi = proto_tree_add_ipv4(stt, *hf_proto_parameter,tvb, offset, octets, codeipv4);
2943 break;
2945 /* Ieee float format */
2946 if (mode==FMT_FLT) {
2947 pi = proto_tree_add_float_format(stt, *hf_proto_parameter,tvb, offset, octets,
2948 codefl,"%-28s : %.10g",str,codefl);
2949 break;
2951 /* Print a 32 bits integer */
2952 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
2953 code32,"%-28s : %u",str,code32);
2954 } else {
2955 /* Hexadecimal format */
2956 if (mode==FMT_HEX)
2957 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
2958 code32,"%-28s : %s (0x%08x)",str,val_to_str_const(code32, vsp, "Unknown"),code32);
2959 else
2960 /* String table indexed */
2961 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
2962 code32,"%-28s : %s (%u)",str,val_to_str_const(code32, vsp, "Unknown"),code32);
2964 break;
2966 /* In case of more than 4 octets.... */
2967 default:
2969 if (mode==FMT_HEX) {
2970 pi = proto_tree_add_item(stt, *hf_proto_parameter,
2971 tvb, offset, octets, ENC_NA);
2972 } else if (mode==FMT_IPv6 && octets==16) {
2973 pi = proto_tree_add_item(stt, *hf_proto_parameter, tvb, offset, octets,
2974 ENC_NA);
2975 } else if (mode==FMT_DEC && octets==8) {
2976 code64 = tvb_get_ntoh64(tvb, offset);
2977 pi = proto_tree_add_uint64_format(stt, *hf_proto_parameter, tvb, offset, octets,
2978 code64, "%-28s : %" G_GINT64_MODIFIER "u", str, code64);
2979 } else {
2980 pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,
2981 tvb, offset, octets, code32,"%s",str);
2983 break;
2986 return pi;
2989 /* Print the subtree information for cops */
2990 static proto_tree *
2991 info_to_cops_subtree(tvbuff_t *tvb, proto_tree *st, int n, int offset, const char *str) {
2992 proto_item *tv;
2994 tv = proto_tree_add_none_format( st, hf_cops_subtree, tvb, offset, n, "%s", str);
2995 return( proto_item_add_subtree( tv, ett_cops_subtree ) );
2998 /* Cops - Section : D-QoS Transaction ID */
2999 static void
3000 cops_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8 op_code, guint n, guint32 offset) {
3002 proto_tree *stt;
3003 guint16 code16;
3004 char info[50];
3006 /* Create a subtree */
3007 stt = info_to_cops_subtree(tvb,st,n,offset,"D-QoS Transaction ID");
3008 offset += 4;
3010 /* Transaction Identifier */
3011 info_to_display(tvb,stt,offset,2,"D-QoS Transaction Identifier", NULL,FMT_DEC,&hf_cops_pc_transaction_id);
3012 offset +=2;
3014 /* Gate Command Type */
3015 code16 = tvb_get_ntohs(tvb,offset);
3016 proto_tree_add_uint_format(stt, hf_cops_pc_gate_command_type,tvb, offset, 2,
3017 code16,"%-28s : %s (%u)", "Gate Command Type",
3018 val_to_str(code16,table_cops_dqos_transaction_id, "Unknown (0x%04x)"),code16);
3020 /* Write the right data into the 'info field' on the Gui */
3021 g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
3022 val_to_str_const(code16,table_cops_dqos_transaction_id, "Unknown"));
3024 col_add_str(pinfo->cinfo, COL_INFO,info);
3027 /* Cops - Section : Subscriber IDv4 */
3028 static void
3029 cops_subscriber_id_v4(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3031 proto_item *tv;
3033 /* Create a subtree */
3034 tv = info_to_cops_subtree(tvb,st,n,offset,"Subscriber ID (IPv4)");
3035 offset += 4;
3037 /* Subscriber Identifier */
3038 info_to_display(tvb,tv,offset,4,"Subscriber Identifier (IPv4)", NULL,FMT_IPv4,&hf_cops_pc_subscriber_id_ipv4);
3041 /* Cops - Section : Subscriber IDv6 */
3042 static void
3043 cops_subscriber_id_v6(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3045 proto_item *tv;
3047 /* Create a subtree */
3048 tv = info_to_cops_subtree(tvb,st,n,offset,"Subscriber ID (IPv6)");
3049 offset += 4;
3051 /* Subscriber Identifier */
3052 info_to_display(tvb,tv,offset,16,"Subscriber Identifier (IPv6)", NULL,FMT_IPv6,&hf_cops_pc_subscriber_id_ipv6);
3055 /* Cops - Section : Gate ID */
3056 static void
3057 cops_gate_id(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3059 proto_tree *stt;
3061 /* Create a subtree */
3062 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate ID");
3063 offset += 4;
3065 /* Gate Identifier */
3066 info_to_display(tvb,stt,offset,4,"Gate Identifier", NULL,FMT_HEX,&hf_cops_pc_gate_id);
3069 /* Cops - Section : Activity Count */
3070 static void
3071 cops_activity_count(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3073 proto_tree *stt;
3075 /* Create a subtree */
3076 stt = info_to_cops_subtree(tvb,st,n,offset,"Activity Count");
3077 offset += 4;
3079 /* Activity Count */
3080 info_to_display(tvb,stt,offset,4,"Count", NULL,FMT_DEC,&hf_cops_pc_activity_count);
3083 /* Cops - Section : Gate Specifications */
3084 static void
3085 cops_gate_specs(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3087 proto_tree *stt;
3089 /* Create a subtree */
3090 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Specifications");
3091 offset += 4;
3093 /* Direction */
3094 info_to_display(tvb,stt,offset,1,"Direction",table_cops_direction,FMT_DEC,&hf_cops_pc_direction);
3095 offset += 1;
3097 /* Protocol ID */
3098 info_to_display(tvb,stt,offset,1,"Protocol ID",NULL,FMT_DEC,&hf_cops_pc_protocol_id);
3099 offset += 1;
3101 /* Flags */
3102 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_DEC,&hf_cops_pc_gate_spec_flags);
3103 offset += 1;
3105 /* Session Class */
3106 info_to_display(tvb,stt,offset,1,"Session Class",table_cops_session_class,FMT_DEC,&hf_cops_pc_session_class);
3107 offset += 1;
3109 /* Source IP Address */
3110 info_to_display(tvb,stt,offset,4,"Source IP Address",NULL,FMT_IPv4,&hf_cops_pc_src_ip);
3111 offset += 4;
3113 /* Destination IP Address */
3114 info_to_display(tvb,stt,offset,4,"Destination IP Address",NULL,FMT_IPv4,&hf_cops_pc_dest_ip);
3115 offset += 4;
3117 /* Source IP Port */
3118 info_to_display(tvb,stt,offset,2,"Source IP Port",NULL,FMT_DEC,&hf_cops_pc_src_port);
3119 offset += 2;
3121 /* Destination IP Port */
3122 info_to_display(tvb,stt,offset,2,"Destination IP Port",NULL,FMT_DEC,&hf_cops_pc_dest_port);
3123 offset += 2;
3125 /* DiffServ Code Point */
3126 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS)",NULL,FMT_HEX,&hf_cops_pc_ds_field);
3127 offset += 1;
3129 /* 3 octets Not specified */
3130 offset += 3;
3132 /* Timer T1 Value */
3133 info_to_display(tvb,stt,offset,2,"Timer T1 Value (sec)",NULL,FMT_DEC,&hf_cops_pc_t1_value);
3134 offset += 2;
3136 /* Reserved */
3137 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_DEC,&hf_cops_pc_reserved);
3138 offset += 2;
3140 /* Timer T7 Value */
3141 info_to_display(tvb,stt,offset,2,"Timer T7 Value (sec)",NULL,FMT_DEC,&hf_cops_pc_t7_value);
3142 offset += 2;
3144 /* Timer T8 Value */
3145 info_to_display(tvb,stt,offset,2,"Timer T8 Value (sec)",NULL,FMT_DEC,&hf_cops_pc_t8_value);
3146 offset += 2;
3148 /* Token Bucket Rate */
3149 info_to_display(tvb,stt,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3150 offset += 4;
3152 /* Token Bucket Size */
3153 info_to_display(tvb,stt,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3154 offset += 4;
3156 /* Peak Data Rate */
3157 info_to_display(tvb,stt,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3158 offset += 4;
3160 /* Minimum Policed Unit */
3161 info_to_display(tvb,stt,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3162 offset += 4;
3164 /* Maximum Packet Size */
3165 info_to_display(tvb,stt,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3166 offset += 4;
3168 /* Rate */
3169 info_to_display(tvb,stt,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3170 offset += 4;
3172 /* Slack Term */
3173 info_to_display(tvb,stt,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3176 /* Cops - Section : Electronic Surveillance Parameters */
3177 static void
3178 cops_surveillance_parameters(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3180 proto_tree *stt;
3181 guint8 *bcid_str;
3183 /* Create a subtree */
3184 stt = info_to_cops_subtree(tvb,st,n,offset,"Electronic Surveillance Parameters");
3185 offset += 4;
3187 /* DF IP Address for CDC */
3188 info_to_display(tvb,stt,offset,4,"DF IP Address for CDC", NULL,FMT_IPv4,&hf_cops_pc_dfcdc_ip);
3189 offset += 4;
3191 /* DF IP Port for CDC */
3192 info_to_display(tvb,stt,offset,2,"DF IP Port for CDC",NULL,FMT_DEC,&hf_cops_pc_dfcdc_ip_port);
3193 offset += 2;
3195 /* Flags */
3196 info_to_display(tvb,stt,offset,2,"Flags",NULL,FMT_HEX,&hf_cops_pc_gate_spec_flags);
3197 offset += 2;
3199 /* DF IP Address for CCC */
3200 info_to_display(tvb,stt,offset,4,"DF IP Address for CCC", NULL,FMT_IPv4,&hf_cops_pc_dfccc_ip);
3201 offset += 4;
3203 /* DF IP Port for CCC */
3204 info_to_display(tvb,stt,offset,2,"DF IP Port for CCC",NULL,FMT_DEC,&hf_cops_pc_dfccc_ip_port);
3205 offset += 2;
3207 /* Reserved */
3208 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3209 offset += 2;
3211 /* CCCID */
3212 info_to_display(tvb,stt,offset,4,"CCCID", NULL,FMT_DEC,&hf_cops_pc_dfccc_id);
3213 offset += 4;
3215 /* BCID Timestamp */
3216 info_to_display(tvb,stt,offset,4,"BCID - Timestamp",NULL,FMT_HEX,&hf_cops_pc_bcid_ts);
3217 offset += 4;
3219 /* BCID Element ID */
3220 bcid_str = (guchar*)tvb_format_text(tvb, offset, 8);
3221 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Element ID",bcid_str);
3222 offset += 8;
3224 /* BCID Time Zone */
3225 bcid_str = (guchar*)tvb_format_text(tvb, offset, 8);
3226 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Time Zone",bcid_str);
3227 offset += 8;
3229 /* BCID Event Counter */
3230 info_to_display(tvb,stt,offset,4,"BCID - Event Counter",NULL,FMT_DEC,&hf_cops_pc_bcid_ev);
3233 /* Cops - Section : Event Gereration-Info */
3234 static void
3235 cops_event_generation_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3237 proto_tree *stt;
3238 guint8 *bcid_str;
3240 /* Create a subtree */
3241 stt = info_to_cops_subtree(tvb,st,n,offset,"Event Generation Info");
3242 offset += 4;
3244 /* Primary Record Keeping Server IP Address */
3245 info_to_display(tvb,stt,offset,4,"PRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_prks_ip);
3246 offset += 4;
3248 /* Primary Record Keeping Server IP Port */
3249 info_to_display(tvb,stt,offset,2,"PRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_prks_ip_port);
3250 offset += 2;
3252 /* Flags */
3253 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_HEX,&hf_cops_pc_gate_spec_flags);
3254 offset += 1;
3256 /* Reserved */
3257 info_to_display(tvb,stt,offset,1,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3258 offset += 1;
3260 /* Secondary Record Keeping Server IP Address */
3261 info_to_display(tvb,stt,offset,4,"SRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_srks_ip);
3262 offset += 4;
3264 /* Secondary Record Keeping Server IP Port */
3265 info_to_display(tvb,stt,offset,2,"SRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_srks_ip_port);
3266 offset += 2;
3268 /* Flags */
3269 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_DEC,&hf_cops_pc_gate_spec_flags);
3270 offset += 1;
3272 /* Reserved */
3273 info_to_display(tvb,stt,offset,1,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3274 offset += 1;
3276 /* BCID Timestamp */
3277 info_to_display(tvb,stt,offset,4,"BCID - Timestamp",NULL,FMT_HEX,&hf_cops_pc_bcid_ts);
3278 offset += 4;
3280 /* BCID Element ID */
3281 bcid_str = (guchar*)tvb_format_text(tvb, offset, 8);
3282 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Element ID",bcid_str);
3283 offset += 8;
3285 /* BCID Time Zone */
3286 bcid_str = (guchar*)tvb_format_text(tvb, offset, 8);
3287 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Time Zone",bcid_str);
3288 offset += 8;
3290 /* BCID Event Counter */
3291 info_to_display(tvb,stt,offset,4,"BCID - Event Counter",NULL,FMT_DEC,&hf_cops_pc_bcid_ev);
3294 /* Cops - Section : Remote Gate */
3295 static void
3296 cops_remote_gate_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3298 proto_tree *stt;
3300 /* Create a subtree */
3301 stt = info_to_cops_subtree(tvb,st,n,offset,"Remote Gate Info");
3302 offset += 4;
3304 /* CMTS IP Address */
3305 info_to_display(tvb,stt,offset,4,"CMTS IP Address", NULL,FMT_IPv4,&hf_cops_pc_cmts_ip);
3306 offset += 4;
3308 /* CMTS IP Port */
3309 info_to_display(tvb,stt,offset,2,"CMTS IP Port",NULL,FMT_DEC,&hf_cops_pc_cmts_ip_port);
3310 offset += 2;
3312 /* Flags */
3313 info_to_display(tvb,stt,offset,2,"Flags",NULL,FMT_DEC,&hf_cops_pc_remote_flags);
3314 offset += 2;
3316 /* Remote Gate ID */
3317 info_to_display(tvb,stt,offset,4,"Remote Gate ID", NULL,FMT_HEX,&hf_cops_pc_remote_gate_id);
3318 offset += 4;
3320 /* Algorithm */
3321 info_to_display(tvb,stt,offset,2,"Algorithm", NULL,FMT_DEC,&hf_cops_pc_algorithm);
3322 offset += 2;
3324 /* Reserved */
3325 info_to_display(tvb,stt,offset,4,"Reserved", NULL,FMT_HEX,&hf_cops_pc_reserved);
3326 offset += 4;
3328 /* Security Key */
3329 info_to_display(tvb,stt,offset,4,"Security Key", NULL,FMT_HEX,&hf_cops_pc_key);
3330 offset += 4;
3332 /* Security Key */
3333 info_to_display(tvb,stt,offset,4,"Security Key (cont)", NULL,FMT_HEX,&hf_cops_pc_key);
3334 offset += 4;
3336 /* Security Key */
3337 info_to_display(tvb,stt,offset,4,"Security Key (cont)", NULL,FMT_HEX,&hf_cops_pc_key);
3338 offset += 4;
3340 /* Security Key */
3341 info_to_display(tvb,stt,offset,4,"Security Key (cont)", NULL,FMT_HEX,&hf_cops_pc_key);
3344 /* Cops - Section : PacketCable reason */
3345 static void
3346 cops_packetcable_reason(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3348 proto_tree *stt;
3349 guint16 code16;
3351 /* Create a subtree */
3352 stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Reason");
3353 offset += 4;
3355 /* Reason Code */
3356 code16 = tvb_get_ntohs(tvb,offset);
3357 proto_tree_add_uint_format(stt, hf_cops_pc_reason_code,tvb, offset, 2,
3358 code16, "%-28s : %s (%u)","Reason Code",
3359 val_to_str(code16, table_cops_reason_code, "Unknown (0x%04x)"),code16);
3360 offset += 2;
3362 if ( code16 == 0 ) {
3363 /* Reason Sub Code with Delete */
3364 info_to_display(tvb,stt,offset,2,"Reason Sub Code",table_cops_reason_subcode_delete,FMT_DEC,&hf_cops_pc_delete_subcode);
3365 } else {
3366 /* Reason Sub Code with Close */
3367 info_to_display(tvb,stt,offset,2,"Reason Sub Code",table_cops_reason_subcode_close,FMT_DEC,&hf_cops_pc_close_subcode);
3371 /* Cops - Section : PacketCable error */
3372 static void
3373 cops_packetcable_error(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3375 proto_tree *stt;
3377 /* Create a subtree */
3378 stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Error");
3379 offset += 4;
3381 /* Error Code */
3382 info_to_display(tvb,stt,offset,2,"Error Code",table_cops_packetcable_error,FMT_DEC,&hf_cops_pc_packetcable_err_code);
3383 offset += 2;
3385 /* Error Sub Code */
3386 info_to_display(tvb,stt,offset,2,"Error Sub Code",NULL,FMT_HEX,&hf_cops_pc_packetcable_sub_code);
3390 /* Cops - Section : Multimedia Transaction ID */
3391 static void
3392 cops_mm_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8 op_code, guint n, guint32 offset) {
3394 proto_tree *stt;
3395 guint16 code16;
3396 char info[50];
3398 /* Create a subtree */
3399 stt = info_to_cops_subtree(tvb,st,n,offset,"MM Transaction ID");
3400 offset += 4;
3402 /* Transaction Identifier */
3403 info_to_display(tvb,stt,offset,2,"Multimedia Transaction Identifier", NULL,FMT_DEC,&hf_cops_pc_transaction_id);
3404 offset +=2;
3406 /* Gate Command Type */
3407 code16 = tvb_get_ntohs(tvb,offset);
3408 proto_tree_add_uint_format(stt, hf_cops_pc_gate_command_type,tvb, offset, 2,
3409 code16,"%-28s : %s (%u)", "Gate Command Type",
3410 val_to_str(code16,table_cops_mm_transaction_id, "Unknown (0x%04x)"),code16);
3412 /* Write the right data into the 'info field' on the Gui */
3413 g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
3414 val_to_str_const(code16,table_cops_mm_transaction_id, "Unknown"));
3416 col_add_str(pinfo->cinfo, COL_INFO,info);
3419 /* Cops - Section : AMID */
3420 static void
3421 cops_amid(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3423 proto_tree *stt;
3425 /* Create a subtree */
3426 stt = info_to_cops_subtree(tvb,st,n,offset,"AMID");
3427 offset += 4;
3429 /* Application Type */
3430 info_to_display(tvb,stt,offset,2,"Application Manager ID Application Type", NULL,FMT_DEC,&hf_cops_pcmm_amid_app_type);
3431 offset += 2;
3433 /* Application Manager Tag */
3434 info_to_display(tvb,stt,offset,2,"Application Manager ID Application Manager Tag", NULL,FMT_DEC,&hf_cops_pcmm_amid_am_tag);
3439 /* Cops - Section : Multimedia Gate Specifications */
3440 static int
3441 cops_mm_gate_spec(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3442 proto_item *ti;
3443 proto_tree *stt, *object_tree;
3445 /* Create a subtree */
3446 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Spec");
3447 offset += 4;
3449 /* Flags */
3450 ti = info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_HEX,&hf_cops_pcmm_gate_spec_flags);
3451 object_tree = proto_item_add_subtree(ti, ett_cops_subtree );
3452 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_flags_gate, tvb, offset, 1, ENC_BIG_ENDIAN);
3453 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_flags_dscp_overwrite, tvb, offset, 1, ENC_BIG_ENDIAN);
3454 offset += 1;
3456 /* DiffServ Code Point */
3457 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS)",NULL,FMT_HEX,&hf_cops_pcmm_gate_spec_dscp_tos_field);
3458 offset += 1;
3460 /* DiffServ Code Point Mask */
3461 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS) Mask",NULL,FMT_HEX,&hf_cops_pcmm_gate_spec_dscp_tos_mask);
3462 offset += 1;
3464 /* Session Class */
3465 ti = info_to_display(tvb,stt,offset,1,"Session Class",table_cops_session_class,FMT_DEC,&hf_cops_pcmm_gate_spec_session_class_id);
3466 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3467 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_session_class_id_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
3468 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_session_class_id_preemption, tvb, offset, 1, ENC_BIG_ENDIAN);
3469 proto_tree_add_item(object_tree, hf_cops_pcmm_gate_spec_session_class_id_configurable, tvb, offset, 1, ENC_BIG_ENDIAN);
3470 offset += 1;
3472 /* Timer T1 Value */
3473 info_to_display(tvb,stt,offset,2,"Timer T1 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t1);
3474 offset += 2;
3476 /* Timer T2 Value */
3477 info_to_display(tvb,stt,offset,2,"Timer T2 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t2);
3478 offset += 2;
3480 /* Timer T3 Value */
3481 info_to_display(tvb,stt,offset,2,"Timer T3 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t3);
3482 offset += 2;
3484 /* Timer T4 Value */
3485 info_to_display(tvb,stt,offset,2,"Timer T4 Value (sec)",NULL,FMT_DEC,&hf_cops_pcmm_gate_spec_timer_t4);
3486 offset += 2;
3488 return offset;
3491 /* Cops - Section : Classifier */
3492 static int
3493 cops_classifier(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset, gboolean extended) {
3495 proto_tree *stt;
3497 /* Create a subtree */
3498 stt = info_to_cops_subtree(tvb,st,n,offset,
3499 extended ? "Extended Classifier" : "Classifier");
3500 offset += 4;
3502 /* Protocol ID */
3503 info_to_display(tvb,stt,offset,2,"Protocol ID",NULL,FMT_DEC,&hf_cops_pcmm_classifier_protocol_id);
3504 offset += 2;
3506 /* DiffServ Code Point */
3507 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS)",NULL,FMT_HEX,&hf_cops_pcmm_classifier_dscp_tos_field);
3508 offset += 1;
3510 /* DiffServ Code Point Mask */
3511 info_to_display(tvb,stt,offset,1,"DS Field (DSCP or TOS) Mask",NULL,FMT_HEX,&hf_cops_pcmm_classifier_dscp_tos_mask);
3512 offset += 1;
3514 /* Source IP Address */
3515 info_to_display(tvb,stt,offset,4,"Source IP Address",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_src_addr);
3516 offset += 4;
3518 if (extended) {
3519 /* Source Mask */
3520 info_to_display(tvb,stt,offset,4,"Source Mask",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_src_mask);
3521 offset += 4;
3524 /* Destination IP Address */
3525 info_to_display(tvb,stt,offset,4,"Destination IP Address",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_dst_addr);
3526 offset += 4;
3528 if (extended) {
3529 /* Destination Mask */
3530 info_to_display(tvb,stt,offset,4,"Destination Mask",NULL,FMT_IPv4,&hf_cops_pcmm_classifier_dst_mask);
3531 offset += 4;
3534 /* Source IP Port */
3535 info_to_display(tvb,stt,offset,2,"Source IP Port",NULL,FMT_DEC,&hf_cops_pcmm_classifier_src_port);
3536 offset += 2;
3538 if (extended) {
3539 /* Source Port End */
3540 info_to_display(tvb,stt,offset,2,"Source Port End",NULL,FMT_DEC,&hf_cops_pcmm_classifier_src_port_end);
3541 offset += 2;
3544 /* Destination IP Port */
3545 info_to_display(tvb,stt,offset,2,"Destination IP Port",NULL,FMT_DEC,&hf_cops_pcmm_classifier_dst_port);
3546 offset += 2;
3548 if (extended) {
3549 /* Destination Port End */
3550 info_to_display(tvb,stt,offset,2,"Destination Port End",NULL,FMT_DEC,&hf_cops_pcmm_classifier_dst_port_end);
3551 offset += 2;
3554 if (extended) {
3555 /* ClassifierID */
3556 info_to_display(tvb,stt,offset,2,"ClassifierID",NULL,FMT_HEX,&hf_cops_pcmm_classifier_classifier_id);
3557 offset += 2;
3560 /* Priority */
3561 info_to_display(tvb,stt,offset,1,"Priority",NULL,FMT_HEX,&hf_cops_pcmm_classifier_priority);
3562 offset += 1;
3564 if (extended) {
3565 /* Activation State */
3566 info_to_display(tvb,stt,offset,1,"Activation State",NULL,FMT_HEX,&hf_cops_pcmm_classifier_activation_state);
3567 offset += 1;
3569 /* Action */
3570 info_to_display(tvb,stt,offset,1,"Action",NULL,FMT_HEX,&hf_cops_pcmm_classifier_action);
3571 offset += 1;
3574 /* 3 octets Not specified */
3575 offset += 3;
3577 return offset;
3580 /* Cops - Section : IPv6 Classifier */
3581 static int
3582 cops_ipv6_classifier(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3584 proto_tree *stt;
3586 /* Create a subtree */
3587 stt = info_to_cops_subtree(tvb,st,n,offset, "IPv6 Classifier");
3588 offset += 4;
3590 /* Reserved/Flags */
3591 info_to_display(tvb,stt,offset,1,"Flags",NULL,FMT_HEX,&hf_cops_pcmm_classifier_flags);
3592 offset += 1;
3594 /* tc-low */
3595 info_to_display(tvb,stt,offset,1,"tc-low",NULL,FMT_HEX,&hf_cops_pcmm_classifier_tc_low);
3596 offset += 1;
3598 /* tc-high */
3599 info_to_display(tvb,stt,offset,1,"tc-high",NULL,FMT_HEX,&hf_cops_pcmm_classifier_tc_high);
3600 offset += 1;
3602 /* tc-mask */
3603 info_to_display(tvb,stt,offset,1,"tc-mask",NULL,FMT_HEX,&hf_cops_pcmm_classifier_tc_mask);
3604 offset += 1;
3606 /* Flow Label */
3607 info_to_display(tvb,stt,offset,4,"Flow Label",NULL,FMT_HEX,&hf_cops_pcmm_classifier_flow_label);
3608 offset += 4;
3610 /* Next Header Type */
3611 info_to_display(tvb,stt,offset,2,"Next Header Type",NULL,FMT_DEC,&hf_cops_pcmm_classifier_next_header_type);
3612 offset += 2;
3614 /* Source Prefix Length */
3615 info_to_display(tvb,stt,offset,1,"Source Prefix Length",NULL,FMT_DEC,&hf_cops_pcmm_classifier_source_prefix_length);
3616 offset += 1;
3618 /* Destination Prefix Length */
3619 info_to_display(tvb,stt,offset,1,"Destination Prefix Length",NULL,FMT_DEC,&hf_cops_pcmm_classifier_destination_prefix_length);
3620 offset += 1;
3622 /* Source IP Address */
3623 info_to_display(tvb,stt,offset,16,"IPv6 Source Address",NULL,FMT_IPv6,&hf_cops_pcmm_classifier_src_addr_v6);
3624 offset += 16;
3626 /* Destination IP Address */
3627 info_to_display(tvb,stt,offset,16,"IPv6 Destination Address",NULL,FMT_IPv6,&hf_cops_pcmm_classifier_dst_addr_v6);
3628 offset += 16;
3630 /* Source IP Port */
3631 info_to_display(tvb,stt,offset,2,"Source Port Start",NULL,FMT_DEC,&hf_cops_pcmm_classifier_src_port);
3632 offset += 2;
3634 /* Source Port End */
3635 info_to_display(tvb,stt,offset,2,"Source Port End",NULL,FMT_DEC,&hf_cops_pcmm_classifier_src_port_end);
3636 offset += 2;
3638 /* Destination IP Port */
3639 info_to_display(tvb,stt,offset,2,"Destination Port Start",NULL,FMT_DEC,&hf_cops_pcmm_classifier_dst_port);
3640 offset += 2;
3642 /* Destination Port End */
3643 info_to_display(tvb,stt,offset,2,"Destination Port End",NULL,FMT_DEC,&hf_cops_pcmm_classifier_dst_port_end);
3644 offset += 2;
3646 /* ClassifierID */
3647 info_to_display(tvb,stt,offset,2,"ClassifierID",NULL,FMT_HEX,&hf_cops_pcmm_classifier_classifier_id);
3648 offset += 2;
3650 /* Priority */
3651 info_to_display(tvb,stt,offset,1,"Priority",NULL,FMT_HEX,&hf_cops_pcmm_classifier_priority);
3652 offset += 1;
3654 /* Activation State */
3655 info_to_display(tvb,stt,offset,1,"Activation State",NULL,FMT_HEX,&hf_cops_pcmm_classifier_activation_state);
3656 offset += 1;
3658 /* Action */
3659 info_to_display(tvb,stt,offset,1,"Action",NULL,FMT_HEX,&hf_cops_pcmm_classifier_action);
3660 offset += 1;
3662 /* 3 octets Not specified */
3663 offset += 3;
3665 return offset;
3668 /* Cops - Section : Gate Specifications */
3669 static int
3670 cops_flow_spec(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
3671 proto_item *ti;
3672 proto_tree *stt, *object_tree;
3674 /* Create a subtree */
3675 stt = info_to_cops_subtree(tvb,st,n,offset,"Flow Spec");
3676 offset += 4;
3678 /* Envelope */
3679 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_flow_spec_envelope);
3680 offset += 1;
3682 /* Service Number */
3683 info_to_display(tvb,stt,offset,1,"Service Number",NULL,FMT_DEC,&hf_cops_pcmm_flow_spec_service_number);
3684 offset += 1;
3686 /* Reserved */
3687 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
3688 offset += 2;
3690 /* Authorized Envelope */
3691 ti = proto_tree_add_text(stt, tvb, offset, 28, "Authorized Envelope");
3692 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3694 /* Token Bucket Rate */
3695 info_to_display(tvb,object_tree,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3696 offset += 4;
3698 /* Token Bucket Size */
3699 info_to_display(tvb,object_tree,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3700 offset += 4;
3702 /* Peak Data Rate */
3703 info_to_display(tvb,object_tree,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3704 offset += 4;
3706 /* Minimum Policed Unit */
3707 info_to_display(tvb,object_tree,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3708 offset += 4;
3710 /* Maximum Packet Size */
3711 info_to_display(tvb,object_tree,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3712 offset += 4;
3714 /* Rate */
3715 info_to_display(tvb,object_tree,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3716 offset += 4;
3718 /* Slack Term */
3719 info_to_display(tvb,object_tree,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3720 offset += 4;
3722 if (n < 64) return offset;
3724 /* Reserved Envelope */
3725 ti = proto_tree_add_text(stt, tvb, offset, 28, "Reserved Envelope");
3726 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3728 /* Token Bucket Rate */
3729 info_to_display(tvb,object_tree,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3730 offset += 4;
3732 /* Token Bucket Size */
3733 info_to_display(tvb,object_tree,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3734 offset += 4;
3736 /* Peak Data Rate */
3737 info_to_display(tvb,object_tree,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3738 offset += 4;
3740 /* Minimum Policed Unit */
3741 info_to_display(tvb,object_tree,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3742 offset += 4;
3744 /* Maximum Packet Size */
3745 info_to_display(tvb,object_tree,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3746 offset += 4;
3748 /* Rate */
3749 info_to_display(tvb,object_tree,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3750 offset += 4;
3752 /* Slack Term */
3753 info_to_display(tvb,object_tree,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3754 offset += 4;
3756 if (n < 92) return offset;
3758 /* Committed Envelope */
3759 ti = proto_tree_add_text(stt, tvb, offset, 28, "Committed Envelope");
3760 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3762 /* Token Bucket Rate */
3763 info_to_display(tvb,object_tree,offset,4,"Token Bucket Rate",NULL,FMT_FLT,&hf_cops_pc_token_bucket_rate);
3764 offset += 4;
3766 /* Token Bucket Size */
3767 info_to_display(tvb,object_tree,offset,4,"Token Bucket Size",NULL,FMT_FLT,&hf_cops_pc_token_bucket_size);
3768 offset += 4;
3770 /* Peak Data Rate */
3771 info_to_display(tvb,object_tree,offset,4,"Peak Data Rate",NULL,FMT_FLT,&hf_cops_pc_peak_data_rate);
3772 offset += 4;
3774 /* Minimum Policed Unit */
3775 info_to_display(tvb,object_tree,offset,4,"Minimum Policed Unit",NULL,FMT_DEC,&hf_cops_pc_min_policed_unit);
3776 offset += 4;
3778 /* Maximum Packet Size */
3779 info_to_display(tvb,object_tree,offset,4,"Maximum Packet Size",NULL,FMT_DEC,&hf_cops_pc_max_packet_size);
3780 offset += 4;
3782 /* Rate */
3783 info_to_display(tvb,object_tree,offset,4,"Rate",NULL,FMT_FLT,&hf_cops_pc_spec_rate);
3784 offset += 4;
3786 /* Slack Term */
3787 info_to_display(tvb,object_tree,offset,4,"Slack Term",NULL,FMT_DEC,&hf_cops_pc_slack_term);
3788 offset += 4;
3790 return offset;
3793 /* Cops - Section : DOCSIS Service Class Name */
3794 static int
3795 cops_docsis_service_class_name(tvbuff_t *tvb, proto_tree *st, guint object_len, guint32 offset) {
3797 proto_tree *stt;
3799 /* Create a subtree */
3800 stt = info_to_cops_subtree(tvb,st,object_len,offset,"DOCSIS Service Class Name");
3801 offset += 4;
3803 /* Envelope */
3804 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3805 offset += 1;
3807 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3808 offset += 3;
3810 if (object_len >= 12) {
3811 proto_tree_add_item(stt, hf_cops_pcmm_docsis_scn, tvb, offset, object_len - 8, ENC_ASCII|ENC_NA);
3812 offset += object_len - 8;
3813 } else {
3814 proto_tree_add_text(stt, tvb, offset - 8, 2, "Invalid object length: %u", object_len);
3817 return offset;
3820 /* New functions were made with the i04 suffix to maintain backward compatibility with I03
3822 * BEGIN PCMM I04
3826 /* Cops - Section : Best Effort Service */
3827 static int
3828 cops_best_effort_service_i04_i05(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset, gboolean i05) {
3829 proto_item *ti;
3830 proto_tree *stt, *object_tree;
3832 /* Create a subtree */
3833 stt = info_to_cops_subtree(tvb,st,n,offset,"Best Effort Service");
3834 offset += 4;
3836 /* Envelope */
3837 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
3838 offset += 1;
3840 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3841 offset += 3;
3843 /* Authorized Envelope */
3844 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 36 : 32, "Authorized Envelope");
3845 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3847 /* Traffic Priority */
3848 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3849 offset += 1;
3851 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3852 offset += 3;
3854 /* Request Transmission Policy */
3855 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3856 offset += 4;
3858 /* Maximum Sustained Traffic Rate */
3859 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3860 offset += 4;
3862 /* Maximum Traffic Burst */
3863 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3864 offset += 4;
3866 /* Minimum Reserved Traffic Rate */
3867 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3868 offset += 4;
3870 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3871 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);
3872 offset += 2;
3874 /* Maximum Concatenated Burst */
3875 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
3876 offset += 2;
3878 /* Required Attribute Mask */
3879 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
3880 offset += 4;
3882 /* Forbidden Attribute Mask */
3883 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
3884 offset += 4;
3886 if (i05) {
3887 /* Attribute Aggregation Rule Mask */
3888 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
3889 offset += 4;
3892 if (n < 56) return offset;
3894 /* Reserved Envelope */
3895 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 36 : 32, "Reserved Envelope");
3896 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3898 /* Traffic Priority */
3899 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3900 offset += 1;
3902 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3903 offset += 3;
3905 /* Request Transmission Policy */
3906 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3907 offset += 4;
3909 /* Maximum Sustained Traffic Rate */
3910 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3911 offset += 4;
3913 /* Maximum Traffic Burst */
3914 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3915 offset += 4;
3917 /* Minimum Reserved Traffic Rate */
3918 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3919 offset += 4;
3921 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3922 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);
3923 offset += 2;
3925 /* Maximum Concatenated Burst */
3926 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
3927 offset += 2;
3929 /* Required Attribute Mask */
3930 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
3931 offset += 4;
3933 /* Forbidden Attribute Mask */
3934 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
3935 offset += 4;
3937 if (i05) {
3938 /* Attribute Aggregation Rule Mask */
3939 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
3940 offset += 4;
3943 if (n < 80) return offset;
3945 /* Committed Envelope */
3946 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 36 : 32, "Committed Envelope");
3947 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
3949 /* Traffic Priority */
3950 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
3951 offset += 1;
3953 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3954 offset += 3;
3956 /* Request Transmission Policy */
3957 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
3958 offset += 4;
3960 /* Maximum Sustained Traffic Rate */
3961 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
3962 offset += 4;
3964 /* Maximum Traffic Burst */
3965 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
3966 offset += 4;
3968 /* Minimum Reserved Traffic Rate */
3969 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
3970 offset += 4;
3972 /* Assumed Minimum Reserved Traffic Rate Packet Size */
3973 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);
3974 offset += 2;
3976 /* Maximum Concatenated Burst */
3977 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
3978 offset += 2;
3980 /* Required Attribute Mask */
3981 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
3982 offset += 4;
3984 /* Forbidden Attribute Mask */
3985 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
3986 offset += 4;
3988 if (i05) {
3989 /* Attribute Aggregation Rule Mask */
3990 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
3991 offset += 4;
3994 return offset;
3997 /* Cops - Section : Non-Real-Time Polling Service */
3998 static int
3999 cops_non_real_time_polling_service_i04_i05(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset, gboolean i05) {
4000 proto_item *ti;
4001 proto_tree *stt, *object_tree;
4003 /* Create a subtree */
4004 stt = info_to_cops_subtree(tvb,st,n,offset,"Non-Real-Time Polling Service");
4005 offset += 4;
4007 /* Envelope */
4008 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4009 offset += 1;
4011 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4012 offset += 3;
4014 /* Authorized Envelope */
4015 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 40 : 36, "Authorized Envelope");
4016 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4018 /* Traffic Priority */
4019 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4020 offset += 1;
4022 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4023 offset += 3;
4025 /* Request Transmission Policy */
4026 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4027 offset += 4;
4029 /* Maximum Sustained Traffic Rate */
4030 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4031 offset += 4;
4033 /* Maximum Traffic Burst */
4034 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4035 offset += 4;
4037 /* Minimum Reserved Traffic Rate */
4038 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4039 offset += 4;
4041 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4042 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);
4043 offset += 2;
4045 /* Maximum Concatenated Burst */
4046 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4047 offset += 2;
4049 /* Nominal Polling Interval */
4050 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4051 offset += 4;
4053 /* Required Attribute Mask */
4054 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4055 offset += 4;
4057 /* Forbidden Attribute Mask */
4058 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4059 offset += 4;
4061 if (i05) {
4062 /* Attribute Aggregation Rule Mask */
4063 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4064 offset += 4;
4067 if (n < 64) return offset;
4069 /* Reserved Envelope */
4070 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 40 : 36, "Reserved Envelope");
4071 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4073 /* Traffic Priority */
4074 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4075 offset += 1;
4077 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4078 offset += 3;
4080 /* Request Transmission Policy */
4081 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4082 offset += 4;
4084 /* Maximum Sustained Traffic Rate */
4085 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4086 offset += 4;
4088 /* Maximum Traffic Burst */
4089 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4090 offset += 4;
4092 /* Minimum Reserved Traffic Rate */
4093 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4094 offset += 4;
4096 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4097 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);
4098 offset += 2;
4100 /* Maximum Concatenated Burst */
4101 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4102 offset += 2;
4104 /* Nominal Polling Interval */
4105 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4106 offset += 4;
4108 /* Required Attribute Mask */
4109 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4110 offset += 4;
4112 /* Forbidden Attribute Mask */
4113 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4114 offset += 4;
4116 if (i05) {
4117 /* Attribute Aggregation Rule Mask */
4118 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4119 offset += 4;
4122 if (n < 92) return offset;
4124 /* Committed Envelope */
4125 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 40 : 36, "Committed Envelope");
4126 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4128 /* Traffic Priority */
4129 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4130 offset += 1;
4132 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4133 offset += 3;
4135 /* Request Transmission Policy */
4136 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4137 offset += 4;
4139 /* Maximum Sustained Traffic Rate */
4140 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4141 offset += 4;
4143 /* Maximum Traffic Burst */
4144 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4145 offset += 4;
4147 /* Minimum Reserved Traffic Rate */
4148 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4149 offset += 4;
4151 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4152 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);
4153 offset += 2;
4155 /* Maximum Concatenated Burst */
4156 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4157 offset += 2;
4159 /* Nominal Polling Interval */
4160 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4161 offset += 4;
4163 /* Required Attribute Mask */
4164 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4165 offset += 4;
4167 /* Forbidden Attribute Mask */
4168 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4169 offset += 4;
4171 if (i05) {
4172 /* Attribute Aggregation Rule Mask */
4173 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4174 offset += 4;
4177 return offset;
4180 /* Cops - Section : Real-Time Polling Service */
4181 static int
4182 cops_real_time_polling_service_i04_i05(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset, gboolean i05) {
4183 proto_item *ti;
4184 proto_tree *stt, *object_tree;
4186 /* Create a subtree */
4187 stt = info_to_cops_subtree(tvb,st,n,offset,"Real-Time Polling Service");
4188 offset += 4;
4190 /* Envelope */
4191 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4192 offset += 1;
4194 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4195 offset += 3;
4197 /* Authorized Envelope */
4198 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 40 : 36, "Authorized Envelope");
4199 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4201 /* Request Transmission Policy */
4202 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4203 offset += 4;
4205 /* Maximum Sustained Traffic Rate */
4206 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4207 offset += 4;
4209 /* Maximum Traffic Burst */
4210 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4211 offset += 4;
4213 /* Minimum Reserved Traffic Rate */
4214 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4215 offset += 4;
4217 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4218 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);
4219 offset += 2;
4221 /* Maximum Concatenated Burst */
4222 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4223 offset += 2;
4225 /* Nominal Polling Interval */
4226 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4227 offset += 4;
4229 /* Tolerated Poll Jitter */
4230 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4231 offset += 4;
4233 /* Required Attribute Mask */
4234 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4235 offset += 4;
4237 /* Forbidden Attribute Mask */
4238 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4239 offset += 4;
4241 if (i05) {
4242 /* Attribute Aggregation Rule Mask */
4243 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4244 offset += 4;
4247 if (n < 64) return offset;
4249 /* Reserved Envelope */
4250 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 40 : 36, "Reserved Envelope");
4251 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4253 /* Request Transmission Policy */
4254 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4255 offset += 4;
4257 /* Maximum Sustained Traffic Rate */
4258 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4259 offset += 4;
4261 /* Maximum Traffic Burst */
4262 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4263 offset += 4;
4265 /* Minimum Reserved Traffic Rate */
4266 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4267 offset += 4;
4269 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4270 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);
4271 offset += 2;
4273 /* Maximum Concatenated Burst */
4274 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4275 offset += 2;
4277 /* Nominal Polling Interval */
4278 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4279 offset += 4;
4281 /* Tolerated Poll Jitter */
4282 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4283 offset += 4;
4285 /* Required Attribute Mask */
4286 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4287 offset += 4;
4289 /* Forbidden Attribute Mask */
4290 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4291 offset += 4;
4293 if (i05) {
4294 /* Attribute Aggregation Rule Mask */
4295 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4296 offset += 4;
4299 if (n < 92) return offset;
4301 /* Committed Envelope */
4302 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 40 : 36, "Committed Envelope");
4303 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4305 /* Request Transmission Policy */
4306 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4307 offset += 4;
4309 /* Maximum Sustained Traffic Rate */
4310 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4311 offset += 4;
4313 /* Maximum Traffic Burst */
4314 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4315 offset += 4;
4317 /* Minimum Reserved Traffic Rate */
4318 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4319 offset += 4;
4321 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4322 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);
4323 offset += 2;
4325 /* Maximum Concatenated Burst */
4326 info_to_display(tvb,object_tree,offset,2,"Maximum Concatenated Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_concat_burst);
4327 offset += 2;
4329 /* Nominal Polling Interval */
4330 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4331 offset += 4;
4333 /* Tolerated Poll Jitter */
4334 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4335 offset += 4;
4337 /* Required Attribute Mask */
4338 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4339 offset += 4;
4341 /* Forbidden Attribute Mask */
4342 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4343 offset += 4;
4345 if (i05) {
4346 /* Attribute Aggregation Rule Mask */
4347 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4348 offset += 4;
4351 return offset;
4354 /* Cops - Section : Unsolicited Grant Service */
4355 static int
4356 cops_unsolicited_grant_service_i04_i05(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset, gboolean i05) {
4357 proto_item *ti;
4358 proto_tree *stt, *object_tree;
4360 /* Create a subtree */
4361 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service");
4362 offset += 4;
4364 /* Envelope */
4365 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4366 offset += 1;
4368 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4369 offset += 3;
4371 /* Authorized Envelope */
4372 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 28 : 24, "Authorized Envelope");
4373 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4375 /* Request Transmission Policy */
4376 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4377 offset += 4;
4379 /* Unsolicited Grant Size */
4380 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4381 offset += 2;
4383 /* Grants Per Interval */
4384 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4385 offset += 1;
4387 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
4388 offset += 1;
4390 /* Nominal Grant Interval */
4391 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4392 offset += 4;
4394 /* Tolerated Grant Jitter */
4395 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4396 offset += 4;
4398 /* Required Attribute Mask */
4399 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4400 offset += 4;
4402 /* Forbidden Attribute Mask */
4403 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4404 offset += 4;
4406 if (i05) {
4407 /* Attribute Aggregation Rule Mask */
4408 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4409 offset += 4;
4412 if (n < 40) return offset;
4414 /* Reserved Envelope */
4415 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 28 : 24, "Reserved Envelope");
4416 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4418 /* Request Transmission Policy */
4419 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4420 offset += 4;
4422 /* Unsolicited Grant Size */
4423 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4424 offset += 2;
4426 /* Grants Per Interval */
4427 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4428 offset += 1;
4430 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
4431 offset += 1;
4433 /* Nominal Grant Interval */
4434 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4435 offset += 4;
4437 /* Tolerated Grant Jitter */
4438 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4439 offset += 4;
4441 /* Required Attribute Mask */
4442 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4443 offset += 4;
4445 /* Forbidden Attribute Mask */
4446 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4447 offset += 4;
4449 if (i05) {
4450 /* Attribute Aggregation Rule Mask */
4451 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4452 offset += 4;
4455 if (n < 56) return offset;
4457 /* Committed Envelope */
4458 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 28 : 24, "Committed Envelope");
4459 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4461 /* Request Transmission Policy */
4462 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4463 offset += 4;
4465 /* Unsolicited Grant Size */
4466 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4467 offset += 2;
4469 /* Grants Per Interval */
4470 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4471 offset += 1;
4473 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
4474 offset += 1;
4476 /* Nominal Grant Interval */
4477 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4478 offset += 4;
4480 /* Tolerated Grant Jitter */
4481 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4482 offset += 4;
4484 /* Required Attribute Mask */
4485 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4486 offset += 4;
4488 /* Forbidden Attribute Mask */
4489 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4490 offset += 4;
4492 if (i05) {
4493 /* Attribute Aggregation Rule Mask */
4494 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4495 offset += 4;
4498 return offset;
4501 /* Cops - Section : Unsolicited Grant Service with Activity Detection */
4502 static int
4503 cops_ugs_with_activity_detection_i04_i05(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset, gboolean i05) {
4504 proto_item *ti;
4505 proto_tree *stt, *object_tree;
4507 /* Create a subtree */
4508 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service with Activity Detection");
4509 offset += 4;
4511 /* Envelope */
4512 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4513 offset += 1;
4515 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4516 offset += 3;
4518 /* Authorized Envelope */
4519 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 36 : 32, "Authorized Envelope");
4520 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4522 /* Request Transmission Policy */
4523 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4524 offset += 4;
4526 /* Unsolicited Grant Size */
4527 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4528 offset += 2;
4530 /* Grants Per Interval */
4531 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4532 offset += 1;
4534 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
4535 offset += 1;
4537 /* Nominal Grant Interval */
4538 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4539 offset += 4;
4541 /* Tolerated Grant Jitter */
4542 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4543 offset += 4;
4545 /* Nominal Polling Interval */
4546 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4547 offset += 4;
4549 /* Tolerated Poll Jitter */
4550 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4551 offset += 4;
4553 /* Required Attribute Mask */
4554 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4555 offset += 4;
4557 /* Forbidden Attribute Mask */
4558 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4559 offset += 4;
4561 if (i05) {
4562 /* Attribute Aggregation Rule Mask */
4563 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4564 offset += 4;
4567 if (n < 56) return offset;
4569 /* Reserved Envelope */
4570 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 36 : 32, "Reserved Envelope");
4571 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4573 /* Request Transmission Policy */
4574 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4575 offset += 4;
4577 /* Unsolicited Grant Size */
4578 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4579 offset += 2;
4581 /* Grants Per Interval */
4582 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4583 offset += 1;
4585 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
4586 offset += 1;
4588 /* Nominal Grant Interval */
4589 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4590 offset += 4;
4592 /* Tolerated Grant Jitter */
4593 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4594 offset += 4;
4596 /* Nominal Polling Interval */
4597 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4598 offset += 4;
4600 /* Tolerated Poll Jitter */
4601 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4602 offset += 4;
4604 /* Required Attribute Mask */
4605 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4606 offset += 4;
4608 /* Forbidden Attribute Mask */
4609 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4610 offset += 4;
4612 if (i05) {
4613 /* Attribute Aggregation Rule Mask */
4614 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4615 offset += 4;
4618 if (n < 80) return offset;
4620 /* Committed Envelope */
4621 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 36 : 32, "Committed Envelope");
4622 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4624 /* Request Transmission Policy */
4625 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4626 offset += 4;
4628 /* Unsolicited Grant Size */
4629 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
4630 offset += 2;
4632 /* Grants Per Interval */
4633 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
4634 offset += 1;
4636 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
4637 offset += 1;
4639 /* Nominal Grant Interval */
4640 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
4641 offset += 4;
4643 /* Tolerated Grant Jitter */
4644 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
4645 offset += 4;
4647 /* Nominal Polling Interval */
4648 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
4649 offset += 4;
4651 /* Tolerated Poll Jitter */
4652 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
4653 offset += 4;
4655 /* Required Attribute Mask */
4656 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4657 offset += 4;
4659 /* Forbidden Attribute Mask */
4660 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4661 offset += 4;
4663 if (i05) {
4664 /* Attribute Aggregation Rule Mask */
4665 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4666 offset += 4;
4669 return offset;
4672 /* Cops - Section : Downstream Service */
4673 static int
4674 cops_downstream_service_i04_i05(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset, gboolean i05) {
4675 proto_item *ti;
4676 proto_tree *stt, *object_tree;
4678 /* Create a subtree */
4679 stt = info_to_cops_subtree(tvb,st,n,offset,"Downstream Service");
4680 offset += 4;
4682 /* Envelope */
4683 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4684 offset += 1;
4686 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_NA);
4687 offset += 3;
4689 /* Authorized Envelope */
4690 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 40 : 36, "Authorized Envelope");
4691 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4693 /* Traffic Priority */
4694 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4695 offset += 1;
4697 /* Downstream Resequencing */
4698 info_to_display(tvb,object_tree,offset,1,"Downstream Resequencing",NULL,FMT_HEX,&hf_cops_pcmm_down_resequencing);
4699 offset += 1;
4701 proto_tree_add_item(object_tree, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
4702 offset += 2;
4704 /* Maximum Sustained Traffic Rate */
4705 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4706 offset += 4;
4708 /* Maximum Traffic Burst */
4709 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4710 offset += 4;
4712 /* Minimum Reserved Traffic Rate */
4713 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4714 offset += 4;
4716 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4717 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);
4718 offset += 2;
4720 /* Reserved */
4721 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4722 offset += 2;
4724 /* Maximum Downstream Latency */
4725 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
4726 offset += 4;
4728 /* Downstream Peak Traffic Rate */
4729 info_to_display(tvb,object_tree,offset,4,"Downstream Peak Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_down_peak_traffic_rate);
4730 offset += 4;
4732 /* Required Attribute Mask */
4733 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4734 offset += 4;
4736 /* Forbidden Attribute Mask */
4737 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4738 offset += 4;
4740 if (i05) {
4741 /* Attribute Aggregation Rule Mask */
4742 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4743 offset += 4;
4746 if (n < 56) return offset;
4748 /* Reserved Envelope */
4749 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 40 : 36, "Reserved Envelope");
4750 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4752 /* Traffic Priority */
4753 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4754 offset += 1;
4756 /* Downstream Resequencing */
4757 info_to_display(tvb,object_tree,offset,1,"Downstream Resequencing",NULL,FMT_HEX,&hf_cops_pcmm_down_resequencing);
4758 offset += 1;
4760 proto_tree_add_item(object_tree, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
4761 offset += 2;
4763 /* Maximum Sustained Traffic Rate */
4764 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4765 offset += 4;
4767 /* Maximum Traffic Burst */
4768 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4769 offset += 4;
4771 /* Minimum Reserved Traffic Rate */
4772 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4773 offset += 4;
4775 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4776 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);
4777 offset += 2;
4779 /* Reserved */
4780 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4781 offset += 2;
4783 /* Maximum Downstream Latency */
4784 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
4785 offset += 4;
4787 /* Downstream Peak Traffic Rate */
4788 info_to_display(tvb,object_tree,offset,4,"Downstream Peak Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_down_peak_traffic_rate);
4789 offset += 4;
4791 /* Required Attribute Mask */
4792 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4793 offset += 4;
4795 /* Forbidden Attribute Mask */
4796 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4797 offset += 4;
4799 if (i05) {
4800 /* Attribute Aggregation Rule Mask */
4801 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4802 offset += 4;
4805 if (n < 80) return offset;
4807 /* Committed Envelope */
4808 ti = proto_tree_add_text(stt, tvb, offset, i05 ? 40 : 36, "Committed Envelope");
4809 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4811 /* Traffic Priority */
4812 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4813 offset += 1;
4815 /* Downstream Resequencing */
4816 info_to_display(tvb,object_tree,offset,1,"Downstream Resequencing",NULL,FMT_HEX,&hf_cops_pcmm_down_resequencing);
4817 offset += 1;
4819 proto_tree_add_item(object_tree, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
4820 offset += 2;
4822 /* Maximum Sustained Traffic Rate */
4823 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4824 offset += 4;
4826 /* Maximum Traffic Burst */
4827 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4828 offset += 4;
4830 /* Minimum Reserved Traffic Rate */
4831 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4832 offset += 4;
4834 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4835 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);
4836 offset += 2;
4838 /* Reserved */
4839 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4840 offset += 2;
4842 /* Maximum Downstream Latency */
4843 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
4844 offset += 4;
4846 /* Downstream Peak Traffic Rate */
4847 info_to_display(tvb,object_tree,offset,4,"Downstream Peak Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_down_peak_traffic_rate);
4848 offset += 4;
4850 /* Required Attribute Mask */
4851 info_to_display(tvb,object_tree,offset,4,"Required Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_req_att_mask);
4852 offset += 4;
4854 /* Forbidden Attribute Mask */
4855 info_to_display(tvb,object_tree,offset,4,"Forbidden Attribute Mask",NULL,FMT_DEC,&hf_cops_pcmm_forbid_att_mask);
4856 offset += 4;
4858 if (i05) {
4859 /* Attribute Aggregation Rule Mask */
4860 info_to_display(tvb,object_tree,offset,4,"Attribute Aggregation Rule Mask",NULL,FMT_DEC,&hf_cops_pcmm_att_aggr_rule_mask);
4861 offset += 4;
4864 return offset;
4867 /* Cops - Section : Upstream Drop */
4868 static int
4869 cops_upstream_drop_i04(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
4870 proto_tree *stt;
4872 /* Create a subtree */
4873 stt = info_to_cops_subtree(tvb,st,n,offset,"Upstream Drop");
4874 offset += 4;
4876 /* Envelope */
4877 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4878 offset += 1;
4880 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4881 offset += 3;
4883 return offset;
4886 /* END PCMM I04 */
4888 /* Cops - Section : Best Effort Service */
4889 static int
4890 cops_best_effort_service(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
4891 proto_item *ti;
4892 proto_tree *stt, *object_tree;
4894 /* Create a subtree */
4895 stt = info_to_cops_subtree(tvb,st,n,offset,"Best Effort Service");
4896 offset += 4;
4898 /* Envelope */
4899 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
4900 offset += 1;
4902 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4903 offset += 3;
4905 /* Authorized Envelope */
4906 ti = proto_tree_add_text(stt, tvb, offset, 24, "Authorized Envelope");
4907 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4909 /* Traffic Priority */
4910 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4911 offset += 1;
4913 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4914 offset += 3;
4916 /* Request Transmission Policy */
4917 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4918 offset += 4;
4920 /* Maximum Sustained Traffic Rate */
4921 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4922 offset += 4;
4924 /* Maximum Traffic Burst */
4925 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4926 offset += 4;
4928 /* Minimum Reserved Traffic Rate */
4929 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4930 offset += 4;
4932 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4933 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);
4934 offset += 2;
4936 /* Reserved */
4937 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4938 offset += 2;
4940 if (n < 56) return offset;
4942 /* Reserved Envelope */
4943 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
4944 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4946 /* Traffic Priority */
4947 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4948 offset += 1;
4950 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4951 offset += 3;
4953 /* Request Transmission Policy */
4954 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4955 offset += 4;
4957 /* Maximum Sustained Traffic Rate */
4958 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4959 offset += 4;
4961 /* Maximum Traffic Burst */
4962 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
4963 offset += 4;
4965 /* Minimum Reserved Traffic Rate */
4966 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
4967 offset += 4;
4969 /* Assumed Minimum Reserved Traffic Rate Packet Size */
4970 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);
4971 offset += 2;
4973 /* Reserved */
4974 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
4975 offset += 2;
4977 if (n < 80) return offset;
4979 /* Committed Envelope */
4980 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
4981 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
4983 /* Traffic Priority */
4984 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
4985 offset += 1;
4987 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
4988 offset += 3;
4990 /* Request Transmission Policy */
4991 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
4992 offset += 4;
4994 /* Maximum Sustained Traffic Rate */
4995 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
4996 offset += 4;
4998 /* Maximum Traffic Burst */
4999 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5000 offset += 4;
5002 /* Minimum Reserved Traffic Rate */
5003 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5004 offset += 4;
5006 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5007 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);
5008 offset += 2;
5010 /* Reserved */
5011 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5012 offset += 2;
5014 return offset;
5017 /* Cops - Section : Non-Real-Time Polling Service */
5018 static int
5019 cops_non_real_time_polling_service(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5020 proto_item *ti;
5021 proto_tree *stt, *object_tree;
5023 /* Create a subtree */
5024 stt = info_to_cops_subtree(tvb,st,n,offset,"Non-Real-Time Polling Service");
5025 offset += 4;
5027 /* Envelope */
5028 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5029 offset += 1;
5031 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5032 offset += 3;
5034 /* Authorized Envelope */
5035 ti = proto_tree_add_text(stt, tvb, offset, 28, "Authorized Envelope");
5036 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5038 /* Traffic Priority */
5039 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5040 offset += 1;
5042 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5043 offset += 3;
5045 /* Request Transmission Policy */
5046 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5047 offset += 4;
5049 /* Maximum Sustained Traffic Rate */
5050 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5051 offset += 4;
5053 /* Maximum Traffic Burst */
5054 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5055 offset += 4;
5057 /* Minimum Reserved Traffic Rate */
5058 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5059 offset += 4;
5061 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5062 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);
5063 offset += 2;
5065 /* Reserved */
5066 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5067 offset += 2;
5069 /* Nominal Polling Interval */
5070 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5071 offset += 4;
5073 if (n < 64) return offset;
5075 /* Reserved Envelope */
5076 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
5077 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5079 /* Traffic Priority */
5080 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5081 offset += 1;
5083 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5084 offset += 3;
5086 /* Request Transmission Policy */
5087 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5088 offset += 4;
5090 /* Maximum Sustained Traffic Rate */
5091 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5092 offset += 4;
5094 /* Maximum Traffic Burst */
5095 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5096 offset += 4;
5098 /* Minimum Reserved Traffic Rate */
5099 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5100 offset += 4;
5102 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5103 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);
5104 offset += 2;
5106 /* Reserved */
5107 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5108 offset += 2;
5110 /* Nominal Polling Interval */
5111 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5112 offset += 4;
5114 if (n < 92) return offset;
5116 /* Committed Envelope */
5117 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
5118 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5120 /* Traffic Priority */
5121 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5122 offset += 1;
5124 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5125 offset += 3;
5127 /* Request Transmission Policy */
5128 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5129 offset += 4;
5131 /* Maximum Sustained Traffic Rate */
5132 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5133 offset += 4;
5135 /* Maximum Traffic Burst */
5136 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5137 offset += 4;
5139 /* Minimum Reserved Traffic Rate */
5140 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5141 offset += 4;
5143 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5144 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);
5145 offset += 2;
5147 /* Reserved */
5148 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5149 offset += 2;
5151 /* Nominal Polling Interval */
5152 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5153 offset += 4;
5155 return offset;
5158 /* Cops - Section : Real-Time Polling Service */
5159 static int
5160 cops_real_time_polling_service(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5161 proto_item *ti;
5162 proto_tree *stt, *object_tree;
5164 /* Create a subtree */
5165 stt = info_to_cops_subtree(tvb,st,n,offset,"Real-Time Polling Service");
5166 offset += 4;
5168 /* Envelope */
5169 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5170 offset += 1;
5172 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5173 offset += 3;
5175 /* Authorized Envelope */
5176 ti = proto_tree_add_text(stt, tvb, offset, 28, "Authorized Envelope");
5177 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5179 /* Request Transmission Policy */
5180 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5181 offset += 4;
5183 /* Maximum Sustained Traffic Rate */
5184 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5185 offset += 4;
5187 /* Maximum Traffic Burst */
5188 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5189 offset += 4;
5191 /* Minimum Reserved Traffic Rate */
5192 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5193 offset += 4;
5195 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5196 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);
5197 offset += 2;
5199 /* Reserved */
5200 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5201 offset += 2;
5203 /* Nominal Polling Interval */
5204 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5205 offset += 4;
5207 /* Tolerated Poll Jitter */
5208 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5209 offset += 4;
5211 if (n < 64) return offset;
5213 /* Reserved Envelope */
5214 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
5215 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5217 /* Request Transmission Policy */
5218 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5219 offset += 4;
5221 /* Maximum Sustained Traffic Rate */
5222 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5223 offset += 4;
5225 /* Maximum Traffic Burst */
5226 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5227 offset += 4;
5229 /* Minimum Reserved Traffic Rate */
5230 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5231 offset += 4;
5233 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5234 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);
5235 offset += 2;
5237 /* Reserved */
5238 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5239 offset += 2;
5241 /* Nominal Polling Interval */
5242 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5243 offset += 4;
5245 /* Tolerated Poll Jitter */
5246 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5247 offset += 4;
5249 if (n < 92) return offset;
5251 /* Committed Envelope */
5252 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
5253 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5255 /* Request Transmission Policy */
5256 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
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, guint n, guint32 offset) {
5293 proto_item *ti;
5294 proto_tree *stt, *object_tree;
5296 /* Create a subtree */
5297 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service");
5298 offset += 4;
5300 /* Envelope */
5301 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5302 offset += 1;
5304 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5305 offset += 3;
5307 /* Authorized Envelope */
5308 ti = proto_tree_add_text(stt, tvb, offset, 16, "Authorized Envelope");
5309 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5311 /* Request Transmission Policy */
5312 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5313 offset += 4;
5315 /* Unsolicited Grant Size */
5316 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5317 offset += 2;
5319 /* Grants Per Interval */
5320 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5321 offset += 1;
5323 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
5324 offset += 1;
5326 /* Nominal Grant Interval */
5327 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5328 offset += 4;
5330 /* Tolerated Grant Jitter */
5331 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5332 offset += 4;
5334 if (n < 40) return offset;
5336 /* Reserved Envelope */
5337 ti = proto_tree_add_text(stt, tvb, offset, 16, "Reserved Envelope");
5338 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5340 /* Request Transmission Policy */
5341 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5342 offset += 4;
5344 /* Unsolicited Grant Size */
5345 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5346 offset += 2;
5348 /* Grants Per Interval */
5349 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5350 offset += 1;
5352 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
5353 offset += 1;
5355 /* Nominal Grant Interval */
5356 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5357 offset += 4;
5359 /* Tolerated Grant Jitter */
5360 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5361 offset += 4;
5363 if (n < 56) return offset;
5365 /* Committed Envelope */
5366 ti = proto_tree_add_text(stt, tvb, offset, 16, "Committed Envelope");
5367 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5369 /* Request Transmission Policy */
5370 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5371 offset += 4;
5373 /* Unsolicited Grant Size */
5374 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5375 offset += 2;
5377 /* Grants Per Interval */
5378 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5379 offset += 1;
5381 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
5382 offset += 1;
5384 /* Nominal Grant Interval */
5385 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5386 offset += 4;
5388 /* Tolerated Grant Jitter */
5389 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5390 offset += 4;
5392 return offset;
5395 /* Cops - Section : Unsolicited Grant Service with Activity Detection */
5396 static int
5397 cops_ugs_with_activity_detection(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5398 proto_item *ti;
5399 proto_tree *stt, *object_tree;
5401 /* Create a subtree */
5402 stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service with Activity Detection");
5403 offset += 4;
5405 /* Envelope */
5406 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5407 offset += 1;
5409 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5410 offset += 3;
5412 /* Authorized Envelope */
5413 ti = proto_tree_add_text(stt, tvb, offset, 24, "Authorized Envelope");
5414 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5416 /* Request Transmission Policy */
5417 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5418 offset += 4;
5420 /* Unsolicited Grant Size */
5421 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5422 offset += 2;
5424 /* Grants Per Interval */
5425 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5426 offset += 1;
5428 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
5429 offset += 1;
5431 /* Nominal Grant Interval */
5432 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5433 offset += 4;
5435 /* Tolerated Grant Jitter */
5436 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5437 offset += 4;
5439 /* Nominal Polling Interval */
5440 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5441 offset += 4;
5443 /* Tolerated Poll Jitter */
5444 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5445 offset += 4;
5447 if (n < 56) return offset;
5449 /* Reserved Envelope */
5450 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
5451 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5453 /* Request Transmission Policy */
5454 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5455 offset += 4;
5457 /* Unsolicited Grant Size */
5458 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5459 offset += 2;
5461 /* Grants Per Interval */
5462 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5463 offset += 1;
5465 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
5466 offset += 1;
5468 /* Nominal Grant Interval */
5469 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5470 offset += 4;
5472 /* Tolerated Grant Jitter */
5473 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5474 offset += 4;
5476 /* Nominal Polling Interval */
5477 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5478 offset += 4;
5480 /* Tolerated Poll Jitter */
5481 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5482 offset += 4;
5484 if (n < 80) return offset;
5486 /* Committed Envelope */
5487 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
5488 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5490 /* Request Transmission Policy */
5491 decode_docsis_request_transmission_policy(tvb, offset, object_tree, hf_cops_pcmm_request_transmission_policy);
5492 offset += 4;
5494 /* Unsolicited Grant Size */
5495 info_to_display(tvb,object_tree,offset,2,"Unsolicited Grant Size",NULL,FMT_DEC,&hf_cops_pcmm_unsolicited_grant_size);
5496 offset += 2;
5498 /* Grants Per Interval */
5499 info_to_display(tvb,object_tree,offset,1,"Grants Per Interval",NULL,FMT_DEC,&hf_cops_pcmm_grants_per_interval);
5500 offset += 1;
5502 proto_tree_add_item(object_tree, hf_cops_reserved8, tvb, offset, 1, ENC_NA);
5503 offset += 1;
5505 /* Nominal Grant Interval */
5506 info_to_display(tvb,object_tree,offset,4,"Nominal Grant Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_grant_interval);
5507 offset += 4;
5509 /* Tolerated Grant Jitter */
5510 info_to_display(tvb,object_tree,offset,4,"Tolerated Grant Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_grant_jitter);
5511 offset += 4;
5513 /* Nominal Polling Interval */
5514 info_to_display(tvb,object_tree,offset,4,"Nominal Polling Interval",NULL,FMT_DEC,&hf_cops_pcmm_nominal_polling_interval);
5515 offset += 4;
5517 /* Tolerated Poll Jitter */
5518 info_to_display(tvb,object_tree,offset,4,"Tolerated Poll Jitter",NULL,FMT_DEC,&hf_cops_pcmm_tolerated_poll_jitter);
5519 offset += 4;
5521 return offset;
5524 /* Cops - Section : Downstream Service */
5525 static int
5526 cops_downstream_service(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5527 proto_item *ti;
5528 proto_tree *stt, *object_tree;
5530 /* Create a subtree */
5531 stt = info_to_cops_subtree(tvb,st,n,offset,"Downstream Service");
5532 offset += 4;
5534 /* Envelope */
5535 info_to_display(tvb,stt,offset,1,"Envelope",NULL,FMT_DEC,&hf_cops_pcmm_envelope);
5536 offset += 1;
5538 proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5539 offset += 3;
5541 /* Authorized Envelope */
5542 ti = proto_tree_add_text(stt, tvb, offset, 24, "Authorized Envelope");
5543 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5545 /* Traffic Priority */
5546 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5547 offset += 1;
5549 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5550 offset += 3;
5552 /* Maximum Sustained Traffic Rate */
5553 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5554 offset += 4;
5556 /* Maximum Traffic Burst */
5557 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5558 offset += 4;
5560 /* Minimum Reserved Traffic Rate */
5561 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5562 offset += 4;
5564 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5565 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);
5566 offset += 2;
5568 /* Reserved */
5569 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5570 offset += 2;
5572 /* Maximum Downstream Latency */
5573 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
5574 offset += 4;
5576 if (n < 56) return offset;
5578 /* Reserved Envelope */
5579 ti = proto_tree_add_text(stt, tvb, offset, 24, "Reserved Envelope");
5580 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5582 /* Traffic Priority */
5583 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5584 offset += 1;
5586 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5587 offset += 3;
5589 /* Maximum Sustained Traffic Rate */
5590 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5591 offset += 4;
5593 /* Maximum Traffic Burst */
5594 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5595 offset += 4;
5597 /* Minimum Reserved Traffic Rate */
5598 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5599 offset += 4;
5601 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5602 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);
5603 offset += 2;
5605 /* Reserved */
5606 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5607 offset += 2;
5609 /* Maximum Downstream Latency */
5610 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
5611 offset += 4;
5613 if (n < 80) return offset;
5615 /* Committed Envelope */
5616 ti = proto_tree_add_text(stt, tvb, offset, 24, "Committed Envelope");
5617 object_tree = proto_item_add_subtree(ti, ett_cops_subtree);
5619 /* Traffic Priority */
5620 info_to_display(tvb,object_tree,offset,1,"Traffic Priority",NULL,FMT_HEX,&hf_cops_pcmm_traffic_priority);
5621 offset += 1;
5623 proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
5624 offset += 3;
5626 /* Maximum Sustained Traffic Rate */
5627 info_to_display(tvb,object_tree,offset,4,"Maximum Sustained Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_max_sustained_traffic_rate);
5628 offset += 4;
5630 /* Maximum Traffic Burst */
5631 info_to_display(tvb,object_tree,offset,4,"Maximum Traffic Burst",NULL,FMT_DEC,&hf_cops_pcmm_max_traffic_burst);
5632 offset += 4;
5634 /* Minimum Reserved Traffic Rate */
5635 info_to_display(tvb,object_tree,offset,4,"Minimum Reserved Traffic Rate",NULL,FMT_DEC,&hf_cops_pcmm_min_reserved_traffic_rate);
5636 offset += 4;
5638 /* Assumed Minimum Reserved Traffic Rate Packet Size */
5639 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);
5640 offset += 2;
5642 /* Reserved */
5643 info_to_display(tvb,object_tree,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5644 offset += 2;
5646 /* Maximum Downstream Latency */
5647 info_to_display(tvb,object_tree,offset,4,"Maximum Downstream Latency",NULL,FMT_DEC,&hf_cops_pcmm_max_downstream_latency);
5648 offset += 4;
5650 return offset;
5653 /* Cops - Section : PacketCable Multimedia Event Gereration-Info */
5654 static void
5655 cops_mm_event_generation_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5657 proto_tree *stt;
5658 guint8 *bcid_str;
5660 /* Create a subtree */
5661 stt = info_to_cops_subtree(tvb,st,n,offset,"Event Generation Info");
5662 offset += 4;
5664 /* Primary Record Keeping Server IP Address */
5665 info_to_display(tvb,stt,offset,4,"PRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_prks_ip);
5666 offset += 4;
5668 /* Primary Record Keeping Server IP Port */
5669 info_to_display(tvb,stt,offset,2,"PRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_prks_ip_port);
5670 offset += 2;
5672 /* Reserved */
5673 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5674 offset += 2;
5676 /* Secondary Record Keeping Server IP Address */
5677 info_to_display(tvb,stt,offset,4,"SRKS IP Address", NULL,FMT_IPv4,&hf_cops_pc_srks_ip);
5678 offset += 4;
5680 /* Secondary Record Keeping Server IP Port */
5681 info_to_display(tvb,stt,offset,2,"SRKS IP Port",NULL,FMT_DEC,&hf_cops_pc_srks_ip_port);
5682 offset += 2;
5684 /* Reserved */
5685 info_to_display(tvb,stt,offset,2,"Reserved",NULL,FMT_HEX,&hf_cops_pc_reserved);
5686 offset += 2;
5688 /* BCID Timestamp */
5689 info_to_display(tvb,stt,offset,4,"BCID - Timestamp",NULL,FMT_HEX,&hf_cops_pc_bcid_ts);
5690 offset += 4;
5692 /* BCID Element ID */
5693 bcid_str = (guchar*)tvb_format_text(tvb, offset, 8);
5694 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Element ID",bcid_str);
5695 offset += 8;
5697 /* BCID Time Zone */
5698 bcid_str = (guchar*)tvb_format_text(tvb, offset, 8);
5699 proto_tree_add_text(stt, tvb, offset, 8,"%-28s : '%s'","BCID - Time Zone",bcid_str);
5700 offset += 8;
5702 /* BCID Event Counter */
5703 info_to_display(tvb,stt,offset,4,"BCID - Event Counter",NULL,FMT_DEC,&hf_cops_pc_bcid_ev);
5706 /* Cops - Section : Volume-Based Usage Limit */
5707 static int
5708 cops_volume_based_usage_limit(tvbuff_t *tvb, proto_tree *st, guint object_len, guint32 offset) {
5710 proto_tree *stt;
5712 /* Create a subtree */
5713 stt = info_to_cops_subtree(tvb,st,object_len,offset,"Volume-Based Usage Limit");
5714 offset += 4;
5716 /* Usage Limit */
5717 proto_tree_add_item(stt, hf_cops_pcmm_volume_based_usage_limit, tvb, offset, 8,
5718 ENC_BIG_ENDIAN);
5719 offset += 8;
5721 return offset;
5724 /* Cops - Section : Time-Based Usage Limit */
5725 static int
5726 cops_time_based_usage_limit(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5728 proto_tree *stt;
5730 /* Create a subtree */
5731 stt = info_to_cops_subtree(tvb,st,n,offset,"Time-Based Usage Limit");
5732 offset += 4;
5734 /* Time Limit */
5735 info_to_display(tvb,stt,offset,4,"Time Limit", NULL,FMT_DEC,&hf_cops_pcmm_time_based_usage_limit);
5736 offset += 4;
5738 return offset;
5741 /* Cops - Section : Opaque Data */
5742 static void
5743 cops_opaque_data(tvbuff_t *tvb, proto_tree *st, guint object_len, guint32 offset) {
5745 proto_tree *stt;
5747 /* Create a subtree */
5748 stt = info_to_cops_subtree(tvb,st,object_len,offset,"Opaque Data");
5749 offset += 4;
5751 /* Opaque Data */
5752 proto_tree_add_text(stt, tvb, offset, 8,"Opaque Data");
5755 /* Cops - Section : Gate Time Info */
5756 static int
5757 cops_gate_time_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5759 proto_tree *stt;
5761 /* Create a subtree */
5762 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Time Info");
5763 offset += 4;
5765 /* Gate Time Info */
5766 info_to_display(tvb,stt,offset,4,"Time Committed", NULL,FMT_DEC,&hf_cops_pcmm_gate_time_info);
5767 offset += 4;
5769 return offset;
5772 /* Cops - Section : Gate Usage Info */
5773 static void
5774 cops_gate_usage_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5776 proto_tree *stt;
5778 /* Create a subtree */
5779 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Usage Info");
5780 offset += 4;
5782 /* Gate Usage Info */
5783 info_to_display(tvb,stt,offset,8,"Octet Count", NULL,FMT_DEC,&hf_cops_pcmm_gate_usage_info);
5786 /* Cops - Section : PacketCable error */
5787 static int
5788 cops_packetcable_mm_error(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5790 proto_tree *stt;
5791 guint16 code, subcode;
5793 /* Create a subtree */
5794 stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Error");
5795 offset += 4;
5797 code = tvb_get_ntohs(tvb, offset);
5798 proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_code, tvb, offset, 2, code,
5799 "Error Code: %s (%u)", val_to_str_const(code, pcmm_packetcable_error_code, "Unknown"),
5800 code);
5801 offset += 2;
5803 subcode = tvb_get_ntohs(tvb, offset);
5804 if (code == 6 || code == 7)
5805 proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_subcode,
5806 tvb, offset, 2, code, "Error-Subcode: 0x%02x, S-Num: 0x%02x, S-Type: 0x%02x",
5807 subcode, subcode >> 8, subcode & 0xf);
5808 else
5809 proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_subcode,
5810 tvb, offset, 2, code, "Error-Subcode: 0x%04x", subcode);
5811 offset += 2;
5813 return offset;
5816 /* Cops - Section : Gate State */
5817 static int
5818 cops_gate_state(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5820 proto_tree *stt;
5822 /* Create a subtree */
5823 stt = info_to_cops_subtree(tvb,st,n,offset,"Gate State");
5824 offset += 4;
5826 /* State */
5827 info_to_display(tvb,stt,offset,2,"State",pcmm_gate_state,FMT_DEC,&hf_cops_pcmm_packetcable_gate_state);
5828 offset += 2;
5830 /* Reason */
5831 info_to_display(tvb,stt,offset,2,"Reason",pcmm_gate_state_reason,FMT_DEC,&hf_cops_pcmm_packetcable_gate_state_reason);
5832 offset += 2;
5834 return offset;
5837 /* Cops - Section : Version Info */
5838 static int
5839 cops_version_info(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5841 proto_tree *stt;
5843 /* Create a subtree */
5844 stt = info_to_cops_subtree(tvb,st,n,offset,"Version Info");
5845 offset += 4;
5847 /* State */
5848 info_to_display(tvb,stt,offset,2,"Major Version Number",NULL,FMT_DEC,&hf_cops_pcmm_packetcable_version_info_major);
5849 offset += 2;
5851 /* Reason */
5852 info_to_display(tvb,stt,offset,2,"Minor Version Number",NULL,FMT_DEC,&hf_cops_pcmm_packetcable_version_info_minor);
5853 offset += 2;
5855 return offset;
5858 /* Cops - Section : PSID */
5859 static void
5860 cops_psid(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5862 proto_tree *stt;
5864 /* Create a subtree */
5865 stt = info_to_cops_subtree(tvb,st,n,offset,"PSID");
5866 offset += 4;
5868 /* PSID */
5869 info_to_display(tvb,stt,offset,4,"PSID", NULL,FMT_DEC,&hf_cops_pcmm_psid);
5872 /* Cops - Section : Synch Options */
5873 static int
5874 cops_synch_options(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5876 proto_tree *stt;
5878 /* Create a subtree */
5879 stt = info_to_cops_subtree(tvb,st,n,offset,"Synch Options");
5880 offset += 4;
5882 proto_tree_add_item(stt, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
5883 offset += 2;
5885 /* Report Type */
5886 info_to_display(tvb,stt,offset,1,"Report Type", pcmm_report_type_vals,FMT_DEC,&hf_cops_pcmm_synch_options_report_type);
5887 offset += 1;
5889 /* Sych Type */
5890 info_to_display(tvb,stt,offset,1,"Synch Type", pcmm_synch_type_vals,FMT_DEC,&hf_cops_pcmm_synch_options_synch_type);
5891 offset += 1;
5893 return offset;
5896 /* Cops - Section : Msg Receipt Key */
5897 static void
5898 cops_msg_receipt_key(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5900 proto_tree *stt;
5902 /* Create a subtree */
5903 stt = info_to_cops_subtree(tvb,st,n,offset,"Msg Receipt Key");
5904 offset += 4;
5906 /* Msg Receipt Key */
5907 info_to_display(tvb,stt,offset,4,"Msg Receipt Key", NULL,FMT_HEX,&hf_cops_pcmm_msg_receipt_key);
5910 /* Cops - Section : UserID */
5911 static void
5912 cops_userid(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5914 proto_tree *stt;
5916 /* Create a subtree */
5917 stt = info_to_cops_subtree(tvb, st, n, offset, "UserID");
5918 offset += 4;
5920 /* UserID */
5921 info_to_display(tvb, stt, offset, n-4, "UserID", NULL, FMT_STR, &hf_cops_pcmm_userid);
5924 /* Cops - Section : SharedResourceID */
5925 static void
5926 cops_sharedresourceid(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset) {
5928 proto_tree *stt;
5930 /* Create a subtree */
5931 stt = info_to_cops_subtree(tvb,st,n,offset,"SharedResourceID");
5932 offset += 4;
5934 /* SharedResourceID */
5935 info_to_display(tvb,stt,offset,4,"SharedResourceID", NULL,FMT_HEX,&hf_cops_pcmm_sharedresourceid);
5938 /* PacketCable D-QoS S-Num/S-Type globs */
5939 #define PCDQ_TRANSACTION_ID 0x0101
5940 #define PCDQ_SUBSCRIBER_IDv4 0x0201
5941 #define PCDQ_SUBSCRIBER_IDv6 0x0202
5942 #define PCDQ_GATE_ID 0x0301
5943 #define PCDQ_ACTIVITY_COUNT 0x0401
5944 #define PCDQ_GATE_SPEC 0x0501
5945 #define PCDQ_REMOTE_GATE_INFO 0x0601
5946 #define PCDQ_EVENT_GENERATION_INFO 0x0701
5947 #define PCDQ_MEDIA_CONNECTION_EVENT_INFO 0x0801
5948 #define PCDQ_PACKETCABLE_ERROR 0x0901
5949 #define PCDQ_PACKETCABLE_REASON 0x0d01
5950 #define PCDQ_ELECTRONIC_SURVEILLANCE 0x0a01
5951 #define PCDQ_SESSION_DESCRIPTION 0x0b01
5953 /* Analyze the PacketCable objects */
5954 static void
5955 cops_analyze_packetcable_dqos_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 op_code, guint32 offset) {
5957 gint remdata;
5958 guint16 object_len;
5959 guint8 s_num, s_type;
5960 guint16 num_type_glob;
5962 /* Only if this option is enabled by the Gui */
5963 if ( cops_packetcable == FALSE ) {
5964 return;
5967 /* Do the remaining client specific objects */
5968 remdata = tvb_length_remaining(tvb, offset);
5969 while (remdata > 4) {
5971 /* In case we have remaining data, then lets try to get this analyzed */
5972 object_len = tvb_get_ntohs(tvb, offset);
5973 if (object_len < 4) {
5974 proto_tree_add_text(tree, tvb, offset, 2,
5975 "Incorrect PacketCable object length %u < 4", object_len);
5976 return;
5979 s_num = tvb_get_guint8(tvb, offset + 2);
5980 s_type = tvb_get_guint8(tvb, offset + 3);
5982 /* Glom the s_num and s_type together to make switching easier */
5983 num_type_glob = s_num << 8 | s_type;
5985 /* Perform the appropriate functions */
5986 switch (num_type_glob){
5987 case PCDQ_TRANSACTION_ID:
5988 cops_transaction_id(tvb, pinfo, tree, op_code, object_len, offset);
5989 break;
5990 case PCDQ_SUBSCRIBER_IDv4:
5991 cops_subscriber_id_v4(tvb, tree, object_len, offset);
5992 break;
5993 case PCDQ_SUBSCRIBER_IDv6:
5994 cops_subscriber_id_v6(tvb, tree, object_len, offset);
5995 break;
5996 case PCDQ_GATE_ID:
5997 cops_gate_id(tvb, tree, object_len, offset);
5998 break;
5999 case PCDQ_ACTIVITY_COUNT:
6000 cops_activity_count(tvb, tree, object_len, offset);
6001 break;
6002 case PCDQ_GATE_SPEC:
6003 cops_gate_specs(tvb, tree, object_len, offset);
6004 break;
6005 case PCDQ_REMOTE_GATE_INFO:
6006 cops_remote_gate_info(tvb, tree, object_len, offset);
6007 break;
6008 case PCDQ_EVENT_GENERATION_INFO:
6009 cops_event_generation_info(tvb, tree, object_len, offset);
6010 break;
6011 case PCDQ_PACKETCABLE_ERROR:
6012 cops_packetcable_error(tvb, tree, object_len, offset);
6013 break;
6014 case PCDQ_ELECTRONIC_SURVEILLANCE:
6015 cops_surveillance_parameters(tvb, tree, object_len, offset);
6016 break;
6017 case PCDQ_PACKETCABLE_REASON:
6018 cops_packetcable_reason(tvb, tree, object_len, offset);
6019 break;
6022 /* Tune offset */
6023 offset += object_len;
6025 /* See what we can still get from the buffer */
6026 remdata = tvb_length_remaining(tvb, offset);
6030 /* XXX - This duplicates code in the DOCSIS dissector. */
6031 static void
6032 decode_docsis_request_transmission_policy(tvbuff_t *tvb, guint32 offset, proto_tree *tree, gint hf) {
6033 proto_tree *drtp_tree;
6034 proto_item *item;
6035 guint32 policy = tvb_get_ntohl(tvb, offset);
6036 int i;
6037 char bit_fld[48];
6038 static const value_string drtp_vals[] = {
6039 { 1 << 0, "The Service Flow MUST NOT use \"all CMs\" broadcast request opportunities" },
6040 { 1 << 1, "The Service Flow MUST NOT use Priority Request multicast request opportunities" },
6041 { 1 << 2, "The Service Flow MUST NOT use Request/Data opportunities for Requests" },
6042 { 1 << 3, "The Service Flow MUST NOT use Request/Data opportunities for Data" },
6043 { 1 << 4, "The Service Flow MUST NOT piggyback requests with data" },
6044 { 1 << 5, "The Service Flow MUST NOT concatenate data" },
6045 { 1 << 6, "The Service Flow MUST NOT fragment data" },
6046 { 1 << 7, "The Service Flow MUST NOT suppress payload headers" },
6047 { 1 << 8, "The Service Flow MUST drop packets that do not fit in the Unsolicited Grant Size" },
6048 { 0, NULL }
6051 item = proto_tree_add_item (tree, hf, tvb, offset, 4, ENC_BIG_ENDIAN);
6052 drtp_tree = proto_item_add_subtree(item, ett_docsis_request_transmission_policy);
6053 for (i = 0 ; i <= 8; i++) {
6054 if (policy & drtp_vals[i].value) {
6055 decode_bitfield_value(bit_fld, policy, drtp_vals[i].value, 32);
6056 proto_tree_add_text(drtp_tree, tvb, offset, 4, "%s%s",
6057 bit_fld, drtp_vals[i].strptr);
6063 #define PCMM_TRANSACTION_ID 0x0101
6064 #define PCMM_AMID 0x0201
6065 #define PCMM_SUBSCRIBER_ID 0x0301
6066 #define PCMM_SUBSCRIBER_ID_V6 0x0302
6067 #define PCMM_GATE_ID 0x0401
6068 #define PCMM_GATE_SPEC 0x0501
6069 #define PCMM_CLASSIFIER 0x0601
6070 #define PCMM_EXTENDED_CLASSIFIER 0x0602
6071 #define PCMM_IPV6_CLASSIFIER 0x0603
6072 #define PCMM_FLOW_SPEC 0x0701
6073 #define PCMM_DOCSIS_SERVICE_CLASS_NAME 0x0702
6074 #define PCMM_BEST_EFFORT_SERVICE 0x0703
6075 #define PCMM_NON_REAL_TIME_POLLING_SERVICE 0x0704
6076 #define PCMM_REAL_TIME_POLLING_SERVICE 0x0705
6077 #define PCMM_UNSOLICITED_GRANT_SERVICE 0x0706
6078 #define PCMM_UGS_WITH_ACTIVITY_DETECTION 0x0707
6079 #define PCMM_DOWNSTREAM_SERVICE 0x0708
6080 #define PCMM_UPSTREAM_DROP 0x0709
6081 #define PCMM_EVENT_GENERATION_INFO 0x0801
6082 #define PCMM_VOLUME_BASED_USAGE_LIMIT 0x0901
6083 #define PCMM_TIME_BASED_USAGE_LIMIT 0x0a01
6084 #define PCMM_OPAQUE_DATA 0x0b01
6085 #define PCMM_GATE_TIME_INFO 0x0c01
6086 #define PCMM_GATE_USAGE_INFO 0x0d01
6087 #define PCMM_PACKETCABLE_ERROR 0x0e01
6088 #define PCMM_GATE_STATE 0x0f01
6089 #define PCMM_VERSION_INFO 0x1001
6090 #define PCMM_PSID 0x1101
6091 #define PCMM_SYNCH_OPTIONS 0x1201
6092 #define PCMM_MSG_RECEIPT_KEY 0x1301
6093 #define PCMM_USERID 0x1501
6094 #define PCMM_SHAREDRESOURCEID 0x1601
6097 static void
6098 cops_analyze_packetcable_mm_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 op_code, guint32 offset) {
6100 guint16 object_len;
6101 guint8 s_num, s_type;
6102 guint16 num_type_glob;
6104 /* Only if this option is enabled by the Gui */
6105 if ( cops_packetcable == FALSE ) {
6106 return;
6109 /* Do the remaining client specific objects */
6110 while (tvb_reported_length_remaining(tvb, offset) > 4) {
6112 /* In case we have remaining data, then lets try to get this analyzed */
6113 object_len = tvb_get_ntohs(tvb, offset);
6114 if (object_len < 4) {
6115 proto_tree_add_text(tree, tvb, offset, 2,
6116 "Incorrect PacketCable object length %u < 4", object_len);
6117 return;
6120 s_num = tvb_get_guint8(tvb, offset + 2);
6121 s_type = tvb_get_guint8(tvb, offset + 3);
6123 /* Glom the s_num and s_type together to make switching easier */
6124 num_type_glob = s_num << 8 | s_type;
6126 /* Perform the appropriate functions */
6127 switch (num_type_glob){
6128 case PCMM_TRANSACTION_ID:
6129 cops_mm_transaction_id(tvb, pinfo, tree, op_code, object_len, offset);
6130 break;
6131 case PCMM_AMID:
6132 cops_amid(tvb, tree, object_len, offset);
6133 break;
6134 case PCMM_SUBSCRIBER_ID:
6135 cops_subscriber_id_v4(tvb, tree, object_len, offset);
6136 break;
6137 case PCMM_SUBSCRIBER_ID_V6:
6138 cops_subscriber_id_v6(tvb, tree, object_len, offset);
6139 break;
6140 case PCMM_GATE_ID:
6141 cops_gate_id(tvb, tree, object_len, offset);
6142 break;
6143 case PCMM_GATE_SPEC:
6144 cops_mm_gate_spec(tvb, tree, object_len, offset);
6145 break;
6146 case PCMM_CLASSIFIER:
6147 cops_classifier(tvb, tree, object_len, offset, FALSE);
6148 break;
6149 case PCMM_EXTENDED_CLASSIFIER:
6150 cops_classifier(tvb, tree, object_len, offset, TRUE);
6151 break;
6152 case PCMM_IPV6_CLASSIFIER:
6153 cops_ipv6_classifier(tvb, tree, object_len, offset);
6154 break;
6155 case PCMM_FLOW_SPEC:
6156 cops_flow_spec(tvb, tree, object_len, offset);
6157 break;
6158 case PCMM_DOCSIS_SERVICE_CLASS_NAME:
6159 cops_docsis_service_class_name(tvb, tree, object_len, offset);
6160 break;
6161 case PCMM_BEST_EFFORT_SERVICE:
6162 if (object_len == 44 || object_len == 80 || object_len == 116)
6163 cops_best_effort_service_i04_i05(tvb, tree, object_len, offset, TRUE);
6164 else if (object_len == 40 || object_len == 72 || object_len == 104)
6165 cops_best_effort_service_i04_i05(tvb, tree, object_len, offset, FALSE);
6166 else
6167 cops_best_effort_service(tvb, tree, object_len, offset);
6168 break;
6169 case PCMM_NON_REAL_TIME_POLLING_SERVICE:
6170 if (object_len == 48 || object_len == 88 || object_len == 128)
6171 cops_non_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, TRUE);
6172 else if (object_len == 44 || object_len == 80 || object_len == 116)
6173 cops_non_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, FALSE);
6174 else
6175 cops_non_real_time_polling_service(tvb, tree, object_len, offset);
6176 break;
6177 case PCMM_REAL_TIME_POLLING_SERVICE:
6178 if (object_len == 48 || object_len == 88 || object_len == 128)
6179 cops_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, TRUE);
6180 else if (object_len == 44 || object_len == 80 || object_len == 116)
6181 cops_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, FALSE);
6182 else
6183 cops_real_time_polling_service(tvb, tree, object_len, offset);
6184 break;
6185 case PCMM_UNSOLICITED_GRANT_SERVICE:
6186 if (object_len == 36 || object_len == 64 || object_len == 92)
6187 cops_unsolicited_grant_service_i04_i05(tvb, tree, object_len, offset, TRUE);
6188 else if (object_len == 32 || object_len == 56 || object_len == 80)
6189 cops_unsolicited_grant_service_i04_i05(tvb, tree, object_len, offset, FALSE);
6190 else
6191 cops_unsolicited_grant_service(tvb, tree, object_len, offset);
6192 break;
6193 case PCMM_UGS_WITH_ACTIVITY_DETECTION:
6194 if (object_len == 44 || object_len == 80 || object_len == 116)
6195 cops_ugs_with_activity_detection_i04_i05(tvb, tree, object_len, offset, TRUE);
6196 else if (object_len == 40 || object_len == 72 || object_len == 104)
6197 cops_ugs_with_activity_detection_i04_i05(tvb, tree, object_len, offset, FALSE);
6198 else
6199 cops_ugs_with_activity_detection(tvb, tree, object_len, offset);
6200 break;
6201 case PCMM_DOWNSTREAM_SERVICE:
6202 if (object_len == 48 || object_len == 88 || object_len == 128)
6203 cops_downstream_service_i04_i05(tvb, tree, object_len, offset, TRUE);
6204 else if (object_len == 40 || object_len == 72 || object_len == 104)
6205 cops_downstream_service_i04_i05(tvb, tree, object_len, offset, FALSE);
6206 else
6207 cops_downstream_service(tvb, tree, object_len, offset);
6208 break;
6209 case PCMM_UPSTREAM_DROP:
6210 cops_upstream_drop_i04(tvb, tree, object_len, offset);
6211 break;
6212 case PCMM_EVENT_GENERATION_INFO:
6213 cops_mm_event_generation_info(tvb, tree, object_len, offset);
6214 break;
6215 case PCMM_VOLUME_BASED_USAGE_LIMIT:
6216 cops_volume_based_usage_limit(tvb, tree, object_len, offset);
6217 break;
6218 case PCMM_TIME_BASED_USAGE_LIMIT:
6219 cops_time_based_usage_limit(tvb, tree, object_len, offset);
6220 break;
6221 case PCMM_OPAQUE_DATA:
6222 cops_opaque_data(tvb, tree, object_len, offset);
6223 break;
6224 case PCMM_GATE_TIME_INFO:
6225 cops_gate_time_info(tvb, tree, object_len, offset);
6226 break;
6227 case PCMM_GATE_USAGE_INFO:
6228 cops_gate_usage_info(tvb, tree, object_len, offset);
6229 break;
6230 case PCMM_PACKETCABLE_ERROR:
6231 cops_packetcable_mm_error(tvb, tree, object_len, offset);
6232 break;
6233 case PCMM_GATE_STATE:
6234 cops_gate_state(tvb, tree, object_len, offset);
6235 break;
6236 case PCMM_VERSION_INFO:
6237 cops_version_info(tvb, tree, object_len, offset);
6238 break;
6239 case PCMM_PSID:
6240 cops_psid(tvb, tree, object_len, offset);
6241 break;
6242 case PCMM_SYNCH_OPTIONS:
6243 cops_synch_options(tvb, tree, object_len, offset);
6244 break;
6245 case PCMM_MSG_RECEIPT_KEY:
6246 cops_msg_receipt_key(tvb, tree, object_len, offset);
6247 break;
6248 case PCMM_USERID:
6249 cops_userid(tvb, tree, object_len, offset);
6250 break;
6251 case PCMM_SHAREDRESOURCEID:
6252 cops_sharedresourceid(tvb, tree, object_len, offset);
6253 break;
6257 /* Tune offset */
6258 offset += object_len;
6263 /* End of PacketCable Addition */