Coverage Report

Created: 2026-09-28 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-cops.c
Line
Count
Source
1
/* packet-cops.c
2
 * Routines for the COPS (Common Open Policy Service) protocol dissection
3
 *
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)
7
 *
8
 * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
9
 *
10
 * Added request/response tracking in July 2013 by Simon Zhong <szhong@juniper.net>
11
 *
12
 * Added PacketCable D-QoS specifications by Dick Gooris <gooris@lucent.com>
13
 *
14
 * Taken from PacketCable specifications :
15
 *    PacketCable Dynamic Quality-of-Service Specification
16
 *    Based on PKT-SP-DQOS-I09-040402 (April 2, 2004)
17
 *
18
 *    PacketCable Multimedia Specification
19
 *    Based on PKT-SP-MM-I04-080522 and PKT-SP-MM-I05-091029
20
 *
21
 *    www.packetcable.com
22
 *
23
 * Implemented in wireshark at April 7-8, 2004
24
 *
25
 * Wireshark - Network traffic analyzer
26
 * By Gerald Combs <gerald@wireshark.org>
27
 * Copyright 1998 Gerald Combs
28
 *
29
 * SPDX-License-Identifier: GPL-2.0-or-later
30
 */
31
32
/*
33
 * Some of the development of the COPS protocol decoder was sponsored by
34
 * Cable Television Laboratories, Inc. ("CableLabs") based upon proprietary
35
 * CableLabs' specifications. Your license and use of this protocol decoder
36
 * does not mean that you are licensed to use the CableLabs'
37
 * specifications.  If you have questions about this protocol, contact
38
 * jf.mule [AT] cablelabs.com or c.stuart [AT] cablelabs.com for additional
39
 * information.
40
 */
41
42
43
#include "config.h"
44
45
#include <epan/packet.h>
46
#include "packet-tcp.h"
47
48
#include <epan/oids.h>
49
#include <epan/expert.h>
50
#include <epan/tfs.h>
51
#include <unit_strings.h>
52
53
#include <wsutil/str_util.h>
54
55
#include "packet-ber.h"
56
57
/* XXX - The "plain" COPS port (3288) can be overridden in the prefs.
58
   The PacketCable port cannot - should this be the case? */
59
16
#define TCP_PORT_COPS 3288
60
16
#define TCP_PORT_PKTCABLE_COPS 2126
61
16
#define TCP_PORT_PKTCABLE_MM_COPS 3918
62
63
void proto_register_cops(void);
64
void proto_reg_handoff_cops(void);
65
66
67
/* Preference: desegmentation of COPS */
68
static bool cops_desegment = true;
69
70
216
#define COPS_OBJECT_HDR_SIZE 4
71
72
static const value_string cops_flags_vals[] = {
73
    { 0x00,          "None" },
74
    { 0x01,          "Solicited Message Flag Bit" },
75
    { 0, NULL },
76
};
77
78
/* The different COPS message types */
79
enum cops_op_code {
80
    COPS_NO_MSG,          /* Not a COPS Message type     */
81
82
    COPS_MSG_REQ,         /* Request (REQ)               */
83
    COPS_MSG_DEC,         /* Decision (DEC)              */
84
    COPS_MSG_RPT,         /* Report State (RPT)          */
85
    COPS_MSG_DRQ,         /* Delete Request State (DRQ)  */
86
    COPS_MSG_SSQ,         /* Synchronize State Req (SSQ) */
87
    COPS_MSG_OPN,         /* Client-Open (OPN)           */
88
    COPS_MSG_CAT,         /* Client-Accept (CAT)         */
89
    COPS_MSG_CC,          /* Client-Close (CC)           */
90
    COPS_MSG_KA,          /* Keep-Alive (KA)             */
91
    COPS_MSG_SSC,         /* Synchronize Complete (SSC)  */
92
93
    COPS_LAST_OP_CODE     /* For error checking          */
94
};
95
96
static const value_string cops_op_code_vals[] = {
97
    { COPS_MSG_REQ,          "Request (REQ)" },
98
    { COPS_MSG_DEC,          "Decision (DEC)" },
99
    { COPS_MSG_RPT,          "Report State (RPT)" },
100
    { COPS_MSG_DRQ,          "Delete Request State (DRQ)" },
101
    { COPS_MSG_SSQ,          "Synchronize State Req (SSQ)" },
102
    { COPS_MSG_OPN,          "Client-Open (OPN)" },
103
    { COPS_MSG_CAT,          "Client-Accept (CAT)" },
104
    { COPS_MSG_CC,           "Client-Close (CC)" },
105
    { COPS_MSG_KA,           "Keep-Alive (KA)" },
106
    { COPS_MSG_SSC,          "Synchronize Complete (SSC)" },
107
    { 0, NULL },
108
};
109
110
111
/* The different objects in COPS messages */
112
enum cops_c_num {
113
    COPS_NO_OBJECT,        /* Not a COPS Object type               */
114
115
    COPS_OBJ_HANDLE,       /* Handle Object (Handle)               */
116
    COPS_OBJ_CONTEXT,      /* Context Object (Context)             */
117
    COPS_OBJ_IN_INT,       /* In-Interface Object (IN-Int)         */
118
    COPS_OBJ_OUT_INT,      /* Out-Interface Object (OUT-Int)       */
119
    COPS_OBJ_REASON,       /* Reason Object (Reason)               */
120
    COPS_OBJ_DECISION,     /* Decision Object (Decision)           */
121
    COPS_OBJ_LPDPDECISION, /* LPDP Decision Object (LPDPDecision)  */
122
    COPS_OBJ_ERROR,        /* Error Object (Error)                 */
123
    COPS_OBJ_CLIENTSI,     /* Client Specific Information Object (ClientSI) */
124
    COPS_OBJ_KATIMER,      /* Keep-Alive Timer Object (KATimer)    */
125
    COPS_OBJ_PEPID,        /* PEP Identification Object (PEPID)    */
126
    COPS_OBJ_REPORT_TYPE,  /* Report-Type Object (Report-Type)     */
127
    COPS_OBJ_PDPREDIRADDR, /* PDP Redirect Address Object (PDPRedirAddr) */
128
    COPS_OBJ_LASTPDPADDR,  /* Last PDP Address (LastPDPaddr)       */
129
    COPS_OBJ_ACCTTIMER,    /* Accounting Timer Object (AcctTimer)  */
130
    COPS_OBJ_INTEGRITY,    /* Message Integrity Object (Integrity) */
131
    COPS_LAST_C_NUM        /* For error checking                   */
132
};
133
134
static const value_string cops_c_num_vals[] = {
135
    { COPS_OBJ_HANDLE,       "Handle Object (Handle)" },
136
    { COPS_OBJ_CONTEXT,      "Context Object (Context)" },
137
    { COPS_OBJ_IN_INT,       "In-Interface Object (IN-Int)" },
138
    { COPS_OBJ_OUT_INT,      "Out-Interface Object (OUT-Int)" },
139
    { COPS_OBJ_REASON,       "Reason Object (Reason)" },
140
    { COPS_OBJ_DECISION,     "Decision Object (Decision)" },
141
    { COPS_OBJ_LPDPDECISION, "LPDP Decision Object (LPDPDecision)" },
142
    { COPS_OBJ_ERROR,        "Error Object (Error)" },
143
    { COPS_OBJ_CLIENTSI,     "Client Specific Information Object (ClientSI)" },
144
    { COPS_OBJ_KATIMER,      "Keep-Alive Timer Object (KATimer)" },
145
    { COPS_OBJ_PEPID,        "PEP Identification Object (PEPID)" },
146
    { COPS_OBJ_REPORT_TYPE,  "Report-Type Object (Report-Type)" },
147
    { COPS_OBJ_PDPREDIRADDR, "PDP Redirect Address Object (PDPRedirAddr)" },
148
    { COPS_OBJ_LASTPDPADDR,  "Last PDP Address (LastPDPaddr)" },
149
    { COPS_OBJ_ACCTTIMER,    "Accounting Timer Object (AcctTimer)" },
150
    { COPS_OBJ_INTEGRITY,    "Message Integrity Object (Integrity)" },
151
    { 0, NULL },
152
};
153
154
155
/* The different objects in COPS-PR messages */
156
enum cops_s_num {
157
    COPS_NO_PR_OBJECT,     /* Not a COPS-PR Object type               */
158
    COPS_OBJ_PRID,         /* Provisioning Instance Identifier (PRID) */
159
    COPS_OBJ_PPRID,        /* Prefix Provisioning Instance Identifier (PPRID) */
160
    COPS_OBJ_EPD,          /* Encoded Provisioning Instance Data (EPD) */
161
    COPS_OBJ_GPERR,        /* Global Provisioning Error Object (GPERR) */
162
    COPS_OBJ_CPERR,        /* PRC Class Provisioning Error Object (CPERR) */
163
    COPS_OBJ_ERRPRID,      /* Error Provisioning Instance Identifier (ErrorPRID)*/
164
165
    COPS_LAST_S_NUM        /* For error checking                   */
166
};
167
168
169
static const value_string cops_s_num_vals[] = {
170
    { COPS_OBJ_PRID,         "Provisioning Instance Identifier (PRID)" },
171
    { COPS_OBJ_PPRID,        "Prefix Provisioning Instance Identifier (PPRID)" },
172
    { COPS_OBJ_EPD,          "Encoded Provisioning Instance Data (EPD)" },
173
    { COPS_OBJ_GPERR,        "Global Provisioning Error Object (GPERR)" },
174
    { COPS_OBJ_CPERR,        "PRC Class Provisioning Error Object (CPERR)" },
175
    { COPS_OBJ_ERRPRID,      "Error Provisioning Instance Identifier (ErrorPRID)" },
176
    { 0, NULL },
177
178
};
179
180
/* R-Type is carried within the Context Object */
181
static const value_string cops_r_type_vals[] = {
182
    { 0x01, "Incoming-Message/Admission Control request" },
183
    { 0x02, "Resource-Allocation request" },
184
    { 0x04, "Outgoing-Message request" },
185
    { 0x08, "Configuration request" },
186
    { 0, NULL },
187
};
188
/* S-Type is carried within the ClientSI Object for COPS-PR*/
189
static const value_string cops_s_type_vals[] = {
190
    { 0x01, "BER" },
191
    { 0, NULL },
192
};
193
194
/* Reason-Code is carried within the Reason object */
195
static const value_string cops_reason_vals[] = {
196
    { 1,  "Unspecified" },
197
    { 2,  "Management" },
198
    { 3,  "Preempted (Another request state takes precedence)" },
199
    { 4,  "Tear (Used to communicate a signaled state removal)" },
200
    { 5,  "Timeout (Local state has timed-out)" },
201
    { 6,  "Route Change (Change invalidates request state)" },
202
    { 7,  "Insufficient Resources (No local resource available)" },
203
    { 8,  "PDP's Directive (PDP decision caused the delete)" },
204
    { 9,  "Unsupported decision (PDP decision not supported)" },
205
    { 10, "Synchronize Handle Unknown" },
206
    { 11, "Transient Handle (stateless event)" },
207
    { 12, "Malformed Decision (could not recover)" },
208
    { 13, "Unknown COPS Object from PDP" },
209
    { 0, NULL },
210
};
211
212
/* Command-Code is carried within the Decision object if C-Type is 1 */
213
static const value_string cops_dec_cmd_code_vals[] = {
214
    { 0, "NULL Decision (No configuration data available)" },
215
    { 1, "Install (Admit request/Install configuration)" },
216
    { 2, "Remove (Remove request/Remove configuration)" },
217
    { 0, NULL },
218
};
219
220
/* Decision flags are also carried with the Decision object if C-Type is 1 */
221
static const value_string cops_dec_cmd_flag_vals[] = {
222
    { 0x00, "<None set>" },
223
    { 0x01, "Trigger Error (Trigger error message if set)" },
224
    { 0, NULL },
225
};
226
227
/* Error-Code from Error object */
228
static const value_string cops_error_vals[] = {
229
    {1,  "Bad handle" },
230
    {2,  "Invalid handle reference" },
231
    {3,  "Bad message format (Malformed Message)" },
232
    {4,  "Unable to process (server gives up on query)" },
233
    {5,  "Mandatory client-specific info missing" },
234
    {6,  "Unsupported client" },
235
    {7,  "Mandatory COPS object missing" },
236
    {8,  "Client Failure" },
237
    {9,  "Communication Failure" },
238
    {10, "Unspecified" },
239
    {11, "Shutting down" },
240
    {12, "Redirect to Preferred Server" },
241
    {13, "Unknown COPS Object" },
242
    {14, "Authentication Failure" },
243
    {15, "Authentication Required" },
244
    {0,  NULL },
245
};
246
/* Error-Code from GPERR object */
247
static const value_string cops_gperror_vals[] = {
248
    {1,  "AvailMemLow" },
249
    {2,  "AvailMemExhausted" },
250
    {3,  "unknownASN.1Tag" },
251
    {4,  "maxMsgSizeExceeded" },
252
    {5,  "unknownError" },
253
    {6,  "maxRequestStatesOpen" },
254
    {7,  "invalidASN.1Length" },
255
    {8,  "invalidObjectPad" },
256
    {9,  "unknownPIBData" },
257
    {10, "unknownCOPSPRObject" },
258
    {11, "malformedDecision" },
259
    {0,  NULL },
260
};
261
262
/* Error-Code from CPERR object */
263
static const value_string cops_cperror_vals[] = {
264
    {1,  "priSpaceExhausted" },
265
    {2,  "priInstanceInvalid" },
266
    {3,  "attrValueInvalid" },
267
    {4,  "attrValueSupLimited" },
268
    {5,  "attrEnumSupLimited" },
269
    {6,  "attrMaxLengthExceeded" },
270
    {7,  "attrReferenceUnknown" },
271
    {8,  "priNotifyOnly" },
272
    {9,  "unknownPrc" },
273
    {10, "tooFewAttrs" },
274
    {11, "invalidAttrType" },
275
    {12, "deletedInRef" },
276
    {13, "priSpecificError" },
277
    {0,  NULL },
278
};
279
280
281
/* Report-Type from Report-Type object */
282
static const value_string cops_report_type_vals[] = {
283
    {1, " Success   : Decision was successful at the PEP" },
284
    {2, " Failure   : Decision could not be completed by PEP" },
285
    {3, " Accounting: Accounting update for an installed state" },
286
    {0, NULL },
287
};
288
289
290
/* Client-type descriptions */
291
/* http://www.iana.org/assignments/cops-parameters */
292
293
/* PacketCable Types */
294
295
/* static dissector_handle_t sdp_handle; */
296
297
12
#define COPS_CLIENT_PC_DQOS     0x8008
298
12
#define COPS_CLIENT_PC_MM       0x800a
299
300
static const value_string cops_client_type_vals[] = {
301
    {0,                   "None"},
302
    {1,                   "RSVP"},
303
    {2,                   "DiffServ QoS"},
304
    {0x8001,              "IP Highway"},
305
    {0x8002,              "IP Highway"},
306
    {0x8003,              "IP Highway"},
307
    {0x8004,              "IP Highway"},
308
    {0x8005,              "Fujitsu"},
309
    {0x8006,              "HP OpenView PolicyXpert"},
310
    {0x8007,              "HP OpenView PolicyXpert COPS-PR PXPIB"},
311
    {COPS_CLIENT_PC_DQOS, "PacketCable Dynamic Quality-of-Service"},
312
    {0x8009,              "3GPP"},
313
    {COPS_CLIENT_PC_MM,   "PacketCable Multimedia"},
314
    {0x800b,              "Juniper"},
315
    {0x800c,              "Q.3303.1 (Rw interface) COPS alternative"},
316
    {0x800d,              "Q.3304.1 (Rc interface) COPS alternative"},
317
    {0, NULL},
318
};
319
320
/* The next tables are for PacketCable */
321
322
/* Transaction ID table */
323
static const value_string table_cops_dqos_transaction_id[] =
324
{
325
    { 0x1,  "Gate Alloc" },
326
    { 0x2,  "Gate Alloc Ack" },
327
    { 0x3,  "Gate Alloc Err" },
328
    { 0x4,  "Gate Set" },
329
    { 0x5,  "Gate Set Ack" },
330
    { 0x6,  "Gate Set Err" },
331
    { 0x7,  "Gate Info" },
332
    { 0x8,  "Gate Info Ack" },
333
    { 0x9,  "Gate Info Err" },
334
    { 0xa,  "Gate Delete" },
335
    { 0xb,  "Gate Delete Ack" },
336
    { 0xc,  "Gate Delete Err" },
337
    { 0xd,  "Gate Open" },
338
    { 0xe,  "Gate Close" },
339
    { 0, NULL },
340
};
341
342
/* Direction */
343
static const value_string table_cops_direction[] =
344
{
345
    { 0x0,  "Downstream gate" },
346
    { 0x1,  "Upstream gate" },
347
    { 0, NULL },
348
};
349
350
/* Session Class */
351
static const value_string table_cops_session_class[] =
352
{
353
    { 0x0,  "Unspecified" },
354
    { 0x1,  "Normal priority VoIP session" },
355
    { 0x2,  "High priority VoIP session" },
356
    { 0x3,  "Reserved" },
357
    { 0, NULL },
358
};
359
360
/* Reason Code */
361
static const value_string table_cops_reason_code[] =
362
{
363
    { 0x0,  "Gate Delete Operation" },
364
    { 0x1,  "Gate Close Operation" },
365
    { 0, NULL },
366
};
367
368
/* Reason Sub Code - Delete */
369
static const value_string table_cops_reason_subcode_delete[] =
370
{
371
    { 0x0,  "Normal Operation" },
372
    { 0x1,  "Local Gate-coordination not completed" },
373
    { 0x2,  "Remote Gate-coordination not completed" },
374
    { 0x3,  "Authorization revoked" },
375
    { 0x4,  "Unexpected Gate-Open" },
376
    { 0x5,  "Local Gate-Close failure" },
377
    { 0x7f,"Unspecified error" },
378
    { 0, NULL },
379
};
380
381
/* Reason Sub Code - Close */
382
static const value_string table_cops_reason_subcode_close[] =
383
{
384
    { 0x0,  "Client initiated release (normal operation)" },
385
    { 0x1,  "Reservation reassignment (e.g., for priority session)" },
386
    { 0x2,  "Lack of reservation maintenance (e.g., RSVP refreshes)" },
387
    { 0x3,  "Lack of Docsis Mac-layer responses (e.g., station maintenance)" },
388
    { 0x4,  "Timer T0 expiration; no Gate-Set received from CMS" },
389
    { 0x5,  "Timer T1 expiration; no Commit received from MTA" },
390
    { 0x6,  "Timer T7 expiration; Service Flow reservation timeout" },
391
    { 0x7,  "Timer T8 expiration; Service Flow inactivity in the upstream direction" },
392
    { 0x7f,"Unspecified error" },
393
    { 0, NULL },
394
};
395
396
/* PacketCable Error */
397
static const value_string table_cops_packetcable_error[] =
398
{
399
    { 0x1,  "No gates currently available" },
400
    { 0x2,  "Unknown Gate ID" },
401
    { 0x3,  "Illegal Session Class value" },
402
    { 0x4,  "Subscriber exceeded gate limit" },
403
    { 0x5,  "Gate already set" },
404
    { 0x6,  "Missing Required Object" },
405
    { 0x7,  "Invalid Object" },
406
    { 0x7f,"Unspecified error" },
407
    { 0, NULL },
408
};
409
410
411
/* PacketCable Multimedia */
412
413
static const value_string table_cops_mm_transaction_id[] = {
414
    {1,  "Reserved"},
415
    {2,  "Reserved"},
416
    {3,  "Reserved"},
417
    {4,  "Gate Set"},
418
    {5,  "Gate Set Ack"},
419
    {6,  "Gate Set Err"},
420
    {7,  "Gate Info"},
421
    {8,  "Gate Info Ack"},
422
    {9,  "Gate Info Err"},
423
    {10, "Gate Delete"},
424
    {11, "Gate Delete Ack"},
425
    {12, "Gate Delete Err"},
426
    {13, "Gate Open"},
427
    {14, "Gate Close"},
428
    {15, "Gate Report State"},
429
    {16, "Invalid Gate Cmd Err"},
430
    {17, "PDP Config"},
431
    {18, "PDP Config Ack"},
432
    {19, "PDP Config Error"},
433
    {20, "Synch Request"},
434
    {21, "Synch Report"},
435
    {22, "Synch Complete"},
436
    {23, "Message Receipt"},
437
    {0, NULL },
438
};
439
440
static const value_string pcmm_activation_state_vals[] = {
441
    {0, "Inactive"},
442
    {1, "Active"},
443
    {0, NULL },
444
};
445
446
static const value_string pcmm_action_vals[] = {
447
    {0, "Add classifier"},
448
    {1, "Replace classifier"},
449
    {2, "Delete classifier"},
450
    {3, "No change"},
451
    {0, NULL },
452
};
453
454
static const value_string pcmm_flow_spec_service_vals[] = {
455
    {2, "Guaranteed Rate"},
456
    {5, "Controlled Load"},
457
    {0, NULL },
458
};
459
460
static const value_string pcmm_report_type_vals[] = {
461
    {0, "Standard Report Data"},
462
    {1, "Complete Gate Data"},
463
    {0, NULL},
464
};
465
466
static const value_string pcmm_synch_type_vals[] = {
467
    {0, "Full Synchronization"},
468
    {1, "Incremental Synchronization"},
469
    {0, NULL},
470
};
471
472
static const value_string pcmm_packetcable_error_code[] = {
473
    {1,  "Insufficient Resources"},
474
    {2,  "Unknown GateID"},
475
    {6,  "Missing Required Object"},
476
    {7,  "Invalid Object"},
477
    {8,  "Volume-Based Usage Limit Exceeded"},
478
    {9,  "Time-Based Usage Limit Exceeded"},
479
    {10, "Session Class Limit Exceeded"},
480
    {11, "Undefined Service Class Name"},
481
    {12, "Incompatible Envelope"},
482
    {13, "Invalid SubscriberID"},
483
    {14, "Unauthorized AMID"},
484
    {15, "Number of Classifiers Not Supported"},
485
    {16, "Policy Exception"},
486
    {17, "Invalid Field Value in Object"},
487
    {18, "Transport Error"},
488
    {19, "Unknown Gate Command"},
489
    {20, "Unauthorized PSID"},
490
    {21, "No State for PDP"},
491
    {22, "Unsupported Synch Type"},
492
    {23, "Incremental Data Incomplete"},
493
    {127, "Other, Unspecified Error"},
494
    {0, NULL},
495
};
496
497
static const value_string pcmm_gate_state[] = {
498
    {1, "Idle/Closed"},
499
    {2, "Authorized"},
500
    {3, "Reserved"},
501
    {4, "Committed"},
502
    {5, "Committed-Recovery"},
503
    {0, NULL},
504
};
505
506
static const value_string pcmm_gate_state_reason[] = {
507
    {1,  "Close initiated by CMTS due to reservation reassignment"},
508
    {2,  "Close initiated by CMTS due to lack of DOCSIS MAC-layer responses"},
509
    {3,  "Close initiated by CMTS due to timer T1 expiration"},
510
    {4,  "Close initiated by CMTS due to timer T2 expiration"},
511
    {5,  "Inactivity timer expired due to Service Flow inactivity (timer T3 expiration)"},
512
    {6,  "Close initiated by CMTS due to lack of Reservation Maintenance"},
513
    {7,  "Gate state unchanged, but volume limit reached"},
514
    {8,  "Close initiated by CMTS due to timer T4 expiration"},
515
    {9,  "Gate state unchanged, but timer T2 expiration caused reservation reduction"},
516
    {10, "Gate state unchanged, but time limit reached"},
517
    {11, "Close initiated by Policy Server or CMTS, volume limit reached"},
518
    {12, "Close initiated by Policy Server or CMTS, time limit reached"},
519
    {13, "Close initiated by CMTS, other"},
520
    {65535, "Other"},
521
    {0, NULL},
522
};
523
524
525
/* End of PacketCable Tables */
526
527
528
/* Initialize the protocol and registered fields */
529
static int proto_cops;
530
static int hf_cops_ver_flags;
531
static int hf_cops_version;
532
static int hf_cops_flags;
533
534
static int hf_cops_response_in;
535
static int hf_cops_response_to;
536
static int hf_cops_response_time;
537
538
static int hf_cops_op_code;
539
static int hf_cops_client_type;
540
static int hf_cops_msg_len;
541
542
static int hf_cops_obj_len;
543
static int hf_cops_obj_c_num;
544
static int hf_cops_obj_c_type;
545
546
static int hf_cops_obj_s_num;
547
static int hf_cops_obj_s_type;
548
549
static int hf_cops_handle;
550
551
static int hf_cops_r_type_flags;
552
static int hf_cops_m_type_flags;
553
554
static int hf_cops_in_int_ipv4;
555
static int hf_cops_in_int_ipv6;
556
static int hf_cops_out_int_ipv4;
557
static int hf_cops_out_int_ipv6;
558
static int hf_cops_int_ifindex;
559
560
static int hf_cops_reason;
561
static int hf_cops_reason_sub;
562
563
static int hf_cops_dec_cmd_code;
564
static int hf_cops_dec_flags;
565
566
static int hf_cops_error;
567
static int hf_cops_error_sub;
568
569
static int hf_cops_gperror;
570
static int hf_cops_gperror_sub;
571
572
static int hf_cops_cperror;
573
static int hf_cops_cperror_sub;
574
575
static int hf_cops_katimer;
576
577
static int hf_cops_pepid;
578
579
static int hf_cops_report_type;
580
581
static int hf_cops_pdprediraddr_ipv4;
582
static int hf_cops_pdprediraddr_ipv6;
583
static int hf_cops_lastpdpaddr_ipv4;
584
static int hf_cops_lastpdpaddr_ipv6;
585
static int hf_cops_pdp_tcp_port;
586
587
static int hf_cops_accttimer;
588
589
static int hf_cops_key_id;
590
static int hf_cops_seq_num;
591
592
static int hf_cops_prid_oid;
593
static int hf_cops_pprid_oid;
594
static int hf_cops_errprid_oid;
595
static int hf_cops_epd_null;
596
static int hf_cops_epd_int;
597
static int hf_cops_epd_octets;
598
static int hf_cops_epd_oid;
599
static int hf_cops_epd_ipv4;
600
static int hf_cops_epd_u32;
601
static int hf_cops_epd_ticks;
602
static int hf_cops_epd_opaque;
603
static int hf_cops_epd_i64;
604
static int hf_cops_epd_u64;
605
static int hf_cops_epd_unknown;
606
static int hf_cops_reserved8;
607
static int hf_cops_reserved16;
608
static int hf_cops_reserved24;
609
static int hf_cops_keyed_message_digest;
610
static int hf_cops_integrity_contents;
611
static int hf_cops_opaque_data;
612
613
/* For PacketCable D-QoS */
614
static int hf_cops_subtree;
615
static int hf_cops_pc_activity_count;
616
static int hf_cops_pc_algorithm;
617
static int hf_cops_pc_close_subcode;
618
static int hf_cops_pc_cmts_ip;
619
static int hf_cops_pc_cmts_ip_port;
620
static int hf_cops_pc_prks_ip;
621
static int hf_cops_pc_prks_ip_port;
622
static int hf_cops_pc_srks_ip;
623
static int hf_cops_pc_srks_ip_port;
624
static int hf_cops_pc_delete_subcode;
625
static int hf_cops_pc_dest_ip;
626
static int hf_cops_pc_dest_port;
627
static int hf_cops_pc_direction;
628
static int hf_cops_pc_ds_field;
629
static int hf_cops_pc_gate_id;
630
static int hf_cops_pc_gate_spec_flags;
631
static int hf_cops_pc_gate_command_type;
632
static int hf_cops_pc_dqos_gate_command_type;
633
static int hf_cops_pc_mm_gate_command_type;
634
static int hf_cops_pc_key;
635
static int hf_cops_pc_max_packet_size;
636
static int hf_cops_pc_min_policed_unit;
637
static int hf_cops_pc_packetcable_err_code;
638
static int hf_cops_pc_packetcable_sub_code;
639
static int hf_cops_pc_peak_data_rate;
640
static int hf_cops_pc_protocol_id;
641
static int hf_cops_pc_reason_code;
642
static int hf_cops_pc_remote_flags;
643
static int hf_cops_pc_remote_gate_id;
644
static int hf_cops_pc_reserved;
645
static int hf_cops_pc_session_class;
646
static int hf_cops_pc_slack_term;
647
static int hf_cops_pc_spec_rate;
648
static int hf_cops_pc_src_ip;
649
static int hf_cops_pc_src_port;
650
static int hf_cops_pc_subscriber_id_ipv4;
651
static int hf_cops_pc_subscriber_id_ipv6;
652
static int hf_cops_pc_t1_value;
653
static int hf_cops_pc_t7_value;
654
static int hf_cops_pc_t8_value;
655
static int hf_cops_pc_token_bucket_rate;
656
static int hf_cops_pc_token_bucket_size;
657
static int hf_cops_pc_transaction_id;
658
static int hf_cops_pc_dqos_transaction_id;
659
static int hf_cops_pc_mm_transaction_id;
660
static int hf_cops_pc_bcid_ts;
661
static int hf_cops_pc_bcid_id;
662
static int hf_cops_pc_bcid_tz;
663
static int hf_cops_pc_bcid_ev;
664
static int hf_cops_pc_dfcdc_ip;
665
static int hf_cops_pc_dfccc_ip;
666
static int hf_cops_pc_dfcdc_ip_port;
667
static int hf_cops_pc_dfccc_ip_port;
668
static int hf_cops_pc_dfccc_id;
669
670
/* PacketCable Multimedia */
671
static int hf_cops_pcmm_amid_app_type;
672
static int hf_cops_pcmm_amid_am_tag;
673
static int hf_cops_pcmm_gate_spec_flags;
674
static int hf_cops_pcmm_gate_spec_flags_gate;
675
static int hf_cops_pcmm_gate_spec_flags_dscp_overwrite;
676
static int hf_cops_pcmm_gate_spec_dscp_tos_field;
677
static int hf_cops_pcmm_gate_spec_dscp_tos_mask;
678
static int hf_cops_pcmm_gate_spec_session_class_id;
679
static int hf_cops_pcmm_gate_spec_session_class_id_priority;
680
static int hf_cops_pcmm_gate_spec_session_class_id_preemption;
681
static int hf_cops_pcmm_gate_spec_session_class_id_configurable;
682
static int hf_cops_pcmm_gate_spec_timer_t1;
683
static int hf_cops_pcmm_gate_spec_timer_t2;
684
static int hf_cops_pcmm_gate_spec_timer_t3;
685
static int hf_cops_pcmm_gate_spec_timer_t4;
686
static int hf_cops_pcmm_classifier_protocol_id;
687
static int hf_cops_pcmm_classifier_dscp_tos_field;
688
static int hf_cops_pcmm_classifier_dscp_tos_mask;
689
static int hf_cops_pcmm_classifier_src_addr;
690
static int hf_cops_pcmm_classifier_src_mask;
691
static int hf_cops_pcmm_classifier_dst_addr;
692
static int hf_cops_pcmm_classifier_dst_mask;
693
static int hf_cops_pcmm_classifier_src_port;
694
static int hf_cops_pcmm_classifier_src_port_end;
695
static int hf_cops_pcmm_classifier_dst_port;
696
static int hf_cops_pcmm_classifier_dst_port_end;
697
static int hf_cops_pcmm_classifier_priority;
698
static int hf_cops_pcmm_classifier_classifier_id;
699
static int hf_cops_pcmm_classifier_activation_state;
700
static int hf_cops_pcmm_classifier_action;
701
static int hf_cops_pcmm_classifier_flags;
702
static int hf_cops_pcmm_classifier_tc_low;
703
static int hf_cops_pcmm_classifier_tc_high;
704
static int hf_cops_pcmm_classifier_tc_mask;
705
static int hf_cops_pcmm_classifier_flow_label;
706
static int hf_cops_pcmm_classifier_next_header_type;
707
static int hf_cops_pcmm_classifier_source_prefix_length;
708
static int hf_cops_pcmm_classifier_destination_prefix_length;
709
static int hf_cops_pcmm_classifier_src_addr_v6;
710
static int hf_cops_pcmm_classifier_dst_addr_v6;
711
static int hf_cops_pcmm_flow_spec_envelope;
712
static int hf_cops_pcmm_flow_spec_service_number;
713
static int hf_cops_pcmm_docsis_scn;
714
static int hf_cops_pcmm_envelope;
715
static int hf_cops_pcmm_traffic_priority;
716
static int hf_cops_pcmm_request_transmission_policy;
717
static int hf_cops_pcmm_request_transmission_policy_sf_all_cm;
718
static int hf_cops_pcmm_request_transmission_policy_sf_priority;
719
static int hf_cops_pcmm_request_transmission_policy_sf_request_for_request;
720
static int hf_cops_pcmm_request_transmission_policy_sf_data_for_data;
721
static int hf_cops_pcmm_request_transmission_policy_sf_piggyback;
722
static int hf_cops_pcmm_request_transmission_policy_sf_concatenate;
723
static int hf_cops_pcmm_request_transmission_policy_sf_fragment;
724
static int hf_cops_pcmm_request_transmission_policy_sf_suppress;
725
static int hf_cops_pcmm_request_transmission_policy_sf_drop_packets;
726
static int hf_cops_pcmm_max_sustained_traffic_rate;
727
static int hf_cops_pcmm_max_traffic_burst;
728
static int hf_cops_pcmm_min_reserved_traffic_rate;
729
static int hf_cops_pcmm_ass_min_rtr_packet_size;
730
static int hf_cops_pcmm_max_concat_burst;
731
static int hf_cops_pcmm_req_att_mask;
732
static int hf_cops_pcmm_forbid_att_mask;
733
static int hf_cops_pcmm_att_aggr_rule_mask;
734
static int hf_cops_pcmm_nominal_polling_interval;
735
static int hf_cops_pcmm_tolerated_poll_jitter;
736
static int hf_cops_pcmm_unsolicited_grant_size;
737
static int hf_cops_pcmm_grants_per_interval;
738
static int hf_cops_pcmm_nominal_grant_interval;
739
static int hf_cops_pcmm_tolerated_grant_jitter;
740
static int hf_cops_pcmm_down_resequencing;
741
static int hf_cops_pcmm_down_peak_traffic_rate;
742
static int hf_cops_pcmm_max_downstream_latency;
743
static int hf_cops_pcmm_volume_based_usage_limit;
744
static int hf_cops_pcmm_time_based_usage_limit;
745
static int hf_cops_pcmm_gate_time_info;
746
static int hf_cops_pcmm_gate_usage_info;
747
static int hf_cops_pcmm_packetcable_error_code;
748
static int hf_cops_pcmm_packetcable_error_subcode;
749
static int hf_cops_pcmm_packetcable_gate_state;
750
static int hf_cops_pcmm_packetcable_gate_state_reason;
751
static int hf_cops_pcmm_packetcable_version_info_major;
752
static int hf_cops_pcmm_packetcable_version_info_minor;
753
static int hf_cops_pcmm_psid;
754
static int hf_cops_pcmm_synch_options_report_type;
755
static int hf_cops_pcmm_synch_options_synch_type;
756
static int hf_cops_pcmm_msg_receipt_key;
757
static int hf_cops_pcmm_userid;
758
static int hf_cops_pcmm_sharedresourceid;
759
760
761
/* Initialize the subtree pointers */
762
static int ett_cops;
763
static int ett_cops_ver_flags;
764
static int ett_cops_obj;
765
static int ett_cops_pr_obj;
766
static int ett_cops_obj_data;
767
static int ett_cops_r_type_flags;
768
static int ett_cops_itf;
769
static int ett_cops_reason;
770
static int ett_cops_decision;
771
static int ett_cops_error;
772
static int ett_cops_clientsi;
773
static int ett_cops_asn1;
774
static int ett_cops_gperror;
775
static int ett_cops_cperror;
776
static int ett_cops_pdp;
777
static int ett_cops_pcmm_gate_spec_flags;
778
static int ett_cops_pcmm_gate_spec_session_class_id;
779
780
static expert_field ei_cops_pepid_not_null;
781
static expert_field ei_cops_trailing_garbage;
782
static expert_field ei_cops_bad_cops_object_length;
783
static expert_field ei_cops_bad_cops_pr_object_length;
784
static expert_field ei_cops_unknown_c_num;
785
/* static expert_field ei_cops_unknown_s_num; */
786
787
/* For PacketCable */
788
static int ett_cops_subtree;
789
790
static int ett_docsis_request_transmission_policy;
791
792
static dissector_handle_t cops_handle;
793
794
static int* const docsis_request_transmission_policies[] = {
795
  &hf_cops_pcmm_request_transmission_policy_sf_all_cm,
796
  &hf_cops_pcmm_request_transmission_policy_sf_priority,
797
  &hf_cops_pcmm_request_transmission_policy_sf_request_for_request,
798
  &hf_cops_pcmm_request_transmission_policy_sf_data_for_data,
799
  &hf_cops_pcmm_request_transmission_policy_sf_piggyback,
800
  &hf_cops_pcmm_request_transmission_policy_sf_concatenate,
801
  &hf_cops_pcmm_request_transmission_policy_sf_fragment,
802
  &hf_cops_pcmm_request_transmission_policy_sf_suppress,
803
  &hf_cops_pcmm_request_transmission_policy_sf_drop_packets,
804
  NULL
805
};
806
807
/* For request/response matching */
808
typedef struct _cops_conv_info_t {
809
    wmem_map_t *pdus_tree;
810
} cops_conv_info_t;
811
812
typedef struct _cops_call_t
813
{
814
    uint8_t op_code;
815
    bool solicited;
816
    uint32_t req_num;
817
    uint32_t rsp_num;
818
    nstime_t req_time;
819
} cops_call_t;
820
821
static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, uint8_t op_code, uint32_t offset, proto_tree *tree, uint16_t client_type, uint32_t* handle_value);
822
static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree,
823
                                     uint8_t op_code, uint16_t client_type, uint8_t c_num, uint8_t c_type, int len, uint32_t* handle_value);
824
825
static void dissect_cops_pr_objects(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree, int pr_len,
826
                                                                        oid_info_t** oid_info_p, uint32_t** pprid_subids_p, unsigned* pprid_subids_len_p);
827
static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree,
828
                                                                           uint8_t s_num, uint8_t s_type, int len,
829
                                                                           oid_info_t** oid_info_p, uint32_t** pprid_subids, unsigned* pprid_subids_len);
830
831
/* Added for PacketCable */
832
static proto_tree *info_to_cops_subtree(tvbuff_t *, proto_tree *, int, int, const char *);
833
834
static void cops_transaction_id(tvbuff_t *, packet_info *, proto_tree *, uint8_t, unsigned, uint32_t);
835
static void cops_subscriber_id_v4(tvbuff_t *, proto_tree *, unsigned, uint32_t);
836
static void cops_subscriber_id_v6(tvbuff_t *, proto_tree *, unsigned, uint32_t);
837
static void cops_gate_id(tvbuff_t *, proto_tree *, unsigned, uint32_t);
838
static void cops_activity_count(tvbuff_t *, proto_tree *, unsigned, uint32_t);
839
static void cops_gate_specs(tvbuff_t *, proto_tree *, unsigned, uint32_t);
840
static void cops_remote_gate_info(tvbuff_t *, proto_tree *, unsigned, uint32_t);
841
static void cops_packetcable_reason(tvbuff_t *, proto_tree *, unsigned, uint32_t);
842
static void cops_packetcable_error(tvbuff_t *, proto_tree *, unsigned, uint32_t);
843
static void cops_event_generation_info(tvbuff_t *, proto_tree *, unsigned, uint32_t);
844
static void cops_surveillance_parameters(tvbuff_t *, proto_tree *, unsigned, uint32_t);
845
846
static void cops_amid(tvbuff_t *, proto_tree *, unsigned, uint32_t);
847
848
static void cops_analyze_packetcable_dqos_obj(tvbuff_t *, packet_info *, proto_tree *, uint8_t, uint32_t);
849
static void cops_analyze_packetcable_mm_obj(tvbuff_t *, packet_info *, proto_tree *, uint8_t, uint32_t);
850
851
static bool cops_packetcable = true;
852
853
/* End of addition for PacketCable */
854
855
/* COPS PR Tags */
856
857
#define COPS_IPA    0           /* IP Address */
858
#define COPS_U32    2           /* Unsigned 32*/
859
#define COPS_TIT    3           /* TimeTicks */
860
#define COPS_OPQ    4           /* Opaque */
861
#define COPS_I64    10          /* Integer64 */
862
#define COPS_U64    11          /* Uinteger64 */
863
864
/* COPS PR Types */
865
866
#define COPS_NULL                0
867
#define COPS_INTEGER             1    /* l  */
868
#define COPS_OCTETSTR            2    /* c  */
869
#define COPS_OBJECTID            3    /* ul */
870
#define COPS_IPADDR              4    /* uc */
871
#define COPS_UNSIGNED32          5    /* ul */
872
#define COPS_TIMETICKS           7    /* ul */
873
#define COPS_OPAQUE              8    /* c  */
874
#define COPS_INTEGER64           10   /* ll */
875
#define COPS_UNSIGNED64          11   /* ull  */
876
877
typedef struct _COPS_CNV COPS_CNV;
878
879
struct _COPS_CNV
880
{
881
  unsigned ber_class;
882
  unsigned tag;
883
  int   syntax;
884
  const char *name;
885
  int* hfidp;
886
};
887
888
static const true_false_string tfs_upstream_downstream = { "Upstream", "Downstream" };
889
890
static COPS_CNV CopsCnv [] =
891
{
892
    {BER_CLASS_UNI, BER_UNI_TAG_NULL,           COPS_NULL,      "NULL" , &hf_cops_epd_null},
893
    {BER_CLASS_UNI, BER_UNI_TAG_INTEGER,        COPS_INTEGER,   "INTEGER", &hf_cops_epd_int},
894
    {BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING,    COPS_OCTETSTR,  "OCTET STRING", &hf_cops_epd_octets},
895
    {BER_CLASS_UNI, BER_UNI_TAG_OID,            COPS_OBJECTID,  "OBJECTID", &hf_cops_epd_oid},
896
    {BER_CLASS_APP, COPS_IPA,                   COPS_IPADDR,    "IPADDR", &hf_cops_epd_ipv4},
897
    {BER_CLASS_APP, COPS_U32,                   COPS_UNSIGNED32,"UNSIGNED32", &hf_cops_epd_u32},
898
    {BER_CLASS_APP, COPS_TIT,                   COPS_TIMETICKS, "TIMETICKS", &hf_cops_epd_ticks},
899
    {BER_CLASS_APP, COPS_OPQ,                   COPS_OPAQUE,    "OPAQUE", &hf_cops_epd_opaque},
900
    {BER_CLASS_APP, COPS_I64,                   COPS_INTEGER64, "INTEGER64", &hf_cops_epd_i64},
901
    {BER_CLASS_APP, COPS_U64,                   COPS_UNSIGNED64, "UNSIGNED64", &hf_cops_epd_u64},
902
    {BER_CLASS_ANY, 0,                          -1,              NULL, NULL}
903
};
904
905
0
static int cops_tag_cls2syntax ( unsigned tag, unsigned cls ) {
906
0
    COPS_CNV *cnv;
907
908
909
0
    cnv = CopsCnv;
910
0
    while (cnv->syntax != -1)
911
0
    {
912
0
        if (cnv->tag == tag && cnv->ber_class == cls)
913
0
        {
914
0
            return *(cnv->hfidp);
915
0
        }
916
0
        cnv++;
917
0
    }
918
0
    return hf_cops_epd_unknown;
919
0
}
920
921
static unsigned
922
get_cops_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
923
39
{
924
    /*
925
     * Get the length of the COPS message.
926
     */
927
39
    return tvb_get_ntohl(tvb, offset + 4);
928
39
}
929
930
static int
931
dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
932
39
{
933
39
    uint8_t op_code;
934
39
    uint16_t client_type;
935
39
    int object_len;
936
39
    proto_item *ti, *tv;
937
39
    proto_tree *cops_tree, *ver_flags_tree;
938
39
    uint32_t msg_len;
939
39
    uint32_t offset = 0;
940
39
    uint8_t ver_flags;
941
39
    int garbage;
942
39
    uint32_t handle_value = 0;
943
944
    /* variables for Request/Response tracking */
945
39
    unsigned i;
946
39
    bool is_solicited, is_request, is_response;
947
39
    conversation_t *conversation;
948
39
    cops_conv_info_t *cops_conv_info;
949
39
    cops_call_t *cops_call;
950
39
    wmem_array_t* pdus_array;
951
39
    nstime_t delta;
952
953
39
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "COPS");
954
39
    col_clear(pinfo->cinfo, COL_INFO);
955
956
39
    op_code = tvb_get_uint8(tvb, 1);
957
39
    col_add_fstr(pinfo->cinfo, COL_INFO, "COPS %s",
958
39
                 val_to_str_const(op_code, cops_op_code_vals, "Unknown Op Code"));
959
960
    /* Currently used by PacketCable */
961
39
    client_type = tvb_get_ntohs(tvb, 2);
962
963
39
    ti = proto_tree_add_item(tree, proto_cops, tvb, offset, -1, ENC_NA);
964
39
    cops_tree = proto_item_add_subtree(ti, ett_cops);
965
966
    /* Version and flags share the same byte, put them in a subtree */
967
39
    ver_flags = tvb_get_uint8(tvb, offset);
968
39
    is_solicited = (lo_nibble(ver_flags) == 0x01);
969
39
    tv = proto_tree_add_uint_format(cops_tree, hf_cops_ver_flags, tvb, offset, 1,
970
39
                                    ver_flags, "Version: %u, Flags: %s",
971
39
                                    hi_nibble(ver_flags),
972
39
                                    val_to_str_const(lo_nibble(ver_flags), cops_flags_vals, "Unknown"));
973
39
    ver_flags_tree = proto_item_add_subtree(tv, ett_cops_ver_flags);
974
39
    proto_tree_add_uint(ver_flags_tree, hf_cops_version, tvb, offset, 1, ver_flags);
975
39
    proto_tree_add_uint(ver_flags_tree, hf_cops_flags, tvb, offset, 1, ver_flags);
976
39
    offset++;
977
978
39
    proto_tree_add_item(cops_tree, hf_cops_op_code, tvb, offset, 1, ENC_BIG_ENDIAN);
979
39
    offset ++;
980
39
    proto_tree_add_item(cops_tree, hf_cops_client_type, tvb, offset, 2, ENC_BIG_ENDIAN);
981
39
    offset += 2;
982
983
39
    msg_len = tvb_get_ntohl(tvb, offset);
984
39
    proto_tree_add_uint(cops_tree, hf_cops_msg_len, tvb, offset, 4, msg_len);
985
39
    offset += 4;
986
987
96
    while (tvb_reported_length_remaining(tvb, offset) >= COPS_OBJECT_HDR_SIZE) {
988
60
        object_len = dissect_cops_object(tvb, pinfo, op_code, offset, cops_tree, client_type, &handle_value);
989
60
        if (object_len < 0)
990
3
            return offset;
991
57
        offset += object_len;
992
57
    }
993
994
36
    garbage = tvb_reported_length_remaining(tvb, offset);
995
36
    if (garbage > 0) {
996
1
        proto_tree_add_expert_format(tree, pinfo, &ei_cops_trailing_garbage, tvb, offset, garbage, "Trailing garbage: %d byte%s", garbage, plurality(garbage, "", "s"));
997
1
    }
998
999
    /* Start request/response matching */
1000
1001
    /* handle is 0(or not present), and op_code doesn't allow null handle, return */
1002
    /* TODO, add expert info for this abnormal */
1003
36
    if (handle_value == 0 &&
1004
21
        ( op_code != COPS_MSG_SSQ &&
1005
21
          op_code != COPS_MSG_OPN &&
1006
20
          op_code != COPS_MSG_CAT &&
1007
18
          op_code != COPS_MSG_CC &&
1008
18
          op_code != COPS_MSG_KA &&
1009
17
          op_code != COPS_MSG_SSC) ) {
1010
17
        return offset;
1011
17
    }
1012
1013
1014
19
    is_request  =
1015
19
         op_code == COPS_MSG_REQ ||                   /* expects DEC */
1016
5
        (op_code == COPS_MSG_DEC && !is_solicited) || /* expects RPT|DRQ */
1017
/*                  COPS_MSG_RPT                         doesn't expect response */
1018
/*                  COPS_MSG_DRQ                         doesn't expect response */
1019
5
         op_code == COPS_MSG_SSQ ||                   /* expects RPT|DRQ|SSC */
1020
5
         op_code == COPS_MSG_OPN ||                   /* expects CAT|CC */
1021
/*                  COPS_MSG_CAT                         doesn't expect response */
1022
/*                  COPS_MSG_CC                          doesn't expect response */
1023
4
        (op_code == COPS_MSG_KA && !is_solicited);    /* expects KA from PDP, always initialized by PEP */
1024
/*                  COPS_MSG_SSC                         doesn't expect response */
1025
1026
19
    is_response =
1027
/*                  COPS_MSG_REQ                         request only */
1028
19
        (op_code == COPS_MSG_DEC && is_solicited) ||  /* response only if reply REQ */
1029
5
        (op_code == COPS_MSG_RPT && is_solicited) ||  /* response only if reply DEC/SSQ */
1030
5
        (op_code == COPS_MSG_DRQ && is_solicited) ||  /* response only if reply DEC/SSQ */
1031
/*                  COPS_MSG_SSQ                         request only */
1032
/*                  COPS_MSG_OPN                         request only */
1033
5
         op_code == COPS_MSG_CAT ||                   /* response for OPN */
1034
3
        (op_code == COPS_MSG_CC  && is_solicited) ||  /* response for OPN */
1035
3
        (op_code == COPS_MSG_KA  && is_solicited) ||  /* response for KA from PEP */
1036
3
         op_code == COPS_MSG_SSC;                     /* response for SSQ */
1037
1038
19
    conversation = find_or_create_conversation(pinfo);
1039
19
    cops_conv_info = (cops_conv_info_t *)conversation_get_proto_data(conversation, proto_cops);
1040
19
    if (!cops_conv_info) {
1041
4
        cops_conv_info = wmem_new(wmem_file_scope(), cops_conv_info_t);
1042
1043
4
        cops_conv_info->pdus_tree = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
1044
4
        conversation_add_proto_data(conversation, proto_cops, cops_conv_info);
1045
4
    }
1046
1047
19
    if ( is_request ||
1048
3
        (op_code == COPS_MSG_DEC && is_solicited) ) { /* DEC as response for REQ is considered as request, because it expects RPT|DRQ */
1049
1050
2
        pdus_array = (wmem_array_t *)wmem_map_lookup(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value));
1051
2
        if (pdus_array == NULL) { /* This is the first request we've seen with this handle_value */
1052
2
            pdus_array = wmem_array_new(wmem_file_scope(), sizeof(cops_call_t *));
1053
2
            wmem_map_insert(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value), pdus_array);
1054
2
        }
1055
1056
2
        if (!pinfo->fd->visited) {
1057
            /*
1058
             * XXX - yes, we're setting all the fields in this
1059
             * structure, but there's padding between op_code
1060
             * and solicited, and that can't be set.
1061
             *
1062
             * For some reason, on some platforms, valgrind is
1063
             * complaining about a test of the solicited field
1064
             * accessing uninitialized data, perhaps because
1065
             * the 8 bytes containing op_code and solicited is
1066
             * being loaded as a unit.  If the compiler is, for
1067
             * example, turning a test of
1068
             *
1069
             *   cops_call->op_code == COPS_MSG_KA && !(cops_call->solicited)
1070
             *
1071
             * into a load of those 8 bytes and a comparison against a value
1072
             * with op_code being COPS_MSG_KA, solicited being false (0),
1073
             * *and* the padding being zero, it's buggy, but overly-"clever"
1074
             * buggy compilers do exist, so....)
1075
             *
1076
             * So we use wmem_new0() to forcibly zero out the entire
1077
             * structure before filling it in.
1078
             */
1079
2
            cops_call = wmem_new0(wmem_file_scope(), cops_call_t);
1080
2
            cops_call->op_code = op_code;
1081
2
            cops_call->solicited = is_solicited;
1082
2
            cops_call->req_num = pinfo->num;
1083
2
            cops_call->rsp_num = 0;
1084
2
            cops_call->req_time = pinfo->abs_ts;
1085
2
            wmem_array_append_one(pdus_array, cops_call);
1086
2
        }
1087
0
        else {
1088
0
            for (i=0; i < wmem_array_get_count(pdus_array); i++) {
1089
0
                cops_call = *(cops_call_t**)(wmem_array_index(pdus_array, i));
1090
0
                if ( cops_call->req_num == pinfo->num
1091
0
                  && cops_call->rsp_num != 0)  {
1092
0
                    ti = proto_tree_add_uint_format(cops_tree, hf_cops_response_in, tvb, 0, 0, cops_call->rsp_num,
1093
0
                                                      "Response to this request is in frame %u", cops_call->rsp_num);
1094
0
                    proto_item_set_generated(ti);
1095
0
                }
1096
0
            }
1097
0
        }
1098
2
    }
1099
1100
19
    if (is_response) {
1101
2
        pdus_array = (wmem_array_t *)wmem_map_lookup(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value));
1102
1103
2
        if (pdus_array == NULL) /* There's no request with this handle value */
1104
2
            return offset;
1105
1106
0
        if (!pinfo->fd->visited) {
1107
0
            for (i=0; i < wmem_array_get_count(pdus_array); i++) {
1108
0
                cops_call = *(cops_call_t**)(wmem_array_index(pdus_array, i));
1109
1110
0
                if (nstime_cmp(&pinfo->abs_ts, &cops_call->req_time) <= 0 || cops_call->rsp_num != 0)
1111
0
                    continue;
1112
1113
0
                if (
1114
0
                    ( (cops_call->op_code == COPS_MSG_REQ) &&
1115
0
                        (op_code == COPS_MSG_DEC && is_solicited) ) ||
1116
0
                    ( (cops_call->op_code == COPS_MSG_DEC) &&
1117
0
                        ( (op_code == COPS_MSG_RPT && is_solicited) ||
1118
0
                          (op_code == COPS_MSG_DRQ && is_solicited) ) ) ||
1119
0
                    ( (cops_call->op_code == COPS_MSG_SSQ) &&
1120
0
                        ( (op_code == COPS_MSG_RPT && is_solicited) ||
1121
0
                          (op_code == COPS_MSG_DRQ && is_solicited) ||
1122
0
                          (op_code == COPS_MSG_SSC) ) ) ||
1123
0
                    ( (cops_call->op_code == COPS_MSG_OPN) &&
1124
0
                        (op_code == COPS_MSG_CAT ||
1125
0
                         op_code == COPS_MSG_CC) ) ||
1126
0
                    ( (cops_call->op_code == COPS_MSG_KA && !(cops_call->solicited)) &&
1127
0
                        (op_code == COPS_MSG_KA && is_solicited) ) ) {
1128
0
                    cops_call->rsp_num = pinfo->num;
1129
0
                    break;
1130
0
                }
1131
0
            }
1132
0
        }
1133
0
        else {
1134
0
            for (i=0; i < wmem_array_get_count(pdus_array); i++) {
1135
0
                cops_call = *(cops_call_t**)(wmem_array_index(pdus_array, i));
1136
0
                if ( cops_call->rsp_num == pinfo->num ) {
1137
0
                    ti = proto_tree_add_uint_format(cops_tree, hf_cops_response_to, tvb, 0, 0, cops_call->req_num,
1138
0
                                                      "Response to a request in frame %u", cops_call->req_num);
1139
0
                    proto_item_set_generated(ti);
1140
1141
0
                    nstime_delta(&delta, &pinfo->abs_ts, &cops_call->req_time);
1142
0
                    ti = proto_tree_add_time(cops_tree, hf_cops_response_time, tvb, 0, 0, &delta);
1143
0
                    proto_item_set_generated(ti);
1144
1145
0
                    break;
1146
0
                }
1147
0
            }
1148
0
        }
1149
0
    }
1150
1151
17
    return tvb_reported_length(tvb);
1152
19
}
1153
1154
/* Code to actually dissect the packets */
1155
static int
1156
dissect_cops(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1157
37
{
1158
37
    tcp_dissect_pdus(tvb, pinfo, tree, cops_desegment, 8,
1159
37
                     get_cops_pdu_len, dissect_cops_pdu, data);
1160
37
    return tvb_reported_length(tvb);
1161
37
}
1162
1163
static const char *cops_c_type_to_str(uint8_t c_num, uint8_t c_type)
1164
112
{
1165
112
    switch (c_num) {
1166
8
    case COPS_OBJ_HANDLE:
1167
8
        if (c_type == 1)
1168
4
            return "Client Handle";
1169
4
        break;
1170
4
    case COPS_OBJ_IN_INT:
1171
4
    case COPS_OBJ_OUT_INT:
1172
4
        if (c_type == 1)
1173
0
            return "IPv4 Address + Interface";
1174
4
        else if (c_type == 2)
1175
0
            return "IPv6 Address + Interface";
1176
4
        break;
1177
4
    case COPS_OBJ_DECISION:
1178
8
    case COPS_OBJ_LPDPDECISION:
1179
8
        if (c_type == 1)
1180
0
            return "Decision Flags (Mandatory)";
1181
8
        else if (c_type == 2)
1182
0
            return "Stateless Data";
1183
8
        else if (c_type == 3)
1184
0
            return "Replacement Data";
1185
8
        else if (c_type == 4)
1186
0
            return "Client Specific Decision Data";
1187
8
        else if (c_type == 5)
1188
0
            return "Named Decision Data";
1189
8
        break;
1190
8
    case COPS_OBJ_CLIENTSI:
1191
4
        if (c_type == 1)
1192
0
            return "Signaled ClientSI";
1193
4
        else if (c_type == 2)
1194
0
            return "Named ClientSI";
1195
4
        break;
1196
4
    case COPS_OBJ_KATIMER:
1197
2
        if (c_type == 1)
1198
0
            return "Keep-alive timer value";
1199
2
        break;
1200
2
    case COPS_OBJ_PDPREDIRADDR:
1201
4
    case COPS_OBJ_LASTPDPADDR:
1202
4
        if (c_type == 1)
1203
0
            return "IPv4 Address + TCP Port";
1204
4
        else if (c_type == 2)
1205
0
            return "IPv6 Address + TCP Port";
1206
4
        break;
1207
4
    case COPS_OBJ_ACCTTIMER:
1208
0
        if (c_type == 1)
1209
0
            return "Accounting timer value";
1210
0
        break;
1211
4
    case COPS_OBJ_INTEGRITY:
1212
4
        if (c_type == 1)
1213
0
            return "HMAC digest";
1214
4
        break;
1215
112
    }
1216
1217
108
    return "";
1218
112
}
1219
1220
static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, uint8_t op_code, uint32_t offset, proto_tree *tree, uint16_t client_type, uint32_t* handle_value)
1221
60
{
1222
60
    int object_len, contents_len;
1223
60
    uint8_t c_num, c_type;
1224
60
    proto_item *ti;
1225
60
    proto_tree *obj_tree;
1226
60
    const char *type_str;
1227
1228
60
    object_len = tvb_get_ntohs(tvb, offset);
1229
60
    if (object_len < COPS_OBJECT_HDR_SIZE) {
1230
        /* Bogus! */
1231
3
        ti = proto_tree_add_uint(tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1232
3
        expert_add_info_format(pinfo, ti, &ei_cops_bad_cops_object_length,
1233
3
                                    "Bad COPS object length: %u, should be at least %u",
1234
3
                                    object_len, COPS_OBJECT_HDR_SIZE);
1235
3
        return -1;
1236
3
    }
1237
57
    c_num = tvb_get_uint8(tvb, offset + 2);
1238
57
    c_type = tvb_get_uint8(tvb, offset + 3);
1239
1240
57
    ti = proto_tree_add_uint_format(tree, hf_cops_obj_c_num, tvb, offset, object_len, c_num,
1241
57
                                    "%s: %s", val_to_str_const(c_num, cops_c_num_vals, "Unknown"),
1242
57
                                    cops_c_type_to_str(c_num, c_type));
1243
57
    obj_tree = proto_item_add_subtree(ti, ett_cops_obj);
1244
1245
57
    proto_tree_add_uint(obj_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1246
57
    offset += 2;
1247
1248
57
    proto_tree_add_uint(obj_tree, hf_cops_obj_c_num, tvb, offset, 1, c_num);
1249
57
    offset++;
1250
1251
57
    type_str = cops_c_type_to_str(c_num, c_type);
1252
57
    proto_tree_add_uint_format_value(obj_tree, hf_cops_obj_c_type, tvb, offset, 1, c_type,
1253
57
                                     "%s%s%u%s",
1254
57
                                     type_str,
1255
57
                                     strlen(type_str) ? " (" : "",
1256
57
                                     c_type,
1257
57
                                     strlen(type_str) ? ")" : "");
1258
57
    offset++;
1259
1260
57
    contents_len = object_len - COPS_OBJECT_HDR_SIZE;
1261
57
    dissect_cops_object_data(tvb, pinfo, offset, obj_tree, op_code, client_type, c_num, c_type, contents_len, handle_value);
1262
1263
    /* Pad to 32bit boundary */
1264
57
    if (object_len % sizeof (uint32_t))
1265
28
        object_len += ((int)sizeof (uint32_t) - object_len % (int)sizeof (uint32_t));
1266
1267
57
    return object_len;
1268
60
}
1269
1270
static void dissect_cops_pr_objects(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree, int pr_len,
1271
                                    oid_info_t** oid_info_p, uint32_t** pprid_subids_p, unsigned* pprid_subids_len_p)
1272
0
{
1273
0
    int object_len, contents_len;
1274
0
    uint8_t s_num, s_type;
1275
0
    const char *type_str;
1276
0
    int ret;
1277
0
    proto_tree *cops_pr_tree, *obj_tree;
1278
0
    proto_item *ti;
1279
1280
0
    cops_pr_tree = proto_item_add_subtree(tree, ett_cops_pr_obj);
1281
1282
0
    while (pr_len >= COPS_OBJECT_HDR_SIZE) {
1283
0
        object_len = tvb_get_ntohs(tvb, offset);
1284
0
        if (object_len < COPS_OBJECT_HDR_SIZE) {
1285
            /* Bogus! */
1286
0
            ti = proto_tree_add_uint(cops_pr_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1287
0
            expert_add_info_format(pinfo, ti, &ei_cops_bad_cops_pr_object_length,
1288
0
                                        "Bad COPS-PR object length: %u, should be at least %u",
1289
0
                                        object_len, COPS_OBJECT_HDR_SIZE);
1290
0
            return;
1291
0
        }
1292
0
        s_num = tvb_get_uint8(tvb, offset + 2);
1293
1294
0
        ti = proto_tree_add_uint_format(cops_pr_tree, hf_cops_obj_s_num, tvb, offset, object_len, s_num,
1295
0
                                        "%s", val_to_str_const(s_num, cops_s_num_vals, "Unknown"));
1296
0
        obj_tree = proto_item_add_subtree(ti, ett_cops_pr_obj);
1297
1298
0
        proto_tree_add_uint(obj_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
1299
0
        offset += 2;
1300
0
        pr_len -= 2;
1301
1302
0
        proto_tree_add_uint(obj_tree, hf_cops_obj_s_num, tvb, offset, 1, s_num);
1303
0
        offset++;
1304
0
        pr_len--;
1305
1306
0
        s_type = tvb_get_uint8(tvb, offset);
1307
0
        type_str = val_to_str_const(s_type, cops_s_type_vals, "Unknown");
1308
0
        proto_tree_add_uint_format_value(obj_tree, hf_cops_obj_s_type, tvb, offset, 1, s_type,
1309
0
                                         "%s%s%u%s",
1310
0
                                         type_str,
1311
0
                                         strlen(type_str) ? " (" : "",
1312
0
                                         s_type,
1313
0
                                         strlen(type_str) ? ")" : "");
1314
0
        offset++;
1315
0
        pr_len--;
1316
1317
0
        contents_len = object_len - COPS_OBJECT_HDR_SIZE;
1318
0
        ret = dissect_cops_pr_object_data(tvb, pinfo, offset, obj_tree, s_num, s_type, contents_len,
1319
0
                                          oid_info_p, pprid_subids_p, pprid_subids_len_p);
1320
0
        if (ret < 0)
1321
0
            break;
1322
1323
        /* Pad to 32bit boundary */
1324
0
        if (object_len % sizeof (uint32_t))
1325
0
            object_len += ((int)sizeof (uint32_t) - object_len % (int)sizeof (uint32_t));
1326
1327
0
        pr_len -= object_len - COPS_OBJECT_HDR_SIZE;
1328
0
        offset += object_len - COPS_OBJECT_HDR_SIZE;
1329
0
    }
1330
0
}
1331
1332
static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree,
1333
                                     uint8_t op_code, uint16_t client_type, uint8_t c_num, uint8_t c_type, int len, uint32_t* handle_value)
1334
56
{
1335
56
    proto_item *ti;
1336
56
    proto_tree *r_type_tree, *itf_tree, *reason_tree, *dec_tree, *error_tree, *clientsi_tree, *pdp_tree;
1337
56
    uint16_t r_type, m_type, reason, reason_sub, cmd_code, cmd_flags, error, error_sub,
1338
56
            tcp_port, katimer, accttimer;
1339
56
    uint32_t ifindex;
1340
56
    ws_in6_addr ipv6addr;
1341
56
    oid_info_t* oid_info = NULL;
1342
56
    uint32_t* pprid_subids = NULL;
1343
56
    unsigned pprid_subids_len = 0;
1344
1345
56
    switch (c_num) {
1346
4
    case COPS_OBJ_HANDLE:       /* handle is a variable-length field, however 32bit seems enough for most of the applications */
1347
4
        if (len >= 4) {
1348
4
            offset += (len-4);  /* for handle longer than 32bit, only take lowest 32 bits as handle */
1349
4
            *handle_value = tvb_get_ntohl(tvb, offset);
1350
4
            proto_tree_add_item(tree, hf_cops_handle, tvb, offset, 4, ENC_BIG_ENDIAN);
1351
4
        }
1352
4
        break;
1353
4
    case COPS_OBJ_CONTEXT:
1354
4
        r_type = tvb_get_ntohs(tvb, offset);
1355
4
        m_type = tvb_get_ntohs(tvb, offset + 2);
1356
4
        r_type_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_r_type_flags, NULL,
1357
4
                                 "Contents: R-Type: %s, M-Type: %u",
1358
4
                                 val_to_str_const(r_type, cops_r_type_vals, "Unknown"), m_type);
1359
1360
4
        proto_tree_add_uint(r_type_tree, hf_cops_r_type_flags, tvb, offset, 2, r_type);
1361
4
        offset += 2;
1362
4
        proto_tree_add_uint(r_type_tree, hf_cops_m_type_flags, tvb, offset, 2, m_type);
1363
1364
4
        break;
1365
1
    case COPS_OBJ_IN_INT:
1366
2
    case COPS_OBJ_OUT_INT:
1367
2
        if (c_type == 1) {          /* IPv4 */
1368
0
            ifindex = tvb_get_ntohl(tvb, offset + 4);
1369
0
            itf_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_cops_itf, NULL,
1370
0
                                     "Contents: IPv4 address %s, ifIndex: %u",
1371
0
                                     tvb_ip_to_str(pinfo->pool, tvb, offset), ifindex);
1372
0
            proto_tree_add_item(itf_tree,
1373
0
                                (c_num == COPS_OBJ_IN_INT) ? hf_cops_in_int_ipv4 : hf_cops_out_int_ipv4,
1374
0
                                tvb, offset, 4, ENC_BIG_ENDIAN);
1375
0
            offset += 4;
1376
2
        } else if (c_type == 2) {   /* IPv6 */
1377
0
            ifindex = tvb_get_ntohl(tvb, offset + (int)sizeof ipv6addr);
1378
0
            itf_tree = proto_tree_add_subtree_format(tree, tvb, offset, 20, ett_cops_itf, NULL,
1379
0
                                     "Contents: IPv6 address %s, ifIndex: %u",
1380
0
                                     tvb_ip6_to_str(pinfo->pool, tvb, offset), ifindex);
1381
0
            proto_tree_add_item(itf_tree,
1382
0
                                (c_num == COPS_OBJ_IN_INT) ? hf_cops_in_int_ipv6 : hf_cops_out_int_ipv6,
1383
0
                                tvb, offset, 16, ENC_NA);
1384
0
            offset += 16;
1385
2
        } else {
1386
2
            break;
1387
2
        }
1388
0
        proto_tree_add_uint(itf_tree, hf_cops_int_ifindex, tvb, offset, 4, ifindex);
1389
1390
0
        break;
1391
3
    case COPS_OBJ_REASON:
1392
3
        reason = tvb_get_ntohs(tvb, offset);
1393
3
        reason_sub = tvb_get_ntohs(tvb, offset + 2);
1394
3
        reason_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_reason, NULL,
1395
3
                                 "Contents: Reason-Code: %s, Reason Sub-code: 0x%04x",
1396
3
                                 val_to_str_const(reason, cops_reason_vals, "<Unknown value>"), reason_sub);
1397
3
        proto_tree_add_uint(reason_tree, hf_cops_reason, tvb, offset, 2, reason);
1398
3
        offset += 2;
1399
3
        if (reason == 13) { /* RFC 2748 2.2.5 */
1400
0
            proto_tree_add_uint_format_value(reason_tree, hf_cops_reason_sub, tvb, offset, 2,
1401
0
                                reason_sub, "Unknown object's C-Num %u, C-Type %u",
1402
0
                                tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1));
1403
0
        } else
1404
3
            proto_tree_add_uint(reason_tree, hf_cops_reason_sub, tvb, offset, 2, reason_sub);
1405
1406
3
        break;
1407
1
    case COPS_OBJ_DECISION:
1408
4
    case COPS_OBJ_LPDPDECISION:
1409
4
        if (c_type == 1) {
1410
0
            cmd_code = tvb_get_ntohs(tvb, offset);
1411
0
            cmd_flags = tvb_get_ntohs(tvb, offset + 2);
1412
0
            dec_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_decision, NULL, "Contents: Command-Code: %s, Flags: %s",
1413
0
                                     val_to_str_const(cmd_code, cops_dec_cmd_code_vals, "<Unknown value>"),
1414
0
                                     val_to_str_const(cmd_flags, cops_dec_cmd_flag_vals, "<Unknown flag>"));
1415
0
            proto_tree_add_uint(dec_tree, hf_cops_dec_cmd_code, tvb, offset, 2, cmd_code);
1416
0
            offset += 2;
1417
0
            proto_tree_add_uint(dec_tree, hf_cops_dec_flags, tvb, offset, 2, cmd_flags);
1418
4
        } else if (c_type == 5) { /*COPS-PR Data*/
1419
0
            dec_tree = proto_tree_add_subtree_format(tree, tvb, offset, len, ett_cops_decision, NULL, "Contents: %d bytes", len);
1420
0
            dissect_cops_pr_objects(tvb, pinfo, offset, dec_tree, len, &oid_info, &pprid_subids, &pprid_subids_len);
1421
0
        }
1422
1423
        /* PacketCable : Analyze the remaining data if available */
1424
4
        if (client_type == COPS_CLIENT_PC_DQOS && c_type == 4) {
1425
0
            cops_analyze_packetcable_dqos_obj(tvb, pinfo, tree, op_code, offset);
1426
4
        } else if (client_type == COPS_CLIENT_PC_MM && c_type == 4) {
1427
0
            cops_analyze_packetcable_mm_obj(tvb, pinfo, tree, op_code, offset);
1428
0
        }
1429
1430
4
        break;
1431
2
    case COPS_OBJ_ERROR:
1432
2
        if (c_type != 1)
1433
2
            break;
1434
1435
0
        error = tvb_get_ntohs(tvb, offset);
1436
0
        error_sub = tvb_get_ntohs(tvb, offset + 2);
1437
0
        error_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_error, NULL,
1438
0
                                 "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1439
0
                                 val_to_str_const(error, cops_error_vals, "<Unknown value>"), error_sub);
1440
0
        proto_tree_add_uint(error_tree, hf_cops_error, tvb, offset, 2, error);
1441
0
        offset += 2;
1442
0
        if (error == 13) { /* RFC 2748 2.2.8 */
1443
0
            proto_tree_add_uint_format_value(error_tree, hf_cops_error_sub, tvb, offset, 2,
1444
0
                                error_sub, "Unknown object's C-Num %u, C-Type %u",
1445
0
                                tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1));
1446
0
        } else
1447
0
            proto_tree_add_uint(error_tree, hf_cops_error_sub, tvb, offset, 2, error_sub);
1448
1449
0
        break;
1450
2
    case COPS_OBJ_CLIENTSI:
1451
1452
        /* For PacketCable */
1453
2
        if (client_type == COPS_CLIENT_PC_DQOS && c_type == 1) {
1454
0
            cops_analyze_packetcable_dqos_obj(tvb, pinfo, tree, op_code, offset);
1455
0
            break;
1456
2
        } else if (client_type == COPS_CLIENT_PC_MM && c_type == 1) {
1457
0
            cops_analyze_packetcable_mm_obj(tvb, pinfo, tree, op_code, offset);
1458
0
            break;
1459
0
        }
1460
1461
2
        if (c_type != 2) /*Not COPS-PR data*/
1462
2
            break;
1463
1464
0
        clientsi_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_clientsi, NULL, "Contents: %d bytes", len);
1465
1466
0
        dissect_cops_pr_objects(tvb, pinfo, offset, clientsi_tree, len, &oid_info, &pprid_subids, &pprid_subids_len);
1467
1468
0
        break;
1469
1
    case COPS_OBJ_KATIMER:
1470
1
        if (c_type != 1)
1471
1
            break;
1472
1473
0
        katimer = tvb_get_ntohs(tvb, offset + 2);
1474
0
        if (katimer == 0) {
1475
0
            proto_tree_add_uint_format_value(tree, hf_cops_katimer, tvb, offset + 2, 2, katimer, "0 (infinity)");
1476
0
        } else {
1477
0
            proto_tree_add_item(tree, hf_cops_katimer, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1478
0
        }
1479
0
        break;
1480
1
    case COPS_OBJ_PEPID:
1481
1
        if (c_type != 1)
1482
1
            break;
1483
1484
0
        if (tvb_strnlen(tvb, offset, len) == -1) {
1485
0
            ti = proto_tree_add_item(tree, hf_cops_pepid, tvb, offset, len, ENC_ASCII);
1486
0
            expert_add_info(pinfo, ti, &ei_cops_pepid_not_null);
1487
0
        }
1488
0
        else
1489
0
            proto_tree_add_item(tree, hf_cops_pepid, tvb, offset,
1490
0
                                tvb_strnlen(tvb, offset, len) + 1, ENC_ASCII);
1491
1492
0
        break;
1493
1
    case COPS_OBJ_REPORT_TYPE:
1494
1
        if (c_type != 1)
1495
1
            break;
1496
1497
0
        proto_tree_add_item(tree, hf_cops_report_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1498
1499
0
        break;
1500
1
    case COPS_OBJ_PDPREDIRADDR:
1501
2
    case COPS_OBJ_LASTPDPADDR:
1502
2
        if (c_type == 1) {          /* IPv4 */
1503
0
            tcp_port = tvb_get_ntohs(tvb, offset + 4 + 2);
1504
0
            pdp_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_cops_pdp, NULL,
1505
0
                                     "Contents: IPv4 address %s, TCP Port Number: %u",
1506
0
                                     tvb_ip_to_str(pinfo->pool, tvb, offset), tcp_port);
1507
0
            proto_tree_add_item(pdp_tree,
1508
0
                                (c_num == COPS_OBJ_PDPREDIRADDR) ? hf_cops_pdprediraddr_ipv4 : hf_cops_lastpdpaddr_ipv4,
1509
0
                                tvb, offset, 4, ENC_BIG_ENDIAN);
1510
0
            offset += 4;
1511
2
        } else if (c_type == 2) {   /* IPv6 */
1512
0
            tcp_port = tvb_get_ntohs(tvb, offset + (int)sizeof ipv6addr + 2);
1513
0
            pdp_tree = proto_tree_add_subtree_format(tree, tvb, offset, 20, ett_cops_pdp, NULL,
1514
0
                                     "Contents: IPv6 address %s, TCP Port Number: %u",
1515
0
                                     tvb_ip6_to_str(pinfo->pool, tvb, offset), tcp_port);
1516
0
            proto_tree_add_item(pdp_tree,
1517
0
                                (c_num == COPS_OBJ_PDPREDIRADDR) ? hf_cops_pdprediraddr_ipv6 : hf_cops_lastpdpaddr_ipv6,
1518
0
                                tvb, offset, 16, ENC_NA);
1519
0
            offset += 16;
1520
2
        } else {
1521
2
            break;
1522
2
        }
1523
0
        offset += 2;
1524
0
        proto_tree_add_uint(pdp_tree, hf_cops_pdp_tcp_port, tvb, offset, 2, tcp_port);
1525
1526
0
        break;
1527
0
    case COPS_OBJ_ACCTTIMER:
1528
0
        if (c_type != 1)
1529
0
            break;
1530
1531
0
        accttimer = tvb_get_ntohs(tvb, offset + 2);
1532
0
        if (accttimer == 0) {
1533
0
            proto_tree_add_uint_format_value(tree, hf_cops_accttimer, tvb, offset + 2, 2, accttimer,
1534
0
                "0 (there SHOULD be no unsolicited accounting updates)");
1535
0
        } else {
1536
0
            proto_tree_add_item(tree, hf_cops_accttimer, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1537
0
        }
1538
0
        break;
1539
2
    case COPS_OBJ_INTEGRITY:
1540
2
        if (c_type != 1)
1541
2
            break;      /* Not HMAC digest */
1542
1543
0
        proto_tree_add_item(tree, hf_cops_key_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1544
0
        proto_tree_add_item(tree, hf_cops_seq_num, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1545
0
        proto_tree_add_item(tree, hf_cops_keyed_message_digest, tvb, offset + 8 , len - 8, ENC_NA);
1546
1547
0
        break;
1548
28
    default:
1549
28
        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);
1550
28
        break;
1551
56
    }
1552
56
}
1553
1554
0
static unsigned redecode_oid(wmem_allocator_t* scope, uint32_t* pprid_subids, unsigned pprid_subids_len, uint8_t* encoded_subids, unsigned encoded_len, uint32_t** subids_p) {
1555
0
    unsigned i;
1556
0
    unsigned n = 0;
1557
0
    uint32_t subid = 0;
1558
0
    uint32_t* subids;
1559
0
    uint32_t* subid_overflow;
1560
1561
0
    for (i=0; i<encoded_len; i++) { if (! (encoded_subids[i] & 0x80 )) n++; }
1562
1563
0
    *subids_p = subids = (uint32_t *)wmem_alloc(scope, sizeof(uint32_t)*(n+pprid_subids_len));
1564
0
    subid_overflow = subids+n+pprid_subids_len;
1565
0
    for (i=0;i<pprid_subids_len;i++) subids[i] = pprid_subids[i];
1566
1567
0
    subids += pprid_subids_len;
1568
1569
1570
0
    for (i=0; i<encoded_len; i++){
1571
0
        uint8_t byte = encoded_subids[i];
1572
1573
0
        subid <<= 7;
1574
0
        subid |= byte & 0x7F;
1575
1576
0
        if (byte & 0x80) {
1577
0
            continue;
1578
0
        }
1579
1580
0
        DISSECTOR_ASSERT(subids < subid_overflow);
1581
0
        *subids++ = subid;
1582
0
        subid = 0;
1583
0
    }
1584
1585
0
    return pprid_subids_len+n;
1586
0
}
1587
1588
1589
static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, proto_tree *tree,
1590
                                       uint8_t s_num, uint8_t s_type, int len,
1591
0
                                       oid_info_t** oid_info_p, uint32_t** pprid_subids, unsigned* pprid_subids_len) {
1592
0
    proto_tree *asn_tree, *gperror_tree, *cperror_tree;
1593
0
    uint16_t gperror=0, gperror_sub=0, cperror=0, cperror_sub=0;
1594
0
    asn1_ctx_t actx;
1595
1596
0
    memset(&actx,0,sizeof(actx));
1597
0
    actx.pinfo = pinfo;
1598
1599
0
    switch (s_num){
1600
0
    case COPS_OBJ_PPRID: {
1601
0
        tvbuff_t* oid_tvb = NULL;
1602
1603
0
        if (s_type != 1) /* Not Prefix Provisioning Instance Identifier (PPRID) */
1604
0
            break;
1605
        /* Never tested this branch */
1606
0
        asn_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_cops_asn1, NULL, "Contents:");
1607
1608
0
        dissect_ber_object_identifier(false, &actx, asn_tree, tvb, offset, hf_cops_pprid_oid, &oid_tvb);
1609
1610
0
        if (oid_tvb) {
1611
0
            int encoid_len;
1612
0
            uint8_t* encoid;
1613
1614
0
            encoid_len = tvb_reported_length_remaining(oid_tvb,0);
1615
0
            if (encoid_len > 0) {
1616
0
                encoid = (uint8_t*)tvb_memdup(pinfo->pool,oid_tvb,0,encoid_len);
1617
0
                (*pprid_subids_len) = oid_encoded2subid(pinfo->pool, encoid, encoid_len, pprid_subids);
1618
0
            }
1619
0
        }
1620
0
        break;
1621
0
    }
1622
0
    case COPS_OBJ_PRID: {
1623
0
        uint32_t* subids;
1624
0
        unsigned subids_len;
1625
0
        unsigned matched;
1626
0
        unsigned left;
1627
0
        int8_t ber_class;
1628
0
        bool ber_pc;
1629
0
        int32_t ber_tag;
1630
0
        unsigned encoid_len;
1631
0
        uint8_t* encoid;
1632
0
        oid_info_t* oid_info;
1633
1634
0
        if (s_type != 1) break; /* Not Provisioning Instance Identifier (PRID) */
1635
1636
0
        asn_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_cops_asn1, NULL, "Contents:");
1637
1638
0
        offset = get_ber_identifier(tvb, offset, &ber_class, &ber_pc, &ber_tag);
1639
0
        offset = get_ber_length(tvb, offset, &encoid_len, NULL);
1640
1641
        /* TODO: check pc, class and tag */
1642
1643
0
        encoid = (uint8_t*)tvb_memdup(pinfo->pool,tvb,offset,encoid_len);
1644
1645
0
        if (*pprid_subids) {
1646
            /* Never tested this branch */
1647
0
            subids_len = redecode_oid(pinfo->pool, *pprid_subids, *pprid_subids_len, encoid, encoid_len, &subids);
1648
0
            encoid_len = oid_subid2encoded(pinfo->pool, subids_len, subids, &encoid);
1649
0
        } else {
1650
0
            subids_len = oid_encoded2subid(pinfo->pool, encoid, encoid_len, &subids);
1651
0
        }
1652
1653
0
        proto_tree_add_oid(asn_tree,hf_cops_prid_oid,tvb,offset,encoid_len,encoid);
1654
1655
0
        oid_info = oid_get(subids_len, subids, &matched, &left);
1656
1657
        /*
1658
          TODO: from RFC 3159 find-out how the values are mapped;
1659
          when instead of an oid for an xxEntry
1660
          we have one describing a scalar or something else;
1661
          what's below works in most cases but is not complete.
1662
        */
1663
0
        if (left <= 1 && oid_info->kind == OID_KIND_ROW) {
1664
0
            *oid_info_p = oid_info;
1665
0
        } else {
1666
0
            *oid_info_p = NULL;
1667
0
        }
1668
1669
0
        break;
1670
0
    }
1671
0
    case COPS_OBJ_EPD: {
1672
0
        oid_info_t* oid_info;
1673
0
        unsigned end_offset = offset + len;
1674
1675
0
        if (s_type != 1) break;/* Not Encoded Provisioning Instance Data (EPD) */
1676
1677
0
        asn_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_cops_asn1, NULL, "Contents:");
1678
1679
        /*
1680
         * XXX: LAZINESS WARNING:
1681
         * We are assuming that for the first element in the sequence
1682
         * that describes an entry subid==1, and, that the subsequent elements
1683
         * use ++subid; This is true for all IETF's PIBs (and good sense
1684
         * indicates it should be this way) but AFAIK there's nothing in
1685
         * SMIv2 that imposes this restriction.  -- a lazy lego
1686
         */
1687
1688
0
        if(*oid_info_p) {
1689
0
            if ((*oid_info_p)->kind == OID_KIND_ROW) {
1690
0
                oid_info = (oid_info_t *)wmem_tree_lookup32((*oid_info_p)->children,1);
1691
0
            } else {
1692
0
                oid_info = NULL;
1693
0
            }
1694
0
        } else {
1695
0
            oid_info = NULL;
1696
0
        }
1697
1698
1699
0
        while(offset < end_offset) {
1700
0
            int8_t ber_class;
1701
0
            bool ber_pc;
1702
0
            int32_t ber_tag;
1703
0
            uint32_t ber_length;
1704
0
            bool ber_ind;
1705
0
            int hfid;
1706
1707
0
            offset = get_ber_identifier(tvb, offset, &ber_class, &ber_pc, &ber_tag);
1708
0
            offset = get_ber_length(tvb, offset, &ber_length, &ber_ind);
1709
1710
0
            if (oid_info) {
1711
                /*
1712
                 * XXX: LAZINESS WARNING:
1713
                 * We are assuming that the value of the sequenced item is of
1714
                 * the right class, the right type and the right length.
1715
                 * We should check that to avoid throwing a Malformed packet and
1716
                 * keep dissecting.
1717
                 * We should verify the class and the tag match what we expect as well,
1718
                 * but COPS and SNMP use different tags (&#@$!) so the typedata in oid_info_t
1719
                 * does not work here.
1720
                 * -- a lazy lego
1721
                 */
1722
0
                hfid = oid_info->value_hfid;
1723
0
                oid_info = (oid_info_t *)wmem_tree_lookup32((*oid_info_p)->children,oid_info->subid+1);
1724
0
            } else
1725
0
                hfid = cops_tag_cls2syntax( ber_tag, ber_class );
1726
0
            switch (proto_registrar_get_ftype(hfid)) {
1727
1728
0
            case FT_INT8:
1729
0
            case FT_INT16:
1730
0
            case FT_INT24:
1731
0
            case FT_INT32:
1732
0
            case FT_INT64:
1733
0
            case FT_UINT8:
1734
0
            case FT_UINT16:
1735
0
            case FT_UINT24:
1736
0
            case FT_UINT32:
1737
0
            case FT_UINT64:
1738
0
            case FT_BOOLEAN:
1739
0
            case FT_FLOAT:
1740
0
            case FT_DOUBLE:
1741
0
            case FT_IPv4:
1742
0
                proto_tree_add_item(asn_tree,hfid,tvb,offset,ber_length,ENC_BIG_ENDIAN);
1743
0
                break;
1744
1745
0
            case FT_STRING:
1746
0
                proto_tree_add_item(asn_tree,hfid,tvb,offset,ber_length,ENC_ASCII|ENC_NA);
1747
0
                break;
1748
1749
0
            default:
1750
0
                proto_tree_add_item(asn_tree,hfid,tvb,offset,ber_length,ENC_NA);
1751
0
                break;
1752
0
            }
1753
1754
0
            offset += ber_length;
1755
0
        }
1756
1757
0
        (*oid_info_p) = NULL;
1758
0
        break;
1759
0
    }
1760
0
    case COPS_OBJ_ERRPRID: {
1761
0
        if (s_type != 1) break; /*Not  Error Provisioning Instance Identifier (ErrorPRID)*/
1762
1763
0
        asn_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_cops_asn1, NULL, "Contents:");
1764
1765
0
        dissect_ber_object_identifier(false, &actx, asn_tree, tvb, offset, hf_cops_errprid_oid, NULL);
1766
1767
0
        break;
1768
0
    }
1769
0
    case COPS_OBJ_GPERR:
1770
0
        if (s_type != 1) /* Not Global Provisioning Error Object (GPERR) */
1771
0
            break;
1772
1773
0
        gperror = tvb_get_ntohs(tvb, offset);
1774
0
        gperror_sub = tvb_get_ntohs(tvb, offset + 2);
1775
0
        gperror_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_gperror, NULL,
1776
0
                                 "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1777
0
                                 val_to_str_const(gperror, cops_gperror_vals, "<Unknown value>"), gperror_sub);
1778
0
        proto_tree_add_uint(gperror_tree, hf_cops_gperror, tvb, offset, 2, gperror);
1779
0
        offset += 2;
1780
0
        if (gperror == 13) { /* RFC 3084 4.4 */
1781
0
            proto_tree_add_uint_format_value(gperror_tree, hf_cops_gperror_sub, tvb, offset, 2,
1782
0
                                gperror_sub, "Unknown object's C-Num %u, C-Type %u",
1783
0
                                tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1));
1784
0
        } else
1785
0
            proto_tree_add_uint(gperror_tree, hf_cops_gperror_sub, tvb, offset, 2, gperror_sub);
1786
1787
0
        break;
1788
0
    case COPS_OBJ_CPERR:
1789
0
        if (s_type != 1) /*Not PRC Class Provisioning Error Object (CPERR) */
1790
0
            break;
1791
1792
0
        cperror = tvb_get_ntohs(tvb, offset);
1793
0
        cperror_sub = tvb_get_ntohs(tvb, offset + 2);
1794
0
        cperror_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_cops_gperror, NULL,
1795
0
                                 "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
1796
0
                                 val_to_str_const(gperror, cops_gperror_vals, "<Unknown value>"), gperror_sub);
1797
0
        proto_tree_add_uint(cperror_tree, hf_cops_cperror, tvb, offset, 2, cperror);
1798
0
        offset += 2;
1799
0
        if (cperror == 13) { /* RFC 3084 4.5 */
1800
0
            proto_tree_add_uint_format_value(cperror_tree, hf_cops_cperror_sub, tvb, offset, 2, cperror_sub,
1801
0
                                "Unknown object's S-Num %u, C-Type %u",
1802
0
                                tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1));
1803
0
        } else
1804
0
            proto_tree_add_uint(cperror_tree, hf_cops_cperror_sub, tvb, offset, 2, cperror_sub);
1805
1806
0
        break;
1807
0
    default:
1808
0
        proto_tree_add_bytes_format_value(tree, hf_cops_integrity_contents, tvb, offset, len, NULL, "%d bytes", len);
1809
0
        break;
1810
0
    }
1811
1812
0
    return 0;
1813
0
}
1814
1815
1816
/* Additions for PacketCable ( Added by Dick Gooris, Lucent Technologies ) */
1817
1818
/* Print the subtree information for cops */
1819
static proto_tree *
1820
0
info_to_cops_subtree(tvbuff_t *tvb, proto_tree *st, int n, int offset, const char *str) {
1821
0
    proto_item *tv;
1822
1823
0
    tv  = proto_tree_add_none_format( st, hf_cops_subtree, tvb, offset, n, "%s", str);
1824
0
    return proto_item_add_subtree( tv, ett_cops_subtree );
1825
0
}
1826
1827
/* Cops - Section : D-QoS Transaction ID */
1828
static void
1829
0
cops_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, uint8_t op_code, unsigned n, uint32_t offset) {
1830
1831
0
    proto_tree *stt;
1832
0
    proto_item *ti;
1833
0
    uint32_t code;
1834
1835
    /* Create a subtree */
1836
0
    stt = info_to_cops_subtree(tvb,st,n,offset,"D-QoS Transaction ID");
1837
0
    offset += 4;
1838
1839
    /* Transaction Identifier */
1840
0
    proto_tree_add_item(stt, hf_cops_pc_dqos_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1841
    // Keep for backwards compatibility
1842
0
    ti = proto_tree_add_item(stt, hf_cops_pc_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1843
0
    PROTO_ITEM_SET_HIDDEN(ti);
1844
0
    offset +=2;
1845
1846
    /* Gate Command Type */
1847
0
    proto_tree_add_item_ret_uint(stt, hf_cops_pc_dqos_gate_command_type,tvb, offset, 2, ENC_BIG_ENDIAN, &code);
1848
    // Keep for backwards compatibility
1849
0
    ti = proto_tree_add_item(stt, hf_cops_pc_gate_command_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1850
0
    PROTO_ITEM_SET_HIDDEN(ti);
1851
1852
    /* Write the right data into the 'info field' on the Gui */
1853
0
    col_add_str(pinfo->cinfo, COL_INFO, wmem_strdup_printf(pinfo->pool, "COPS %-20s - %s",
1854
0
        val_to_str_const(op_code, cops_op_code_vals, "Unknown"), val_to_str_const(code, table_cops_dqos_transaction_id, "Unknown")));
1855
0
}
1856
1857
/* Cops - Section : Subscriber IDv4 */
1858
static void
1859
0
cops_subscriber_id_v4(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
1860
1861
0
    proto_item *tv;
1862
1863
    /* Create a subtree */
1864
0
    tv = info_to_cops_subtree(tvb,st,n,offset,"Subscriber ID (IPv4)");
1865
0
    offset += 4;
1866
1867
    /* Subscriber Identifier */
1868
0
    proto_tree_add_item(tv, hf_cops_pc_subscriber_id_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1869
0
}
1870
1871
/* Cops - Section : Subscriber IDv6 */
1872
static void
1873
0
cops_subscriber_id_v6(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
1874
1875
0
    proto_item *tv;
1876
1877
    /* Create a subtree */
1878
0
    tv = info_to_cops_subtree(tvb,st,n,offset,"Subscriber ID (IPv6)");
1879
0
    offset += 4;
1880
1881
    /* Subscriber Identifier */
1882
0
    proto_tree_add_item(tv, hf_cops_pc_subscriber_id_ipv6, tvb, offset, 16, ENC_NA);
1883
0
}
1884
1885
/* Cops - Section : Gate ID */
1886
static void
1887
0
cops_gate_id(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
1888
1889
0
    proto_tree *stt;
1890
1891
    /* Create a subtree */
1892
0
    stt = info_to_cops_subtree(tvb,st,n,offset,"Gate ID");
1893
0
    offset += 4;
1894
1895
    /* Gate Identifier */
1896
0
    proto_tree_add_item(stt, hf_cops_pc_gate_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1897
0
}
1898
1899
/* Cops - Section : Activity Count */
1900
static void
1901
0
cops_activity_count(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
1902
1903
0
    proto_tree *stt;
1904
1905
    /* Create a subtree */
1906
0
    stt = info_to_cops_subtree(tvb,st,n,offset,"Activity Count");
1907
0
    offset += 4;
1908
1909
    /* Activity Count */
1910
0
    proto_tree_add_item(stt, hf_cops_pc_activity_count, tvb, offset, 4, ENC_BIG_ENDIAN);
1911
0
}
1912
1913
1914
static int
1915
cops_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name)
1916
0
{
1917
0
    proto_tree* object_tree;
1918
1919
    /* Reserved Envelope */
1920
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, 28, ett_cops_subtree, NULL, name);
1921
1922
    /* Token Bucket Rate */
1923
0
    proto_tree_add_item(object_tree, hf_cops_pc_token_bucket_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
1924
0
    offset += 4;
1925
1926
    /* Token Bucket Size */
1927
0
    proto_tree_add_item(object_tree, hf_cops_pc_token_bucket_size, tvb, offset, 4, ENC_BIG_ENDIAN);
1928
0
    offset += 4;
1929
1930
    /* Peak Data Rate */
1931
0
    proto_tree_add_item(object_tree, hf_cops_pc_peak_data_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
1932
0
    offset += 4;
1933
1934
    /* Minimum Policed Unit */
1935
0
    proto_tree_add_item(object_tree, hf_cops_pc_min_policed_unit, tvb, offset, 4, ENC_BIG_ENDIAN);
1936
0
    offset += 4;
1937
1938
    /* Maximum Packet Size */
1939
0
    proto_tree_add_item(object_tree, hf_cops_pc_max_packet_size, tvb, offset, 4, ENC_BIG_ENDIAN);
1940
0
    offset += 4;
1941
1942
    /* Rate */
1943
0
    proto_tree_add_item(object_tree, hf_cops_pc_spec_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
1944
0
    offset += 4;
1945
1946
    /* Slack Term */
1947
0
    proto_tree_add_item(object_tree, hf_cops_pc_slack_term, tvb, offset, 4, ENC_BIG_ENDIAN);
1948
0
    offset += 4;
1949
1950
0
    return offset;
1951
0
}
1952
1953
/* Cops - Section : Gate Specifications */
1954
static void
1955
0
cops_gate_specs(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
1956
1957
0
     proto_tree *stt;
1958
1959
     /* Create a subtree */
1960
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Specifications");
1961
0
     offset += 4;
1962
1963
     /* Direction */
1964
0
     proto_tree_add_item(stt, hf_cops_pc_direction, tvb, offset, 1, ENC_BIG_ENDIAN);
1965
0
     offset += 1;
1966
1967
     /* Protocol ID */
1968
0
     proto_tree_add_item(stt, hf_cops_pc_protocol_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1969
0
     offset += 1;
1970
1971
     /* Flags */
1972
0
     proto_tree_add_item(stt, hf_cops_pc_gate_spec_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
1973
0
     offset += 1;
1974
1975
     /* Session Class */
1976
0
     proto_tree_add_item(stt, hf_cops_pc_session_class, tvb, offset, 1, ENC_BIG_ENDIAN);
1977
0
     offset += 1;
1978
1979
     /* Source IP Address */
1980
0
     proto_tree_add_item(stt, hf_cops_pc_src_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
1981
0
     offset += 4;
1982
1983
     /* Destination IP Address */
1984
0
     proto_tree_add_item(stt, hf_cops_pc_dest_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
1985
0
     offset += 4;
1986
1987
     /* Source IP Port */
1988
0
     proto_tree_add_item(stt, hf_cops_pc_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
1989
0
     offset += 2;
1990
1991
     /* Destination IP Port */
1992
0
     proto_tree_add_item(stt, hf_cops_pc_dest_port, tvb, offset, 2, ENC_BIG_ENDIAN);
1993
0
     offset += 2;
1994
1995
     /* DiffServ Code Point */
1996
0
     proto_tree_add_item(stt, hf_cops_pc_ds_field, tvb, offset, 1, ENC_BIG_ENDIAN);
1997
0
     offset += 1;
1998
1999
     /* 3 octets Not specified */
2000
0
     offset += 3;
2001
2002
     /* Timer T1 Value */
2003
0
     proto_tree_add_item(stt, hf_cops_pc_t1_value, tvb, offset, 2, ENC_BIG_ENDIAN);
2004
0
     offset += 2;
2005
2006
     /* Reserved */
2007
0
     proto_tree_add_item(stt, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2008
0
     offset += 2;
2009
2010
     /* Timer T7 Value */
2011
0
     proto_tree_add_item(stt, hf_cops_pc_t7_value, tvb, offset, 2, ENC_BIG_ENDIAN);
2012
0
     offset += 2;
2013
2014
     /* Timer T8 Value */
2015
0
     proto_tree_add_item(stt, hf_cops_pc_t8_value, tvb, offset, 2, ENC_BIG_ENDIAN);
2016
0
     offset += 2;
2017
2018
0
     cops_envelope(tvb, stt, offset, "Gate Envelope");
2019
0
}
2020
2021
/* Cops - Section : Electronic Surveillance Parameters  */
2022
static void
2023
0
cops_surveillance_parameters(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
2024
2025
0
     proto_tree *stt;
2026
2027
     /* Create a subtree */
2028
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Electronic Surveillance Parameters");
2029
0
     offset += 4;
2030
2031
     /* DF IP Address for CDC */
2032
0
     proto_tree_add_item(stt, hf_cops_pc_dfcdc_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2033
0
     offset += 4;
2034
2035
     /* DF IP Port for CDC */
2036
0
     proto_tree_add_item(stt, hf_cops_pc_dfcdc_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
2037
0
     offset += 2;
2038
2039
     /* Flags */
2040
0
     proto_tree_add_item(stt, hf_cops_pc_gate_spec_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
2041
0
     offset += 2;
2042
2043
     /* DF IP Address for CCC */
2044
0
     proto_tree_add_item(stt, hf_cops_pc_dfccc_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2045
0
     offset += 4;
2046
2047
     /* DF IP Port for CCC */
2048
0
     proto_tree_add_item(stt, hf_cops_pc_dfccc_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
2049
0
     offset += 2;
2050
2051
     /* Reserved */
2052
0
     proto_tree_add_item(stt, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2053
0
     offset += 2;
2054
2055
     /* CCCID */
2056
0
     proto_tree_add_item(stt, hf_cops_pc_dfccc_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2057
0
     offset += 4;
2058
2059
     /* BCID Timestamp */
2060
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_ts, tvb, offset, 4, ENC_BIG_ENDIAN);
2061
0
     offset += 4;
2062
2063
     /* BCID Element ID */
2064
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_id, tvb, offset, 8, ENC_ASCII);
2065
0
     offset += 8;
2066
2067
     /* BCID Time Zone */
2068
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_tz, tvb, offset, 8, ENC_ASCII);
2069
0
     offset += 8;
2070
2071
     /* BCID Event Counter */
2072
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_ev, tvb, offset, 4, ENC_BIG_ENDIAN);
2073
0
}
2074
2075
/* Cops - Section : Event Gereration-Info */
2076
static void
2077
0
cops_event_generation_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
2078
2079
0
     proto_tree *stt;
2080
2081
     /* Create a subtree */
2082
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Event Generation Info");
2083
0
     offset += 4;
2084
2085
     /* Primary Record Keeping Server IP Address */
2086
0
     proto_tree_add_item(stt, hf_cops_pc_prks_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2087
0
     offset += 4;
2088
2089
     /* Primary Record Keeping Server IP Port */
2090
0
     proto_tree_add_item(stt, hf_cops_pc_prks_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
2091
0
     offset += 2;
2092
2093
     /* Flags */
2094
0
     proto_tree_add_item(stt, hf_cops_pc_gate_spec_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
2095
0
     offset += 1;
2096
2097
     /* Reserved */
2098
0
     proto_tree_add_item(stt, hf_cops_pc_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2099
0
     offset += 1;
2100
2101
     /* Secondary Record Keeping Server IP Address */
2102
0
     proto_tree_add_item(stt, hf_cops_pc_srks_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2103
0
     offset += 4;
2104
2105
     /* Secondary Record Keeping Server IP Port */
2106
0
     proto_tree_add_item(stt, hf_cops_pc_srks_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
2107
0
     offset += 2;
2108
2109
     /* Flags */
2110
0
     proto_tree_add_item(stt, hf_cops_pc_gate_spec_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
2111
0
     offset += 1;
2112
2113
     /* Reserved */
2114
0
     proto_tree_add_item(stt, hf_cops_pc_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2115
0
     offset += 1;
2116
2117
     /* BCID Timestamp */
2118
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_ts, tvb, offset, 4, ENC_BIG_ENDIAN);
2119
0
     offset += 4;
2120
2121
     /* BCID Element ID */
2122
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_id, tvb, offset, 8, ENC_ASCII);
2123
0
     offset += 8;
2124
2125
     /* BCID Time Zone */
2126
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_tz, tvb, offset, 8, ENC_ASCII);
2127
0
     offset += 8;
2128
2129
     /* BCID Event Counter */
2130
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_ev, tvb, offset, 4, ENC_BIG_ENDIAN);
2131
0
}
2132
2133
/* Cops - Section : Remote Gate */
2134
static void
2135
0
cops_remote_gate_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
2136
2137
0
     proto_tree *stt;
2138
2139
     /* Create a subtree */
2140
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Remote Gate Info");
2141
0
     offset += 4;
2142
2143
     /* CMTS IP Address */
2144
0
     proto_tree_add_item(stt, hf_cops_pc_cmts_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2145
0
     offset += 4;
2146
2147
     /* CMTS IP Port */
2148
0
     proto_tree_add_item(stt, hf_cops_pc_cmts_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
2149
0
     offset += 2;
2150
2151
     /* Flags */
2152
0
     proto_tree_add_item(stt, hf_cops_pc_remote_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
2153
0
     offset += 2;
2154
2155
     /* Remote Gate ID */
2156
0
     proto_tree_add_item(stt, hf_cops_pc_remote_gate_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2157
0
     offset += 4;
2158
2159
     /* Algorithm */
2160
0
     proto_tree_add_item(stt, hf_cops_pc_algorithm, tvb, offset, 2, ENC_BIG_ENDIAN);
2161
0
     offset += 2;
2162
2163
     /* Reserved */
2164
0
     proto_tree_add_item(stt, hf_cops_pc_reserved, tvb, offset, 4, ENC_BIG_ENDIAN);
2165
0
     offset += 4;
2166
2167
     /* Security Key */
2168
0
     proto_tree_add_item(stt, hf_cops_pc_key, tvb, offset, 16, ENC_NA);
2169
0
}
2170
2171
/* Cops - Section : PacketCable reason */
2172
static void
2173
0
cops_packetcable_reason(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
2174
2175
0
     proto_tree *stt;
2176
0
     uint32_t code16;
2177
2178
     /* Create a subtree */
2179
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Reason");
2180
0
     offset += 4;
2181
2182
     /* Reason Code */
2183
0
     proto_tree_add_item_ret_uint(stt, hf_cops_pc_reason_code,tvb, offset, 2, ENC_BIG_ENDIAN, &code16);
2184
0
     offset += 2;
2185
2186
0
     if ( code16 == 0 ) {
2187
        /* Reason Sub Code with Delete */
2188
0
         proto_tree_add_item(stt, hf_cops_pc_delete_subcode, tvb, offset, 2, ENC_BIG_ENDIAN);
2189
0
     } else {
2190
        /* Reason Sub Code with Close */
2191
0
         proto_tree_add_item(stt, hf_cops_pc_close_subcode, tvb, offset, 2, ENC_BIG_ENDIAN);
2192
0
     }
2193
0
}
2194
2195
/* Cops - Section : PacketCable error */
2196
static void
2197
0
cops_packetcable_error(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
2198
2199
0
     proto_tree *stt;
2200
2201
     /* Create a subtree */
2202
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Error");
2203
0
     offset += 4;
2204
2205
     /* Error Code */
2206
0
     proto_tree_add_item(stt, hf_cops_pc_packetcable_err_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2207
0
     offset += 2;
2208
2209
     /* Error Sub Code */
2210
0
     proto_tree_add_item(stt, hf_cops_pc_packetcable_sub_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2211
0
}
2212
2213
/* Cops - Section : Multimedia Transaction ID */
2214
static void
2215
0
cops_mm_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, uint8_t op_code, unsigned n, uint32_t offset) {
2216
2217
0
     proto_tree *stt;
2218
0
     uint32_t code;
2219
0
     proto_item* ti;
2220
2221
     /* Create a subtree */
2222
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"MM Transaction ID");
2223
0
     offset += 4;
2224
2225
     /* Transaction Identifier */
2226
0
     proto_tree_add_item(stt, hf_cops_pc_mm_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2227
     // Keep for backwards compatibility
2228
0
     ti = proto_tree_add_item(stt, hf_cops_pc_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2229
0
     PROTO_ITEM_SET_HIDDEN(ti);
2230
0
     offset +=2;
2231
2232
     /* Gate Command Type */
2233
0
     proto_tree_add_item_ret_uint(stt, hf_cops_pc_mm_gate_command_type, tvb, offset, 2, ENC_BIG_ENDIAN, &code);
2234
     // Keep for backwards compatibility
2235
0
     ti = proto_tree_add_item(stt, hf_cops_pc_gate_command_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2236
0
     PROTO_ITEM_SET_HIDDEN(ti);
2237
2238
     /* Write the right data into the 'info field' on the Gui */
2239
0
     col_add_str(pinfo->cinfo, COL_INFO, wmem_strdup_printf(pinfo->pool, "COPS %-20s - %s",
2240
0
         val_to_str_const(op_code, cops_op_code_vals, "Unknown"), val_to_str_const(code, table_cops_mm_transaction_id, "Unknown")));
2241
0
}
2242
2243
/* Cops - Section : AMID */
2244
static void
2245
0
cops_amid(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
2246
2247
0
     proto_tree *stt;
2248
2249
     /* Create a subtree */
2250
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"AMID");
2251
0
     offset += 4;
2252
2253
     /* Application Type */
2254
0
     proto_tree_add_item(stt, hf_cops_pcmm_amid_app_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2255
0
     offset += 2;
2256
2257
     /* Application Manager Tag */
2258
0
     proto_tree_add_item(stt, hf_cops_pcmm_amid_am_tag, tvb, offset, 2, ENC_BIG_ENDIAN);
2259
0
}
2260
2261
2262
/* Cops - Section : Multimedia Gate Specifications */
2263
static int
2264
0
cops_mm_gate_spec(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
2265
0
     proto_tree *stt;
2266
2267
0
     static int* const class_ids[] = {
2268
0
       &hf_cops_pcmm_gate_spec_session_class_id_priority,
2269
0
       &hf_cops_pcmm_gate_spec_session_class_id_preemption,
2270
0
       &hf_cops_pcmm_gate_spec_session_class_id_configurable,
2271
0
       NULL
2272
0
     };
2273
0
     static int* const flags[] = {
2274
0
       &hf_cops_pcmm_gate_spec_flags_gate,
2275
0
       & hf_cops_pcmm_gate_spec_flags_dscp_overwrite,
2276
0
       NULL
2277
0
     };
2278
2279
     /* Create a subtree */
2280
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Spec");
2281
0
     offset += 4;
2282
2283
     /* Flags */
2284
0
     proto_tree_add_bitmask(stt, tvb, offset, hf_cops_pcmm_gate_spec_flags, ett_cops_pcmm_gate_spec_flags, flags, ENC_BIG_ENDIAN);
2285
0
     offset += 1;
2286
2287
     /* DiffServ Code Point */
2288
0
     proto_tree_add_item(stt, hf_cops_pcmm_gate_spec_dscp_tos_field, tvb, offset, 1, ENC_BIG_ENDIAN);
2289
0
     offset += 1;
2290
2291
     /* DiffServ Code Point Mask */
2292
0
     proto_tree_add_item(stt, hf_cops_pcmm_gate_spec_dscp_tos_mask, tvb, offset, 1, ENC_BIG_ENDIAN);
2293
0
     offset += 1;
2294
2295
     /* Session Class */
2296
0
     proto_tree_add_bitmask(stt, tvb, offset, hf_cops_pcmm_gate_spec_session_class_id, ett_cops_pcmm_gate_spec_session_class_id, class_ids, ENC_BIG_ENDIAN);
2297
0
     offset += 1;
2298
2299
     /* Timer T1 Value */
2300
0
     proto_tree_add_item(stt, hf_cops_pcmm_gate_spec_timer_t1, tvb, offset, 2, ENC_BIG_ENDIAN);
2301
0
     offset += 2;
2302
2303
     /* Timer T2 Value */
2304
0
     proto_tree_add_item(stt, hf_cops_pcmm_gate_spec_timer_t2, tvb, offset, 2, ENC_BIG_ENDIAN);
2305
0
     offset += 2;
2306
2307
     /* Timer T3 Value */
2308
0
     proto_tree_add_item(stt, hf_cops_pcmm_gate_spec_timer_t3, tvb, offset, 2, ENC_BIG_ENDIAN);
2309
0
     offset += 2;
2310
2311
     /* Timer T4 Value */
2312
0
     proto_tree_add_item(stt, hf_cops_pcmm_gate_spec_timer_t4, tvb, offset, 2, ENC_BIG_ENDIAN);
2313
0
     offset += 2;
2314
2315
0
     return offset;
2316
0
}
2317
2318
/* Cops - Section : Classifier */
2319
static int
2320
0
cops_classifier(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool extended) {
2321
2322
0
    proto_tree *stt;
2323
2324
    /* Create a subtree */
2325
0
    stt = info_to_cops_subtree(tvb,st,n,offset, extended ? "Extended Classifier" : "Classifier");
2326
0
    offset += 4;
2327
2328
    /* Protocol ID */
2329
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_protocol_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2330
0
    offset += 2;
2331
2332
    /* DiffServ Code Point */
2333
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_dscp_tos_field, tvb, offset, 1, ENC_BIG_ENDIAN);
2334
0
    offset += 1;
2335
2336
    /* DiffServ Code Point Mask */
2337
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_dscp_tos_mask, tvb, offset, 1, ENC_BIG_ENDIAN);
2338
0
    offset += 1;
2339
2340
    /* Source IP Address */
2341
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_src_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
2342
0
    offset += 4;
2343
2344
0
    if (extended) {
2345
        /* Source Mask */
2346
0
        proto_tree_add_item(stt, hf_cops_pcmm_classifier_src_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2347
0
        offset += 4;
2348
0
    }
2349
2350
    /* Destination IP Address */
2351
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_dst_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
2352
0
    offset += 4;
2353
2354
0
    if (extended) {
2355
        /* Destination Mask */
2356
0
        proto_tree_add_item(stt, hf_cops_pcmm_classifier_dst_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2357
0
        offset += 4;
2358
0
    }
2359
2360
    /* Source IP Port */
2361
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
2362
0
    offset += 2;
2363
2364
0
    if (extended) {
2365
        /* Source Port End */
2366
0
        proto_tree_add_item(stt, hf_cops_pcmm_classifier_src_port_end, tvb, offset, 2, ENC_BIG_ENDIAN);
2367
0
        offset += 2;
2368
0
    }
2369
2370
    /* Destination IP Port */
2371
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
2372
0
    offset += 2;
2373
2374
0
    if (extended) {
2375
        /* Destination Port End */
2376
0
        proto_tree_add_item(stt, hf_cops_pcmm_classifier_dst_port_end, tvb, offset, 2, ENC_BIG_ENDIAN);
2377
0
        offset += 2;
2378
2379
        /* ClassifierID */
2380
0
        proto_tree_add_item(stt, hf_cops_pcmm_classifier_classifier_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2381
0
        offset += 2;
2382
0
    }
2383
2384
    /* Priority */
2385
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
2386
0
    offset += 1;
2387
2388
0
    if (extended) {
2389
        /* Activation State */
2390
0
        proto_tree_add_item(stt, hf_cops_pcmm_classifier_activation_state, tvb, offset, 1, ENC_BIG_ENDIAN);
2391
0
        offset += 1;
2392
2393
        /* Action */
2394
0
        proto_tree_add_item(stt, hf_cops_pcmm_classifier_action, tvb, offset, 1, ENC_BIG_ENDIAN);
2395
0
        offset += 1;
2396
0
    }
2397
2398
    /* 3 octets Not specified */
2399
0
    offset += 3;
2400
2401
0
    return offset;
2402
0
}
2403
2404
/* Cops - Section : IPv6 Classifier */
2405
static int
2406
0
cops_ipv6_classifier(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
2407
2408
0
    proto_tree *stt;
2409
2410
    /* Create a subtree */
2411
0
    stt = info_to_cops_subtree(tvb,st,n,offset, "IPv6 Classifier");
2412
0
    offset += 4;
2413
2414
    /* Reserved/Flags */
2415
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
2416
0
    offset += 1;
2417
2418
    /* tc-low */
2419
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_tc_low, tvb, offset, 1, ENC_BIG_ENDIAN);
2420
0
    offset += 1;
2421
2422
    /* tc-high */
2423
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_tc_high, tvb, offset, 1, ENC_BIG_ENDIAN);
2424
0
    offset += 1;
2425
2426
    /* tc-mask */
2427
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_tc_mask, tvb, offset, 1, ENC_BIG_ENDIAN);
2428
0
    offset += 1;
2429
2430
    /* Flow Label */
2431
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_flow_label, tvb, offset, 4, ENC_BIG_ENDIAN);
2432
0
    offset += 4;
2433
2434
    /* Next Header Type */
2435
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_flow_label, tvb, offset, 2, ENC_BIG_ENDIAN);
2436
0
    offset += 2;
2437
2438
    /* Source Prefix Length */
2439
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_source_prefix_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2440
0
    offset += 1;
2441
2442
    /* Destination Prefix Length */
2443
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_destination_prefix_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2444
0
    offset += 1;
2445
2446
    /* Source IP Address */
2447
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_src_addr_v6, tvb, offset, 16, ENC_NA);
2448
0
    offset += 16;
2449
2450
    /* Destination IP Address */
2451
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_dst_addr_v6, tvb, offset, 16, ENC_NA);
2452
0
    offset += 16;
2453
2454
    /* Source IP Port */
2455
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
2456
0
    offset += 2;
2457
2458
    /* Source Port End */
2459
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_src_port_end, tvb, offset, 2, ENC_BIG_ENDIAN);
2460
0
    offset += 2;
2461
2462
    /* Destination IP Port */
2463
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
2464
0
    offset += 2;
2465
2466
    /* Destination Port End */
2467
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_dst_port_end, tvb, offset, 2, ENC_BIG_ENDIAN);
2468
0
    offset += 2;
2469
2470
    /* ClassifierID */
2471
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_classifier_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2472
0
    offset += 2;
2473
2474
    /* Priority */
2475
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
2476
0
    offset += 1;
2477
2478
    /* Activation State */
2479
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_activation_state, tvb, offset, 1, ENC_BIG_ENDIAN);
2480
0
    offset += 1;
2481
2482
    /* Action */
2483
0
    proto_tree_add_item(stt, hf_cops_pcmm_classifier_action, tvb, offset, 1, ENC_BIG_ENDIAN);
2484
0
    offset += 1;
2485
2486
    /* 3 octets Not specified */
2487
0
    offset += 3;
2488
2489
0
    return offset;
2490
0
}
2491
2492
/* Cops - Section : Gate Specifications */
2493
static int
2494
0
cops_flow_spec(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
2495
0
     proto_tree *stt;
2496
2497
     /* Create a subtree */
2498
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Flow Spec");
2499
0
     offset += 4;
2500
2501
     /* Envelope */
2502
0
     proto_tree_add_item(stt, hf_cops_pcmm_flow_spec_envelope, tvb, offset, 1, ENC_NA);
2503
0
     offset += 1;
2504
2505
     /* Service Number */
2506
0
     proto_tree_add_item(stt, hf_cops_pcmm_flow_spec_service_number, tvb, offset, 1, ENC_NA);
2507
0
     offset += 1;
2508
2509
     /* Reserved */
2510
0
     proto_tree_add_item(stt, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2511
0
     offset += 2;
2512
2513
     /* Authorized Envelope */
2514
0
     offset = cops_envelope(tvb, stt, offset, "Authorized Envelope");
2515
2516
0
     if (n < 64) return offset;
2517
2518
     /* Reserved Envelope */
2519
0
     offset = cops_envelope(tvb, stt, offset, "Reserved Envelope");
2520
2521
0
     if (n < 92) return offset;
2522
2523
     /* Committed Envelope */
2524
0
     offset = cops_envelope(tvb, stt, offset, "Committed Envelope");
2525
2526
0
     return offset;
2527
0
}
2528
2529
/* Cops - Section : DOCSIS Service Class Name */
2530
static int
2531
0
cops_docsis_service_class_name(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, unsigned object_len, uint32_t offset) {
2532
2533
0
    proto_tree *stt;
2534
2535
    /* Create a subtree */
2536
0
    stt = info_to_cops_subtree(tvb,st,object_len,offset,"DOCSIS Service Class Name");
2537
0
    offset += 4;
2538
2539
    /* Envelope */
2540
0
    proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
2541
0
    offset += 1;
2542
2543
0
    proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
2544
0
    offset += 3;
2545
2546
0
    if (object_len >= 12) {
2547
0
        proto_tree_add_item(stt, hf_cops_pcmm_docsis_scn, tvb, offset, object_len - 8, ENC_ASCII);
2548
0
        offset += object_len - 8;
2549
0
    } else {
2550
0
        proto_tree_add_expert_format(stt, pinfo, &ei_cops_bad_cops_object_length,
2551
0
                                    tvb, offset - 8, 2, "Invalid object length: %u", object_len);
2552
0
    }
2553
2554
0
    return offset;
2555
0
}
2556
2557
/* New functions were made with the i04 suffix to maintain backward compatibility with I03
2558
*
2559
*  BEGIN PCMM I04
2560
*
2561
*/
2562
static int
2563
cops_best_effort_service_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name, bool i05)
2564
0
{
2565
0
    proto_tree* object_tree;
2566
2567
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, i05 ? 36 : 32, ett_cops_subtree, NULL, name);
2568
2569
    /* Traffic Priority */
2570
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_traffic_priority, tvb, offset, 1, ENC_NA);
2571
0
    offset += 1;
2572
2573
0
    proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
2574
0
    offset += 3;
2575
2576
    /* Request Transmission Policy */
2577
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
2578
0
        ett_docsis_request_transmission_policy,
2579
0
        docsis_request_transmission_policies,
2580
0
        ENC_BIG_ENDIAN);
2581
0
    offset += 4;
2582
2583
    /* Maximum Sustained Traffic Rate */
2584
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_sustained_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
2585
0
    offset += 4;
2586
2587
    /* Maximum Traffic Burst */
2588
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_traffic_burst, tvb, offset, 4, ENC_BIG_ENDIAN);
2589
0
    offset += 4;
2590
2591
    /* Minimum Reserved Traffic Rate */
2592
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_min_reserved_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
2593
0
    offset += 4;
2594
2595
    /* Assumed Minimum Reserved Traffic Rate Packet Size */
2596
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_ass_min_rtr_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN);
2597
0
    offset += 2;
2598
2599
    /* Maximum Concatenated Burst */
2600
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_concat_burst, tvb, offset, 2, ENC_BIG_ENDIAN);
2601
0
    offset += 2;
2602
2603
    /* Required Attribute Mask */
2604
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_req_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2605
0
    offset += 4;
2606
2607
    /* Forbidden Attribute Mask */
2608
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_forbid_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2609
0
    offset += 4;
2610
2611
0
    if (i05) {
2612
        /* Attribute Aggregation Rule Mask */
2613
0
        proto_tree_add_item(object_tree, hf_cops_pcmm_att_aggr_rule_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2614
0
        offset += 4;
2615
0
    }
2616
2617
0
    return offset;
2618
0
}
2619
2620
/* Cops - Section : Best Effort Service */
2621
static int
2622
0
cops_best_effort_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
2623
0
     proto_tree *stt;
2624
2625
     /* Create a subtree */
2626
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Best Effort Service");
2627
0
     offset += 4;
2628
2629
     /* Envelope */
2630
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
2631
0
     offset += 1;
2632
2633
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
2634
0
     offset += 3;
2635
2636
     /* Authorized Envelope */
2637
0
     offset = cops_best_effort_service_envelope(tvb, stt, offset, "Authorized Envelope", i05);
2638
2639
0
     if (n < 56) return offset;
2640
2641
     /* Reserved Envelope */
2642
0
     offset = cops_best_effort_service_envelope(tvb, stt, offset, "Reserved Envelope", i05);
2643
2644
0
     if (n < 80) return offset;
2645
2646
     /* Committed Envelope */
2647
0
     offset = cops_best_effort_service_envelope(tvb, stt, offset, "Committed Envelope", i05);
2648
2649
0
     return offset;
2650
0
}
2651
2652
static int
2653
cops_non_real_time_polling_service_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name, bool i05)
2654
0
{
2655
0
    proto_tree* object_tree;
2656
2657
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, name);
2658
2659
    /* Traffic Priority */
2660
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_traffic_priority, tvb, offset, 1, ENC_NA);
2661
0
    offset += 1;
2662
2663
0
    proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
2664
0
    offset += 3;
2665
2666
    /* Request Transmission Policy */
2667
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
2668
0
        ett_docsis_request_transmission_policy,
2669
0
        docsis_request_transmission_policies,
2670
0
        ENC_BIG_ENDIAN);
2671
0
    offset += 4;
2672
2673
    /* Maximum Sustained Traffic Rate */
2674
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_sustained_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
2675
0
    offset += 4;
2676
2677
    /* Maximum Traffic Burst */
2678
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_traffic_burst, tvb, offset, 4, ENC_BIG_ENDIAN);
2679
0
    offset += 4;
2680
2681
    /* Minimum Reserved Traffic Rate */
2682
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_min_reserved_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
2683
0
    offset += 4;
2684
2685
    /* Assumed Minimum Reserved Traffic Rate Packet Size */
2686
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_ass_min_rtr_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN);
2687
0
    offset += 2;
2688
2689
    /* Maximum Concatenated Burst */
2690
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_concat_burst, tvb, offset, 2, ENC_BIG_ENDIAN);
2691
0
    offset += 2;
2692
2693
    /* Nominal Polling Interval */
2694
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_nominal_polling_interval, tvb, offset, 4, ENC_BIG_ENDIAN);
2695
0
    offset += 4;
2696
2697
    /* Required Attribute Mask */
2698
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_req_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2699
0
    offset += 4;
2700
2701
    /* Forbidden Attribute Mask */
2702
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_forbid_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2703
0
    offset += 4;
2704
2705
0
    if (i05) {
2706
        /* Attribute Aggregation Rule Mask */
2707
0
        proto_tree_add_item(object_tree, hf_cops_pcmm_att_aggr_rule_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2708
0
        offset += 4;
2709
0
    }
2710
2711
0
    return offset;
2712
0
}
2713
2714
/* Cops - Section : Non-Real-Time Polling Service */
2715
static int
2716
0
cops_non_real_time_polling_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
2717
0
     proto_tree *stt;
2718
2719
     /* Create a subtree */
2720
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Non-Real-Time Polling Service");
2721
0
     offset += 4;
2722
2723
     /* Envelope */
2724
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
2725
0
     offset += 1;
2726
2727
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
2728
0
     offset += 3;
2729
2730
     /* Authorized Envelope */
2731
0
     offset = cops_non_real_time_polling_service_envelope(tvb, stt, offset, "Authorized Envelope", i05);
2732
2733
0
     if (n < 64) return offset;
2734
2735
     /* Reserved Envelope */
2736
0
     offset = cops_non_real_time_polling_service_envelope(tvb, stt, offset, "Reserved Envelope", i05);
2737
2738
0
     if (n < 92) return offset;
2739
2740
     /* Committed Envelope */
2741
0
     offset = cops_non_real_time_polling_service_envelope(tvb, stt, offset, "Committed Envelope", i05);
2742
2743
0
     return offset;
2744
0
}
2745
2746
static int
2747
cops_real_time_polling_service_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name, bool i05)
2748
0
{
2749
0
    proto_tree* object_tree;
2750
2751
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, name);
2752
2753
    /* Request Transmission Policy */
2754
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
2755
0
        ett_docsis_request_transmission_policy,
2756
0
        docsis_request_transmission_policies,
2757
0
        ENC_BIG_ENDIAN);
2758
0
    offset += 4;
2759
2760
    /* Maximum Sustained Traffic Rate */
2761
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_sustained_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
2762
0
    offset += 4;
2763
2764
    /* Maximum Traffic Burst */
2765
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_traffic_burst, tvb, offset, 4, ENC_BIG_ENDIAN);
2766
0
    offset += 4;
2767
2768
    /* Minimum Reserved Traffic Rate */
2769
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_min_reserved_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
2770
0
    offset += 4;
2771
2772
    /* Assumed Minimum Reserved Traffic Rate Packet Size */
2773
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_ass_min_rtr_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN);
2774
0
    offset += 2;
2775
2776
    /* Maximum Concatenated Burst */
2777
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_concat_burst, tvb, offset, 2, ENC_BIG_ENDIAN);
2778
0
    offset += 2;
2779
2780
    /* Nominal Polling Interval */
2781
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_nominal_polling_interval, tvb, offset, 4, ENC_BIG_ENDIAN);
2782
0
    offset += 4;
2783
2784
    /* Tolerated Poll Jitter */
2785
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_tolerated_poll_jitter, tvb, offset, 4, ENC_BIG_ENDIAN);
2786
0
    offset += 4;
2787
2788
    /* Required Attribute Mask */
2789
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_req_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2790
0
    offset += 4;
2791
2792
    /* Forbidden Attribute Mask */
2793
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_forbid_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2794
0
    offset += 4;
2795
2796
0
    if (i05) {
2797
        /* Attribute Aggregation Rule Mask */
2798
0
        proto_tree_add_item(object_tree, hf_cops_pcmm_att_aggr_rule_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2799
0
        offset += 4;
2800
0
    }
2801
2802
0
    return offset;
2803
0
}
2804
2805
/* Cops - Section : Real-Time Polling Service */
2806
static int
2807
0
cops_real_time_polling_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
2808
0
     proto_tree *stt;
2809
2810
     /* Create a subtree */
2811
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Real-Time Polling Service");
2812
0
     offset += 4;
2813
2814
     /* Envelope */
2815
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
2816
0
     offset += 1;
2817
2818
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
2819
0
     offset += 3;
2820
2821
     /* Authorized Envelope */
2822
0
     offset = cops_real_time_polling_service_envelope(tvb, stt, offset, "Authorized Envelope", i05);
2823
2824
0
     if (n < 64) return offset;
2825
2826
     /* Reserved Envelope */
2827
0
     offset = cops_real_time_polling_service_envelope(tvb, stt, offset, "Reserved Envelope", i05);
2828
2829
0
     if (n < 92) return offset;
2830
2831
     /* Committed Envelope */
2832
0
     offset = cops_real_time_polling_service_envelope(tvb, stt, offset, "Committed Envelope", i05);
2833
2834
0
     return offset;
2835
0
}
2836
2837
static int
2838
cops_grant_data(tvbuff_t* tvb, proto_tree* tree, uint32_t offset)
2839
0
{
2840
    /* Unsolicited Grant Size */
2841
0
    proto_tree_add_item(tree, hf_cops_pcmm_unsolicited_grant_size, tvb, offset, 2, ENC_BIG_ENDIAN);
2842
0
    offset += 2;
2843
2844
    /* Grants Per Interval */
2845
0
    proto_tree_add_item(tree, hf_cops_pcmm_grants_per_interval, tvb, offset, 1, ENC_BIG_ENDIAN);
2846
0
    offset += 1;
2847
2848
0
    proto_tree_add_item(tree, hf_cops_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
2849
0
    offset += 1;
2850
2851
    /* Nominal Grant Interval */
2852
0
    proto_tree_add_item(tree, hf_cops_pcmm_nominal_grant_interval, tvb, offset, 4, ENC_BIG_ENDIAN);
2853
0
    offset += 4;
2854
2855
    /* Tolerated Grant Jitter */
2856
0
    proto_tree_add_item(tree, hf_cops_pcmm_tolerated_grant_jitter, tvb, offset, 4, ENC_BIG_ENDIAN);
2857
0
    offset += 4;
2858
2859
0
    return offset;
2860
0
}
2861
2862
static int
2863
cops_grant_service_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name, bool i05)
2864
0
{
2865
0
    proto_tree* object_tree;
2866
2867
    /* Authorized Envelope */
2868
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, i05 ? 28 : 24, ett_cops_subtree, NULL, name);
2869
2870
    /* Request Transmission Policy */
2871
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
2872
0
        ett_docsis_request_transmission_policy,
2873
0
        docsis_request_transmission_policies,
2874
0
        ENC_BIG_ENDIAN);
2875
0
    offset += 4;
2876
2877
0
    offset = cops_grant_data(tvb, object_tree, offset);
2878
2879
    /* Required Attribute Mask */
2880
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_req_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2881
0
    offset += 4;
2882
2883
    /* Forbidden Attribute Mask */
2884
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_forbid_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2885
0
    offset += 4;
2886
2887
0
    if (i05) {
2888
        /* Attribute Aggregation Rule Mask */
2889
0
        proto_tree_add_item(object_tree, hf_cops_pcmm_att_aggr_rule_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2890
0
        offset += 4;
2891
0
    }
2892
2893
0
    return offset;
2894
0
}
2895
2896
/* Cops - Section : Unsolicited Grant Service */
2897
static int
2898
cops_unsolicited_grant_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05)
2899
0
{
2900
0
     proto_tree *stt;
2901
2902
     /* Create a subtree */
2903
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service");
2904
0
     offset += 4;
2905
2906
     /* Envelope */
2907
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
2908
0
     offset += 1;
2909
2910
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
2911
0
     offset += 3;
2912
2913
     /* Authorized Envelope */
2914
0
     offset = cops_grant_service_envelope(tvb, stt, offset, "Authorized Envelope", i05);
2915
2916
0
     if (n < 40) return offset;
2917
2918
     /* Reserved Envelope */
2919
0
     offset = cops_grant_service_envelope(tvb, stt, offset, "Reserved Envelope", i05);
2920
2921
0
     if (n < 56) return offset;
2922
2923
     /* Committed Envelope */
2924
0
     offset = cops_grant_service_envelope(tvb, stt, offset, "Committed Envelope", i05);
2925
2926
0
     return offset;
2927
0
}
2928
2929
static int
2930
cops_grant_service_activity_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name, bool i05)
2931
0
{
2932
0
    proto_tree* object_tree;
2933
2934
    /* Authorized Envelope */
2935
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, i05 ? 36 : 32, ett_cops_subtree, NULL, name);
2936
2937
    /* Request Transmission Policy */
2938
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
2939
0
        ett_docsis_request_transmission_policy,
2940
0
        docsis_request_transmission_policies,
2941
0
        ENC_BIG_ENDIAN);
2942
0
    offset += 4;
2943
2944
0
    offset = cops_grant_data(tvb, object_tree, offset);
2945
2946
    /* Nominal Polling Interval */
2947
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_nominal_polling_interval, tvb, offset, 4, ENC_BIG_ENDIAN);
2948
0
    offset += 4;
2949
2950
    /* Tolerated Poll Jitter */
2951
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_tolerated_poll_jitter, tvb, offset, 4, ENC_BIG_ENDIAN);
2952
0
    offset += 4;
2953
2954
    /* Required Attribute Mask */
2955
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_req_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2956
0
    offset += 4;
2957
2958
    /* Forbidden Attribute Mask */
2959
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_forbid_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2960
0
    offset += 4;
2961
2962
0
    if (i05) {
2963
        /* Attribute Aggregation Rule Mask */
2964
0
        proto_tree_add_item(object_tree, hf_cops_pcmm_att_aggr_rule_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2965
0
        offset += 4;
2966
0
    }
2967
2968
0
    return offset;
2969
0
}
2970
2971
/* Cops - Section : Unsolicited Grant Service with Activity Detection */
2972
static int
2973
0
cops_ugs_with_activity_detection_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
2974
0
     proto_tree *stt;
2975
2976
     /* Create a subtree */
2977
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service with Activity Detection");
2978
0
     offset += 4;
2979
2980
     /* Envelope */
2981
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
2982
0
     offset += 1;
2983
2984
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
2985
0
     offset += 3;
2986
2987
     /* Authorized Envelope */
2988
0
     offset = cops_grant_service_activity_envelope(tvb, st, offset, "Authorized Envelope", i05);
2989
2990
0
     if (n < 56) return offset;
2991
2992
     /* Reserved Envelope */
2993
0
     offset = cops_grant_service_activity_envelope(tvb, st, offset, "Reserved Envelope", i05);
2994
2995
0
     if (n < 80) return offset;
2996
2997
     /* Committed Envelope */
2998
0
     offset = cops_grant_service_activity_envelope(tvb, st, offset, "Committed Envelope", i05);
2999
3000
0
     return offset;
3001
0
}
3002
3003
static int
3004
cops_downstream_service_i04_i05_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name, bool i05)
3005
0
{
3006
0
    proto_tree* object_tree;
3007
3008
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, i05 ? 40 : 36, ett_cops_subtree, NULL, name);
3009
3010
    /* Traffic Priority */
3011
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_traffic_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
3012
0
    offset += 1;
3013
3014
    /* Downstream Resequencing */
3015
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_down_resequencing, tvb, offset, 1, ENC_BIG_ENDIAN);
3016
0
    offset += 1;
3017
3018
0
    proto_tree_add_item(object_tree, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
3019
0
    offset += 2;
3020
3021
    /* Maximum Sustained Traffic Rate */
3022
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_sustained_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3023
0
    offset += 4;
3024
3025
    /* Maximum Traffic Burst */
3026
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_traffic_burst, tvb, offset, 4, ENC_BIG_ENDIAN);
3027
0
    offset += 4;
3028
3029
    /* Minimum Reserved Traffic Rate */
3030
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_min_reserved_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3031
0
    offset += 4;
3032
3033
    /* Assumed Minimum Reserved Traffic Rate Packet Size */
3034
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_ass_min_rtr_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN);
3035
0
    offset += 2;
3036
3037
    /* Reserved */
3038
0
    proto_tree_add_item(object_tree, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
3039
0
    offset += 2;
3040
3041
    /* Maximum Downstream Latency */
3042
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_downstream_latency, tvb, offset, 4, ENC_BIG_ENDIAN);
3043
0
    offset += 4;
3044
3045
    /* Downstream Peak Traffic Rate */
3046
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_down_peak_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3047
0
    offset += 4;
3048
3049
    /* Required Attribute Mask */
3050
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_req_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
3051
0
    offset += 4;
3052
3053
    /* Forbidden Attribute Mask */
3054
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_forbid_att_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
3055
0
    offset += 4;
3056
3057
0
    if (i05) {
3058
        /* Attribute Aggregation Rule Mask */
3059
0
        proto_tree_add_item(object_tree, hf_cops_pcmm_att_aggr_rule_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
3060
0
        offset += 4;
3061
0
    }
3062
3063
0
    return offset;
3064
0
}
3065
3066
/* Cops - Section : Downstream Service */
3067
static int
3068
0
cops_downstream_service_i04_i05(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset, bool i05) {
3069
0
    proto_tree *stt;
3070
3071
    /* Create a subtree */
3072
0
    stt = info_to_cops_subtree(tvb,st,n,offset,"Downstream Service");
3073
0
    offset += 4;
3074
3075
    /* Envelope */
3076
0
    proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
3077
0
    offset += 1;
3078
3079
0
    proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3080
0
    offset += 3;
3081
3082
    /* Authorized Envelope */
3083
0
    offset = cops_downstream_service_i04_i05_envelope(tvb, stt, offset, "Authorized Envelope", i05);
3084
3085
0
    if (n < 56) return offset;
3086
3087
    /* Reserved Envelope */
3088
0
    offset = cops_downstream_service_i04_i05_envelope(tvb, stt, offset, "Reserved Envelope", i05);
3089
3090
0
    if (n < 80) return offset;
3091
3092
    /* Committed Envelope */
3093
0
    offset = cops_downstream_service_i04_i05_envelope(tvb, stt, offset, "Committed Envelope", i05);
3094
3095
0
    return offset;
3096
0
}
3097
3098
/* Cops - Section : Upstream Drop */
3099
static int
3100
0
cops_upstream_drop_i04(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3101
0
     proto_tree *stt;
3102
3103
     /* Create a subtree */
3104
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Upstream Drop");
3105
0
     offset += 4;
3106
3107
     /* Envelope */
3108
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
3109
0
     offset += 1;
3110
3111
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3112
0
     offset += 3;
3113
3114
0
     return offset;
3115
0
}
3116
3117
/* END PCMM I04 */
3118
3119
static int
3120
cops_best_effort_service_envelope_i03(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name)
3121
0
{
3122
0
    proto_tree* object_tree;
3123
3124
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, 24, ett_cops_subtree, NULL, name);
3125
3126
    /* Traffic Priority */
3127
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_traffic_priority, tvb, offset, 1, ENC_NA);
3128
0
    offset += 1;
3129
3130
0
    proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3131
0
    offset += 3;
3132
3133
    /* Request Transmission Policy */
3134
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
3135
0
        ett_docsis_request_transmission_policy,
3136
0
        docsis_request_transmission_policies,
3137
0
        ENC_BIG_ENDIAN);
3138
0
    offset += 4;
3139
3140
    /* Maximum Sustained Traffic Rate */
3141
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_sustained_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3142
0
    offset += 4;
3143
3144
    /* Maximum Traffic Burst */
3145
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_traffic_burst, tvb, offset, 4, ENC_BIG_ENDIAN);
3146
0
    offset += 4;
3147
3148
    /* Minimum Reserved Traffic Rate */
3149
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_min_reserved_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3150
0
    offset += 4;
3151
3152
    /* Assumed Minimum Reserved Traffic Rate Packet Size */
3153
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_ass_min_rtr_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN);
3154
0
    offset += 2;
3155
3156
    /* Reserved */
3157
0
    proto_tree_add_item(object_tree, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
3158
0
    offset += 2;
3159
3160
0
    return offset;
3161
0
}
3162
3163
/* Cops - Section : Best Effort Service */
3164
static int
3165
0
cops_best_effort_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3166
0
     proto_tree *stt;
3167
3168
     /* Create a subtree */
3169
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Best Effort Service");
3170
0
     offset += 4;
3171
3172
     /* Envelope */
3173
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
3174
0
     offset += 1;
3175
3176
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3177
0
     offset += 3;
3178
3179
     /* Authorized Envelope */
3180
0
     offset = cops_best_effort_service_envelope_i03(tvb, stt, offset, "Authorized Envelope");
3181
3182
0
     if (n < 56) return offset;
3183
3184
     /* Reserved Envelope */
3185
0
     offset = cops_best_effort_service_envelope_i03(tvb, stt, offset, "Reserved Envelope");
3186
3187
0
     if (n < 80) return offset;
3188
3189
     /* Committed Envelope */
3190
0
     offset = cops_best_effort_service_envelope_i03(tvb, stt, offset, "Committed Envelope");
3191
3192
0
     return offset;
3193
0
}
3194
3195
static int
3196
cops_non_real_time_polling_service_envelope_i03(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name)
3197
0
{
3198
0
    proto_tree* object_tree;
3199
3200
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, 28, ett_cops_subtree, NULL, name);
3201
3202
    /* Traffic Priority */
3203
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_traffic_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
3204
0
    offset += 1;
3205
3206
0
    proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3207
0
    offset += 3;
3208
3209
    /* Request Transmission Policy */
3210
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
3211
0
        ett_docsis_request_transmission_policy,
3212
0
        docsis_request_transmission_policies,
3213
0
        ENC_BIG_ENDIAN);
3214
0
    offset += 4;
3215
3216
    /* Maximum Sustained Traffic Rate */
3217
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_sustained_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3218
0
    offset += 4;
3219
3220
    /* Maximum Traffic Burst */
3221
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_traffic_burst, tvb, offset, 4, ENC_BIG_ENDIAN);
3222
0
    offset += 4;
3223
3224
    /* Minimum Reserved Traffic Rate */
3225
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_min_reserved_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3226
0
    offset += 4;
3227
3228
    /* Assumed Minimum Reserved Traffic Rate Packet Size */
3229
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_ass_min_rtr_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN);
3230
0
    offset += 2;
3231
3232
    /* Reserved */
3233
0
    proto_tree_add_item(object_tree, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
3234
0
    offset += 2;
3235
3236
    /* Nominal Polling Interval */
3237
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_nominal_polling_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
3238
0
    offset += 4;
3239
3240
0
    return offset;
3241
0
}
3242
3243
/* Cops - Section : Non-Real-Time Polling Service */
3244
static int
3245
0
cops_non_real_time_polling_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3246
0
     proto_tree *stt;
3247
3248
     /* Create a subtree */
3249
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Non-Real-Time Polling Service");
3250
0
     offset += 4;
3251
3252
     /* Envelope */
3253
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
3254
0
     offset += 1;
3255
3256
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3257
0
     offset += 3;
3258
3259
     /* Authorized Envelope */
3260
0
     offset = cops_non_real_time_polling_service_envelope_i03(tvb, stt, offset, "Authorized Envelope");
3261
3262
0
     if (n < 64) return offset;
3263
3264
     /* Reserved Envelope */
3265
0
     offset = cops_non_real_time_polling_service_envelope_i03(tvb, stt, offset, "Reserved Envelope");
3266
3267
0
     if (n < 92) return offset;
3268
3269
     /* Committed Envelope */
3270
0
     offset = cops_non_real_time_polling_service_envelope_i03(tvb, stt, offset, "Committed Envelope");
3271
3272
0
     return offset;
3273
0
}
3274
3275
static int
3276
cops_real_time_polling_service_envelope_i03(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name)
3277
0
{
3278
0
    proto_tree* object_tree;
3279
3280
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, 28, ett_cops_subtree, NULL, name);
3281
3282
    /* Request Transmission Policy */
3283
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
3284
0
        ett_docsis_request_transmission_policy,
3285
0
        docsis_request_transmission_policies,
3286
0
        ENC_BIG_ENDIAN);
3287
0
    offset += 4;
3288
3289
    /* Maximum Sustained Traffic Rate */
3290
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_sustained_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3291
0
    offset += 4;
3292
3293
    /* Maximum Traffic Burst */
3294
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_traffic_burst, tvb, offset, 4, ENC_BIG_ENDIAN);
3295
0
    offset += 4;
3296
3297
    /* Minimum Reserved Traffic Rate */
3298
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_min_reserved_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3299
0
    offset += 4;
3300
3301
    /* Assumed Minimum Reserved Traffic Rate Packet Size */
3302
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_ass_min_rtr_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN);
3303
0
    offset += 2;
3304
3305
    /* Reserved */
3306
0
    proto_tree_add_item(object_tree, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
3307
0
    offset += 2;
3308
3309
    /* Nominal Polling Interval */
3310
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_nominal_polling_interval, tvb, offset, 4, ENC_BIG_ENDIAN);
3311
0
    offset += 4;
3312
3313
    /* Tolerated Poll Jitter */
3314
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_tolerated_poll_jitter, tvb, offset, 4, ENC_BIG_ENDIAN);
3315
0
    offset += 4;
3316
3317
0
    return offset;
3318
0
}
3319
3320
/* Cops - Section : Real-Time Polling Service */
3321
static int
3322
0
cops_real_time_polling_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3323
0
     proto_tree *stt;
3324
3325
     /* Create a subtree */
3326
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Real-Time Polling Service");
3327
0
     offset += 4;
3328
3329
     /* Envelope */
3330
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
3331
0
     offset += 1;
3332
3333
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3334
0
     offset += 3;
3335
3336
     /* Authorized Envelope */
3337
0
     offset = cops_real_time_polling_service_envelope_i03(tvb, stt, offset, "Authorized Envelope");
3338
3339
0
     if (n < 64) return offset;
3340
3341
     /* Reserved Envelope */
3342
0
     offset = cops_real_time_polling_service_envelope_i03(tvb, stt, offset, "Reserved Envelope");
3343
3344
0
     if (n < 92) return offset;
3345
3346
     /* Committed Envelope */
3347
0
     offset = cops_real_time_polling_service_envelope_i03(tvb, stt, offset, "Committed Envelope");
3348
3349
0
     return offset;
3350
0
}
3351
3352
static int
3353
cops_unsolicted_grant_service_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name)
3354
0
{
3355
0
    proto_tree* object_tree;
3356
3357
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, 16, ett_cops_subtree, NULL, name);
3358
3359
    /* Request Transmission Policy */
3360
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
3361
0
        ett_docsis_request_transmission_policy,
3362
0
        docsis_request_transmission_policies,
3363
0
        ENC_BIG_ENDIAN);
3364
0
    offset += 4;
3365
3366
0
    offset = cops_grant_data(tvb, object_tree, offset);
3367
3368
0
    return offset;
3369
0
}
3370
3371
/* Cops - Section : Unsolicited Grant Service */
3372
static int
3373
0
cops_unsolicited_grant_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3374
0
     proto_tree *stt;
3375
3376
     /* Create a subtree */
3377
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service");
3378
0
     offset += 4;
3379
3380
     /* Envelope */
3381
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
3382
0
     offset += 1;
3383
3384
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3385
0
     offset += 3;
3386
3387
     /* Authorized Envelope */
3388
0
     offset = cops_unsolicted_grant_service_envelope(tvb, stt, offset, "Authorized Envelope");
3389
3390
0
     if (n < 40) return offset;
3391
3392
     /* Reserved Envelope */
3393
0
     offset = cops_unsolicted_grant_service_envelope(tvb, stt, offset, "Reserved Envelope");
3394
3395
0
     if (n < 56) return offset;
3396
3397
     /* Committed Envelope */
3398
0
     offset = cops_unsolicted_grant_service_envelope(tvb, stt, offset, "Committed Envelope");
3399
3400
0
     return offset;
3401
0
}
3402
3403
static int
3404
cops_ugs_with_activity_detection_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name)
3405
0
{
3406
0
    proto_tree* object_tree;
3407
3408
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, 24, ett_cops_subtree, NULL, name);
3409
3410
    /* Request Transmission Policy */
3411
0
    proto_tree_add_bitmask(object_tree, tvb, offset, hf_cops_pcmm_request_transmission_policy,
3412
0
        ett_docsis_request_transmission_policy,
3413
0
        docsis_request_transmission_policies,
3414
0
        ENC_BIG_ENDIAN);
3415
0
    offset += 4;
3416
3417
0
    offset = cops_grant_data(tvb, object_tree, offset);
3418
3419
    /* Nominal Polling Interval */
3420
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_nominal_polling_interval, tvb, offset, 4, ENC_BIG_ENDIAN);
3421
0
    offset += 4;
3422
3423
    /* Tolerated Poll Jitter */
3424
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_tolerated_poll_jitter, tvb, offset, 4, ENC_BIG_ENDIAN);
3425
0
    offset += 4;
3426
3427
0
    return offset;
3428
0
}
3429
3430
/* Cops - Section : Unsolicited Grant Service with Activity Detection */
3431
static int
3432
0
cops_ugs_with_activity_detection(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3433
0
     proto_tree *stt;
3434
3435
     /* Create a subtree */
3436
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Unsolicited Grant Service with Activity Detection");
3437
0
     offset += 4;
3438
3439
     /* Envelope */
3440
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
3441
0
     offset += 1;
3442
3443
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3444
0
     offset += 3;
3445
3446
     /* Authorized Envelope */
3447
0
     offset = cops_ugs_with_activity_detection_envelope(tvb, stt, offset, "Authorized Envelope");
3448
3449
0
     if (n < 56) return offset;
3450
3451
     /* Reserved Envelope */
3452
0
     offset = cops_ugs_with_activity_detection_envelope(tvb, stt, offset, "Reserved Envelope");
3453
3454
0
     if (n < 80) return offset;
3455
3456
     /* Committed Envelope */
3457
0
     offset = cops_ugs_with_activity_detection_envelope(tvb, stt, offset, "Committed Envelope");
3458
3459
0
     return offset;
3460
0
}
3461
3462
static int
3463
cops_downstream_service_envelope(tvbuff_t* tvb, proto_tree* st, uint32_t offset, const char* name)
3464
0
{
3465
0
    proto_tree* object_tree;
3466
3467
0
    object_tree = proto_tree_add_subtree(st, tvb, offset, 24, ett_cops_subtree, NULL, name);
3468
3469
    /* Traffic Priority */
3470
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_traffic_priority, tvb, offset, 1, ENC_NA);
3471
0
    offset += 1;
3472
3473
0
    proto_tree_add_item(object_tree, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3474
0
    offset += 3;
3475
3476
    /* Maximum Sustained Traffic Rate */
3477
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_sustained_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3478
0
    offset += 4;
3479
3480
    /* Maximum Traffic Burst */
3481
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_traffic_burst, tvb, offset, 4, ENC_BIG_ENDIAN);
3482
0
    offset += 4;
3483
3484
    /* Minimum Reserved Traffic Rate */
3485
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_min_reserved_traffic_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
3486
0
    offset += 4;
3487
3488
    /* Assumed Minimum Reserved Traffic Rate Packet Size */
3489
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_ass_min_rtr_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN);
3490
0
    offset += 2;
3491
3492
    /* Reserved */
3493
0
    proto_tree_add_item(object_tree, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
3494
0
    offset += 2;
3495
3496
    /* Maximum Downstream Latency */
3497
0
    proto_tree_add_item(object_tree, hf_cops_pcmm_max_downstream_latency, tvb, offset, 4, ENC_BIG_ENDIAN);
3498
0
    offset += 4;
3499
3500
0
    return offset;
3501
0
}
3502
3503
/* Cops - Section : Downstream Service */
3504
static int
3505
0
cops_downstream_service(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3506
0
     proto_tree *stt;
3507
3508
     /* Create a subtree */
3509
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Downstream Service");
3510
0
     offset += 4;
3511
3512
     /* Envelope */
3513
0
     proto_tree_add_item(stt, hf_cops_pcmm_envelope, tvb, offset, 1, ENC_BIG_ENDIAN);
3514
0
     offset += 1;
3515
3516
0
     proto_tree_add_item(stt, hf_cops_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
3517
0
     offset += 3;
3518
3519
     /* Authorized Envelope */
3520
0
     offset = cops_downstream_service_envelope(tvb, stt, offset, "Authorized Envelope");
3521
3522
0
     if (n < 56) return offset;
3523
3524
     /* Reserved Envelope */
3525
0
     offset = cops_downstream_service_envelope(tvb, stt, offset, "Reserved Envelope");
3526
3527
0
     if (n < 80) return offset;
3528
3529
     /* Committed Envelope */
3530
0
     offset = cops_downstream_service_envelope(tvb, stt, offset, "Committed Envelope");
3531
3532
0
     return offset;
3533
0
}
3534
3535
/* Cops - Section : PacketCable Multimedia Event Gereration-Info */
3536
static void
3537
0
cops_mm_event_generation_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3538
3539
0
     proto_tree *stt;
3540
3541
     /* Create a subtree */
3542
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Event Generation Info");
3543
0
     offset += 4;
3544
3545
     /* Primary Record Keeping Server IP Address */
3546
0
     proto_tree_add_item(stt, hf_cops_pc_prks_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
3547
0
     offset += 4;
3548
3549
     /* Primary Record Keeping Server IP Port */
3550
0
     proto_tree_add_item(stt, hf_cops_pc_prks_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
3551
0
     offset += 2;
3552
3553
     /* Reserved */
3554
0
     proto_tree_add_item(stt, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
3555
0
     offset += 2;
3556
3557
     /* Secondary Record Keeping Server IP Address */
3558
0
     proto_tree_add_item(stt, hf_cops_pc_srks_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
3559
0
     offset += 4;
3560
3561
     /* Secondary Record Keeping Server IP Port */
3562
0
     proto_tree_add_item(stt, hf_cops_pc_srks_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
3563
0
     offset += 2;
3564
3565
     /* Reserved */
3566
0
     proto_tree_add_item(stt, hf_cops_pc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
3567
0
     offset += 2;
3568
3569
     /* BCID Timestamp */
3570
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_ts, tvb, offset, 4, ENC_BIG_ENDIAN);
3571
0
     offset += 4;
3572
3573
     /* BCID Element ID */
3574
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_id, tvb, offset, 8, ENC_ASCII);
3575
0
     offset += 8;
3576
3577
     /* BCID Time Zone */
3578
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_tz, tvb, offset, 8, ENC_ASCII);
3579
0
     offset += 8;
3580
3581
     /* BCID Event Counter */
3582
0
     proto_tree_add_item(stt, hf_cops_pc_bcid_ev, tvb, offset, 4, ENC_BIG_ENDIAN);
3583
0
}
3584
3585
/* Cops - Section : Volume-Based Usage Limit */
3586
static int
3587
0
cops_volume_based_usage_limit(tvbuff_t *tvb, proto_tree *st, unsigned object_len, uint32_t offset) {
3588
3589
0
    proto_tree *stt;
3590
3591
    /* Create a subtree */
3592
0
    stt = info_to_cops_subtree(tvb,st,object_len,offset,"Volume-Based Usage Limit");
3593
0
    offset += 4;
3594
3595
    /* Usage Limit */
3596
0
    proto_tree_add_item(stt, hf_cops_pcmm_volume_based_usage_limit, tvb, offset, 8, ENC_BIG_ENDIAN);
3597
0
    offset += 8;
3598
3599
0
    return offset;
3600
0
}
3601
3602
/* Cops - Section : Time-Based Usage Limit */
3603
static int
3604
0
cops_time_based_usage_limit(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3605
3606
0
     proto_tree *stt;
3607
3608
     /* Create a subtree */
3609
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Time-Based Usage Limit");
3610
0
     offset += 4;
3611
3612
     /* Time Limit */
3613
0
     proto_tree_add_item(stt, hf_cops_pcmm_time_based_usage_limit, tvb, offset, 4, ENC_BIG_ENDIAN);
3614
0
     offset += 4;
3615
3616
0
     return offset;
3617
0
}
3618
3619
/* Cops - Section : Opaque Data */
3620
static void
3621
0
cops_opaque_data(tvbuff_t *tvb, proto_tree *st, unsigned object_len, uint32_t offset) {
3622
3623
0
     proto_tree *stt;
3624
3625
     /* Create a subtree */
3626
0
     stt = info_to_cops_subtree(tvb,st,object_len,offset,"Opaque Data");
3627
0
     offset += 4;
3628
3629
     /* Opaque Data */
3630
0
     proto_tree_add_item(stt, hf_cops_opaque_data, tvb, offset, 8, ENC_NA);
3631
0
}
3632
3633
/* Cops - Section : Gate Time Info */
3634
static int
3635
0
cops_gate_time_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3636
3637
0
     proto_tree *stt;
3638
3639
     /* Create a subtree */
3640
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Time Info");
3641
0
     offset += 4;
3642
3643
     /* Gate Time Info */
3644
0
     proto_tree_add_item(stt, hf_cops_pcmm_gate_time_info, tvb, offset, 4, ENC_BIG_ENDIAN);
3645
0
     offset += 4;
3646
3647
0
     return offset;
3648
0
}
3649
3650
/* Cops - Section : Gate Usage Info */
3651
static void
3652
0
cops_gate_usage_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3653
3654
0
     proto_tree *stt;
3655
3656
     /* Create a subtree */
3657
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Gate Usage Info");
3658
0
     offset += 4;
3659
3660
     /* Gate Usage Info */
3661
0
     proto_tree_add_item(stt, hf_cops_pcmm_gate_usage_info, tvb, offset, 8, ENC_BIG_ENDIAN);
3662
0
}
3663
3664
/* Cops - Section : PacketCable error */
3665
static int
3666
0
cops_packetcable_mm_error(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3667
3668
0
    proto_tree *stt;
3669
0
    uint32_t code;
3670
0
    uint16_t subcode;
3671
3672
    /* Create a subtree */
3673
0
    stt = info_to_cops_subtree(tvb,st,n,offset,"PacketCable Error");
3674
0
    offset += 4;
3675
3676
0
    proto_tree_add_item_ret_uint(stt, hf_cops_pcmm_packetcable_error_code, tvb, offset, 2, ENC_BIG_ENDIAN, &code);
3677
0
    offset += 2;
3678
3679
0
    subcode = tvb_get_ntohs(tvb, offset);
3680
0
    if (code == 6 || code == 7)
3681
0
        proto_tree_add_uint_format_value(stt, hf_cops_pcmm_packetcable_error_subcode,
3682
0
                                   tvb, offset, 2, subcode, "0x%02x, S-Num: 0x%02x, S-Type: 0x%02x",
3683
0
                                   subcode, subcode >> 8, subcode & 0xf);
3684
0
    else
3685
0
        proto_tree_add_item(stt, hf_cops_pcmm_packetcable_error_subcode, tvb, offset, 2, ENC_BIG_ENDIAN);
3686
0
    offset += 2;
3687
3688
0
    return offset;
3689
0
}
3690
3691
/* Cops - Section : Gate State */
3692
static int
3693
0
cops_gate_state(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3694
3695
0
     proto_tree *stt;
3696
3697
     /* Create a subtree */
3698
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Gate State");
3699
0
     offset += 4;
3700
3701
     /* State */
3702
0
     proto_tree_add_item(stt, hf_cops_pcmm_packetcable_gate_state, tvb, offset, 2, ENC_BIG_ENDIAN);
3703
0
     offset += 2;
3704
3705
     /* Reason */
3706
0
     proto_tree_add_item(stt, hf_cops_pcmm_packetcable_gate_state_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
3707
0
     offset += 2;
3708
3709
0
     return offset;
3710
0
}
3711
3712
/* Cops - Section : Version Info */
3713
static int
3714
0
cops_version_info(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3715
3716
0
     proto_tree *stt;
3717
3718
     /* Create a subtree */
3719
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Version Info");
3720
0
     offset += 4;
3721
3722
     /* State */
3723
0
     proto_tree_add_item(stt, hf_cops_pcmm_packetcable_version_info_major, tvb, offset, 2, ENC_BIG_ENDIAN);
3724
0
     offset += 2;
3725
3726
     /* Reason */
3727
0
     proto_tree_add_item(stt, hf_cops_pcmm_packetcable_version_info_minor, tvb, offset, 2, ENC_BIG_ENDIAN);
3728
0
     offset += 2;
3729
3730
0
     return offset;
3731
0
}
3732
3733
/* Cops - Section : PSID */
3734
static void
3735
0
cops_psid(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3736
3737
0
     proto_tree *stt;
3738
3739
     /* Create a subtree */
3740
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"PSID");
3741
0
     offset += 4;
3742
3743
     /* PSID */
3744
0
     proto_tree_add_item(stt, hf_cops_pcmm_psid, tvb, offset, 4, ENC_BIG_ENDIAN);
3745
0
}
3746
3747
/* Cops - Section : Synch Options */
3748
static int
3749
0
cops_synch_options(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3750
3751
0
     proto_tree *stt;
3752
3753
     /* Create a subtree */
3754
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Synch Options");
3755
0
     offset += 4;
3756
3757
0
     proto_tree_add_item(stt, hf_cops_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
3758
0
     offset += 2;
3759
3760
     /* Report Type */
3761
0
     proto_tree_add_item(stt, hf_cops_pcmm_synch_options_report_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3762
0
     offset += 1;
3763
3764
     /* Sych Type */
3765
0
     proto_tree_add_item(stt, hf_cops_pcmm_synch_options_synch_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3766
0
     offset += 1;
3767
3768
0
     return offset;
3769
0
}
3770
3771
/* Cops - Section : Msg Receipt Key */
3772
static void
3773
0
cops_msg_receipt_key(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3774
3775
0
     proto_tree *stt;
3776
3777
     /* Create a subtree */
3778
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"Msg Receipt Key");
3779
0
     offset += 4;
3780
3781
     /* Msg Receipt Key */
3782
0
     proto_tree_add_item(stt, hf_cops_pcmm_msg_receipt_key, tvb, offset, 4, ENC_BIG_ENDIAN);
3783
0
}
3784
3785
/* Cops - Section : UserID */
3786
static void
3787
0
cops_userid(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3788
3789
0
     proto_tree *stt;
3790
3791
     /* Create a subtree */
3792
0
     stt = info_to_cops_subtree(tvb, st, n, offset, "UserID");
3793
0
     offset += 4;
3794
3795
     /* UserID */
3796
0
     proto_tree_add_item(stt, hf_cops_pcmm_userid, tvb, offset, n - 4, ENC_ASCII);
3797
0
}
3798
3799
/* Cops - Section : SharedResourceID */
3800
static void
3801
0
cops_sharedresourceid(tvbuff_t *tvb, proto_tree *st, unsigned n, uint32_t offset) {
3802
3803
0
     proto_tree *stt;
3804
3805
     /* Create a subtree */
3806
0
     stt = info_to_cops_subtree(tvb,st,n,offset,"SharedResourceID");
3807
0
     offset += 4;
3808
3809
     /* SharedResourceID */
3810
0
     proto_tree_add_item(stt, hf_cops_pcmm_sharedresourceid, tvb, offset, 4, ENC_BIG_ENDIAN);
3811
0
}
3812
3813
/* PacketCable D-QoS S-Num/S-Type globs */
3814
0
#define PCDQ_TRANSACTION_ID              0x0101
3815
0
#define PCDQ_SUBSCRIBER_IDv4             0x0201
3816
0
#define PCDQ_SUBSCRIBER_IDv6             0x0202
3817
0
#define PCDQ_GATE_ID                     0x0301
3818
0
#define PCDQ_ACTIVITY_COUNT              0x0401
3819
0
#define PCDQ_GATE_SPEC                   0x0501
3820
0
#define PCDQ_REMOTE_GATE_INFO            0x0601
3821
0
#define PCDQ_EVENT_GENERATION_INFO       0x0701
3822
#define PCDQ_MEDIA_CONNECTION_EVENT_INFO 0x0801
3823
0
#define PCDQ_PACKETCABLE_ERROR           0x0901
3824
0
#define PCDQ_PACKETCABLE_REASON          0x0d01
3825
0
#define PCDQ_ELECTRONIC_SURVEILLANCE     0x0a01
3826
#define PCDQ_SESSION_DESCRIPTION         0x0b01
3827
3828
/* Analyze the PacketCable objects */
3829
static void
3830
0
cops_analyze_packetcable_dqos_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint8_t op_code, uint32_t offset) {
3831
3832
0
    int remdata;
3833
0
    uint16_t object_len;
3834
0
    uint8_t s_num, s_type;
3835
0
    uint16_t num_type_glob;
3836
3837
    /* Only if this option is enabled by the Gui */
3838
0
    if ( cops_packetcable == false ) {
3839
0
        return;
3840
0
    }
3841
3842
    /* Do the remaining client specific objects */
3843
0
    remdata = tvb_reported_length_remaining(tvb, offset);
3844
0
    while (remdata > 4) {
3845
3846
        /* In case we have remaining data, then lets try to get this analyzed */
3847
0
        object_len   = tvb_get_ntohs(tvb, offset);
3848
0
        if (object_len < 4) {
3849
0
            proto_tree_add_expert_format(tree, pinfo, &ei_cops_bad_cops_object_length, tvb, offset, 2,
3850
0
                                "Incorrect PacketCable object length %u < 4", object_len);
3851
0
            return;
3852
0
        }
3853
3854
0
        s_num        = tvb_get_uint8(tvb, offset + 2);
3855
0
        s_type       = tvb_get_uint8(tvb, offset + 3);
3856
3857
        /* Glom the s_num and s_type together to make switching easier */
3858
0
        num_type_glob = s_num << 8 | s_type;
3859
3860
        /* Perform the appropriate functions */
3861
0
        switch (num_type_glob){
3862
0
        case PCDQ_TRANSACTION_ID:
3863
0
            cops_transaction_id(tvb, pinfo, tree, op_code, object_len, offset);
3864
0
            break;
3865
0
        case PCDQ_SUBSCRIBER_IDv4:
3866
0
            cops_subscriber_id_v4(tvb, tree, object_len, offset);
3867
0
            break;
3868
0
        case PCDQ_SUBSCRIBER_IDv6:
3869
0
            cops_subscriber_id_v6(tvb, tree, object_len, offset);
3870
0
            break;
3871
0
        case PCDQ_GATE_ID:
3872
0
            cops_gate_id(tvb, tree, object_len, offset);
3873
0
            break;
3874
0
        case PCDQ_ACTIVITY_COUNT:
3875
0
            cops_activity_count(tvb, tree, object_len, offset);
3876
0
            break;
3877
0
        case PCDQ_GATE_SPEC:
3878
0
            cops_gate_specs(tvb, tree, object_len, offset);
3879
0
            break;
3880
0
        case PCDQ_REMOTE_GATE_INFO:
3881
0
            cops_remote_gate_info(tvb, tree, object_len, offset);
3882
0
            break;
3883
0
        case PCDQ_EVENT_GENERATION_INFO:
3884
0
            cops_event_generation_info(tvb, tree, object_len, offset);
3885
0
            break;
3886
0
        case PCDQ_PACKETCABLE_ERROR:
3887
0
            cops_packetcable_error(tvb, tree, object_len, offset);
3888
0
            break;
3889
0
        case PCDQ_ELECTRONIC_SURVEILLANCE:
3890
0
            cops_surveillance_parameters(tvb, tree, object_len, offset);
3891
0
            break;
3892
0
        case PCDQ_PACKETCABLE_REASON:
3893
0
            cops_packetcable_reason(tvb, tree, object_len, offset);
3894
0
            break;
3895
0
        }
3896
3897
        /* Tune offset */
3898
0
        offset += object_len;
3899
3900
        /* See what we can still get from the buffer */
3901
0
        remdata = tvb_reported_length_remaining(tvb, offset);
3902
0
    }
3903
0
}
3904
3905
0
#define PCMM_TRANSACTION_ID                0x0101
3906
0
#define PCMM_AMID                          0x0201
3907
0
#define PCMM_SUBSCRIBER_ID                 0x0301
3908
0
#define PCMM_SUBSCRIBER_ID_V6              0x0302
3909
0
#define PCMM_GATE_ID                       0x0401
3910
0
#define PCMM_GATE_SPEC                     0x0501
3911
0
#define PCMM_CLASSIFIER                    0x0601
3912
0
#define PCMM_EXTENDED_CLASSIFIER           0x0602
3913
0
#define PCMM_IPV6_CLASSIFIER               0x0603
3914
0
#define PCMM_FLOW_SPEC                     0x0701
3915
0
#define PCMM_DOCSIS_SERVICE_CLASS_NAME     0x0702
3916
0
#define PCMM_BEST_EFFORT_SERVICE           0x0703
3917
0
#define PCMM_NON_REAL_TIME_POLLING_SERVICE 0x0704
3918
0
#define PCMM_REAL_TIME_POLLING_SERVICE     0x0705
3919
0
#define PCMM_UNSOLICITED_GRANT_SERVICE     0x0706
3920
0
#define PCMM_UGS_WITH_ACTIVITY_DETECTION   0x0707
3921
0
#define PCMM_DOWNSTREAM_SERVICE            0x0708
3922
0
#define PCMM_UPSTREAM_DROP                 0x0709
3923
0
#define PCMM_EVENT_GENERATION_INFO         0x0801
3924
0
#define PCMM_VOLUME_BASED_USAGE_LIMIT      0x0901
3925
0
#define PCMM_TIME_BASED_USAGE_LIMIT        0x0a01
3926
0
#define PCMM_OPAQUE_DATA                   0x0b01
3927
0
#define PCMM_GATE_TIME_INFO                0x0c01
3928
0
#define PCMM_GATE_USAGE_INFO               0x0d01
3929
0
#define PCMM_PACKETCABLE_ERROR             0x0e01
3930
0
#define PCMM_GATE_STATE                    0x0f01
3931
0
#define PCMM_VERSION_INFO                  0x1001
3932
0
#define PCMM_PSID                          0x1101
3933
0
#define PCMM_SYNCH_OPTIONS                 0x1201
3934
0
#define PCMM_MSG_RECEIPT_KEY               0x1301
3935
0
#define PCMM_USERID                        0x1501
3936
0
#define PCMM_SHAREDRESOURCEID              0x1601
3937
3938
3939
static void
3940
0
cops_analyze_packetcable_mm_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint8_t op_code, uint32_t offset) {
3941
3942
0
    uint16_t object_len;
3943
0
    uint8_t s_num, s_type;
3944
0
    uint16_t num_type_glob;
3945
3946
    /* Only if this option is enabled by the Gui */
3947
0
    if ( cops_packetcable == false ) {
3948
0
        return;
3949
0
    }
3950
3951
    /* Do the remaining client specific objects */
3952
0
    while (tvb_reported_length_remaining(tvb, offset) > 4) {
3953
3954
        /* In case we have remaining data, then lets try to get this analyzed */
3955
0
        object_len   = tvb_get_ntohs(tvb, offset);
3956
0
        if (object_len < 4) {
3957
0
            proto_tree_add_expert_format(tree, pinfo, &ei_cops_bad_cops_object_length, tvb, offset, 2,
3958
0
                                "Incorrect PacketCable object length %u < 4", object_len);
3959
0
            return;
3960
0
        }
3961
3962
0
        s_num        = tvb_get_uint8(tvb, offset + 2);
3963
0
        s_type       = tvb_get_uint8(tvb, offset + 3);
3964
3965
        /* Glom the s_num and s_type together to make switching easier */
3966
0
        num_type_glob = s_num << 8 | s_type;
3967
3968
        /* Perform the appropriate functions */
3969
0
        switch (num_type_glob){
3970
0
        case PCMM_TRANSACTION_ID:
3971
0
            cops_mm_transaction_id(tvb, pinfo, tree, op_code, object_len, offset);
3972
0
            break;
3973
0
        case PCMM_AMID:
3974
0
            cops_amid(tvb, tree, object_len, offset);
3975
0
            break;
3976
0
        case PCMM_SUBSCRIBER_ID:
3977
0
            cops_subscriber_id_v4(tvb, tree, object_len, offset);
3978
0
            break;
3979
0
        case PCMM_SUBSCRIBER_ID_V6:
3980
0
            cops_subscriber_id_v6(tvb, tree, object_len, offset);
3981
0
            break;
3982
0
        case PCMM_GATE_ID:
3983
0
            cops_gate_id(tvb, tree, object_len, offset);
3984
0
            break;
3985
0
        case PCMM_GATE_SPEC:
3986
0
            cops_mm_gate_spec(tvb, tree, object_len, offset);
3987
0
            break;
3988
0
        case PCMM_CLASSIFIER:
3989
0
            cops_classifier(tvb, tree, object_len, offset, false);
3990
0
            break;
3991
0
        case PCMM_EXTENDED_CLASSIFIER:
3992
0
            cops_classifier(tvb, tree, object_len, offset, true);
3993
0
            break;
3994
0
        case PCMM_IPV6_CLASSIFIER:
3995
0
            cops_ipv6_classifier(tvb, tree, object_len, offset);
3996
0
            break;
3997
0
        case PCMM_FLOW_SPEC:
3998
0
            cops_flow_spec(tvb, tree, object_len, offset);
3999
0
            break;
4000
0
        case PCMM_DOCSIS_SERVICE_CLASS_NAME:
4001
0
            cops_docsis_service_class_name(tvb, pinfo, tree, object_len, offset);
4002
0
            break;
4003
0
        case PCMM_BEST_EFFORT_SERVICE:
4004
0
            if (object_len == 44 || object_len == 80 || object_len == 116)
4005
0
                cops_best_effort_service_i04_i05(tvb, tree, object_len, offset, true);
4006
0
            else if (object_len == 40 || object_len == 72 || object_len == 104)
4007
0
                cops_best_effort_service_i04_i05(tvb, tree, object_len, offset, false);
4008
0
            else
4009
0
                cops_best_effort_service(tvb, tree, object_len, offset);
4010
0
            break;
4011
0
        case PCMM_NON_REAL_TIME_POLLING_SERVICE:
4012
0
            if (object_len == 48 || object_len == 88 || object_len == 128)
4013
0
                cops_non_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, true);
4014
0
            else if (object_len == 44 || object_len == 80 || object_len == 116)
4015
0
                cops_non_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, false);
4016
0
            else
4017
0
                cops_non_real_time_polling_service(tvb, tree, object_len, offset);
4018
0
            break;
4019
0
        case PCMM_REAL_TIME_POLLING_SERVICE:
4020
0
            if (object_len == 48 || object_len == 88 || object_len == 128)
4021
0
                cops_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, true);
4022
0
            else if (object_len == 44 || object_len == 80 || object_len == 116)
4023
0
                cops_real_time_polling_service_i04_i05(tvb, tree, object_len, offset, false);
4024
0
            else
4025
0
                cops_real_time_polling_service(tvb, tree, object_len, offset);
4026
0
            break;
4027
0
        case PCMM_UNSOLICITED_GRANT_SERVICE:
4028
0
            if (object_len == 36 || object_len == 64 || object_len == 92)
4029
0
                cops_unsolicited_grant_service_i04_i05(tvb, tree, object_len, offset, true);
4030
0
            else if (object_len == 32 || object_len == 56 || object_len == 80)
4031
0
                cops_unsolicited_grant_service_i04_i05(tvb, tree, object_len, offset, false);
4032
0
            else
4033
0
                cops_unsolicited_grant_service(tvb, tree, object_len, offset);
4034
0
            break;
4035
0
        case PCMM_UGS_WITH_ACTIVITY_DETECTION:
4036
0
            if (object_len == 44 || object_len == 80 || object_len == 116)
4037
0
                cops_ugs_with_activity_detection_i04_i05(tvb, tree, object_len, offset, true);
4038
0
            else if (object_len == 40 || object_len == 72 || object_len == 104)
4039
0
                cops_ugs_with_activity_detection_i04_i05(tvb, tree, object_len, offset, false);
4040
0
            else
4041
0
                cops_ugs_with_activity_detection(tvb, tree, object_len, offset);
4042
0
            break;
4043
0
        case PCMM_DOWNSTREAM_SERVICE:
4044
0
            if (object_len == 48 || object_len == 88 || object_len == 128)
4045
0
                cops_downstream_service_i04_i05(tvb, tree, object_len, offset, true);
4046
0
            else if (object_len == 40 || object_len == 72 || object_len == 104)
4047
0
                cops_downstream_service_i04_i05(tvb, tree, object_len, offset, false);
4048
0
            else
4049
0
                cops_downstream_service(tvb, tree, object_len, offset);
4050
0
            break;
4051
0
        case PCMM_UPSTREAM_DROP:
4052
0
            cops_upstream_drop_i04(tvb, tree, object_len, offset);
4053
0
            break;
4054
0
        case PCMM_EVENT_GENERATION_INFO:
4055
0
            cops_mm_event_generation_info(tvb, tree, object_len, offset);
4056
0
            break;
4057
0
        case PCMM_VOLUME_BASED_USAGE_LIMIT:
4058
0
            cops_volume_based_usage_limit(tvb, tree, object_len, offset);
4059
0
            break;
4060
0
        case PCMM_TIME_BASED_USAGE_LIMIT:
4061
0
            cops_time_based_usage_limit(tvb, tree, object_len, offset);
4062
0
            break;
4063
0
        case PCMM_OPAQUE_DATA:
4064
0
            cops_opaque_data(tvb, tree, object_len, offset);
4065
0
            break;
4066
0
        case PCMM_GATE_TIME_INFO:
4067
0
            cops_gate_time_info(tvb, tree, object_len, offset);
4068
0
            break;
4069
0
        case PCMM_GATE_USAGE_INFO:
4070
0
            cops_gate_usage_info(tvb, tree, object_len, offset);
4071
0
            break;
4072
0
        case PCMM_PACKETCABLE_ERROR:
4073
0
            cops_packetcable_mm_error(tvb, tree, object_len, offset);
4074
0
            break;
4075
0
        case PCMM_GATE_STATE:
4076
0
            cops_gate_state(tvb, tree, object_len, offset);
4077
0
            break;
4078
0
        case PCMM_VERSION_INFO:
4079
0
            cops_version_info(tvb, tree, object_len, offset);
4080
0
            break;
4081
0
        case PCMM_PSID:
4082
0
            cops_psid(tvb, tree, object_len, offset);
4083
0
            break;
4084
0
        case PCMM_SYNCH_OPTIONS:
4085
0
            cops_synch_options(tvb, tree, object_len, offset);
4086
0
            break;
4087
0
        case PCMM_MSG_RECEIPT_KEY:
4088
0
            cops_msg_receipt_key(tvb, tree, object_len, offset);
4089
0
            break;
4090
0
        case PCMM_USERID:
4091
0
            cops_userid(tvb, tree, object_len, offset);
4092
0
            break;
4093
0
        case PCMM_SHAREDRESOURCEID:
4094
0
            cops_sharedresourceid(tvb, tree, object_len, offset);
4095
0
            break;
4096
4097
0
        }
4098
4099
        /* Tune offset */
4100
0
        offset += object_len;
4101
0
    }
4102
0
}
4103
4104
4105
/* End of PacketCable Addition */
4106
4107
4108
4109
4110
/* Register the protocol with Wireshark */
4111
void proto_register_cops(void)
4112
16
{
4113
    /* Setup list of header fields */
4114
16
    static hf_register_info hf[] = {
4115
16
        { &hf_cops_ver_flags,
4116
16
          { "Version and Flags",           "cops.ver_flags",
4117
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
4118
16
            "Version and Flags in COPS Common Header", HFILL }
4119
16
        },
4120
16
        { &hf_cops_version,
4121
16
          { "Version",           "cops.version",
4122
16
            FT_UINT8, BASE_DEC, NULL, 0xF0,
4123
16
            "Version in COPS Common Header", HFILL }
4124
16
        },
4125
16
        { &hf_cops_flags,
4126
16
          { "Flags",           "cops.flags",
4127
16
            FT_UINT8, BASE_HEX, VALS(cops_flags_vals), 0x0F,
4128
16
            "Flags in COPS Common Header", HFILL }
4129
16
        },
4130
16
        { &hf_cops_response_in,
4131
16
          { "Response In",     "cops.response_in",
4132
16
            FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0,
4133
16
            "The response to this COPS request is in this frame", HFILL }
4134
16
        },
4135
16
        { &hf_cops_response_to,
4136
16
          { "Request In",      "cops.response_to",
4137
16
            FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0,
4138
16
            "This is a response to the COPS request in this frame", HFILL }
4139
16
        },
4140
16
        { &hf_cops_response_time,
4141
16
          { "Response Time",   "cops.response_time",
4142
16
            FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
4143
16
            "The time between the Call and the Reply", HFILL }
4144
16
        },
4145
16
        { &hf_cops_op_code,
4146
16
          { "Op Code",           "cops.op_code",
4147
16
            FT_UINT8, BASE_DEC, VALS(cops_op_code_vals), 0x0,
4148
16
            "Op Code in COPS Common Header", HFILL }
4149
16
        },
4150
16
        { &hf_cops_client_type,
4151
16
          { "Client Type",           "cops.client_type",
4152
16
            FT_UINT16, BASE_DEC, VALS(cops_client_type_vals), 0x0,
4153
16
            "Client Type in COPS Common Header", HFILL }
4154
16
        },
4155
16
        { &hf_cops_msg_len,
4156
16
          { "Message Length",           "cops.msg_len",
4157
16
            FT_UINT32, BASE_DEC, NULL, 0x0,
4158
16
            "Message Length in COPS Common Header", HFILL }
4159
16
        },
4160
16
        { &hf_cops_obj_len,
4161
16
          { "Object Length",           "cops.obj.len",
4162
16
            FT_UINT32, BASE_DEC, NULL, 0x0,
4163
16
            "Object Length in COPS Object Header", HFILL }
4164
16
        },
4165
16
        { &hf_cops_obj_c_num,
4166
16
          { "C-Num",           "cops.c_num",
4167
16
            FT_UINT8, BASE_DEC, VALS(cops_c_num_vals), 0x0,
4168
16
            "C-Num in COPS Object Header", HFILL }
4169
16
        },
4170
16
        { &hf_cops_obj_c_type,
4171
16
          { "C-Type",           "cops.c_type",
4172
16
            FT_UINT8, BASE_DEC, NULL, 0x0,
4173
16
            "C-Type in COPS Object Header", HFILL }
4174
16
        },
4175
4176
16
        { &hf_cops_obj_s_num,
4177
16
          { "S-Num",           "cops.s_num",
4178
16
            FT_UINT8, BASE_DEC, VALS(cops_s_num_vals), 0x0,
4179
16
            "S-Num in COPS-PR Object Header", HFILL }
4180
16
        },
4181
16
        { &hf_cops_obj_s_type,
4182
16
          { "S-Type",           "cops.s_type",
4183
16
            FT_UINT8, BASE_DEC, NULL, 0x0,
4184
16
            "S-Type in COPS-PR Object Header", HFILL }
4185
16
        },
4186
16
        { &hf_cops_handle,
4187
16
          { "Handle",           "cops.handle",
4188
16
            FT_UINT32, BASE_HEX, NULL, 0x0,
4189
16
            "Handle in COPS Handle Object", HFILL }
4190
16
        },
4191
16
        { &hf_cops_r_type_flags,
4192
16
          { "R-Type",           "cops.context.r_type",
4193
16
            FT_UINT16, BASE_HEX, VALS(cops_r_type_vals), 0x0,
4194
16
            "R-Type in COPS Context Object", HFILL }
4195
16
        },
4196
16
        { &hf_cops_m_type_flags,
4197
16
          { "M-Type",           "cops.context.m_type",
4198
16
            FT_UINT16, BASE_HEX, NULL, 0x0,
4199
16
            "M-Type in COPS Context Object", HFILL }
4200
16
        },
4201
16
        { &hf_cops_in_int_ipv4,
4202
16
          { "IPv4 address",           "cops.in-int.ipv4",
4203
16
            FT_IPv4, BASE_NONE, NULL, 0,
4204
16
            "IPv4 address in COPS IN-Int object", HFILL }
4205
16
        },
4206
16
        { &hf_cops_in_int_ipv6,
4207
16
          { "IPv6 address",           "cops.in-int.ipv6",
4208
16
            FT_IPv6, BASE_NONE, NULL, 0,
4209
16
            "IPv6 address in COPS IN-Int object", HFILL }
4210
16
        },
4211
16
        { &hf_cops_out_int_ipv4,
4212
16
          { "IPv4 address",           "cops.out-int.ipv4",
4213
16
            FT_IPv4, BASE_NONE, NULL, 0,
4214
16
            "IPv4 address in COPS OUT-Int object", HFILL }
4215
16
        },
4216
16
        { &hf_cops_out_int_ipv6,
4217
16
          { "IPv6 address",           "cops.out-int.ipv6",
4218
16
            FT_IPv6, BASE_NONE, NULL, 0,
4219
16
            "IPv6 address in COPS OUT-Int", HFILL }
4220
16
        },
4221
16
        { &hf_cops_int_ifindex,
4222
16
          { "ifIndex",           "cops.in-out-int.ifindex",
4223
16
            FT_UINT32, BASE_DEC, NULL, 0x0,
4224
16
            "If SNMP is supported, corresponds to MIB-II ifIndex", HFILL }
4225
16
        },
4226
16
        { &hf_cops_reason,
4227
16
          { "Reason",           "cops.reason",
4228
16
            FT_UINT16, BASE_DEC, VALS(cops_reason_vals), 0,
4229
16
            "Reason in Reason object", HFILL }
4230
16
        },
4231
16
        { &hf_cops_reason_sub,
4232
16
          { "Reason Sub-code",           "cops.reason_sub",
4233
16
            FT_UINT16, BASE_HEX, NULL, 0,
4234
16
            "Reason Sub-code in Reason object", HFILL }
4235
16
        },
4236
16
        { &hf_cops_dec_cmd_code,
4237
16
          { "Command-Code",           "cops.decision.cmd",
4238
16
            FT_UINT16, BASE_DEC, VALS(cops_dec_cmd_code_vals), 0,
4239
16
            "Command-Code in Decision/LPDP Decision object", HFILL }
4240
16
        },
4241
16
        { &hf_cops_dec_flags,
4242
16
          { "Flags",           "cops.decision.flags",
4243
16
            FT_UINT16, BASE_HEX, VALS(cops_dec_cmd_flag_vals), 0xffff,
4244
16
            "Flags in Decision/LPDP Decision object", HFILL }
4245
16
        },
4246
16
        { &hf_cops_error,
4247
16
          { "Error",           "cops.error",
4248
16
            FT_UINT16, BASE_DEC, VALS(cops_error_vals), 0,
4249
16
            "Error in Error object", HFILL }
4250
16
        },
4251
16
        { &hf_cops_error_sub,
4252
16
          { "Error Sub-code",           "cops.error_sub",
4253
16
            FT_UINT16, BASE_HEX, NULL, 0,
4254
16
            "Error Sub-code in Error object", HFILL }
4255
16
        },
4256
16
        { &hf_cops_katimer,
4257
16
          { "Contents: KA Timer Value",           "cops.katimer.value",
4258
16
            FT_UINT16, BASE_DEC, NULL, 0,
4259
16
            "Keep-Alive Timer Value in KATimer object", HFILL }
4260
16
        },
4261
16
        { &hf_cops_pepid,
4262
16
          { "Contents: PEP Id",           "cops.pepid.id",
4263
16
            FT_STRING, BASE_NONE, NULL, 0,
4264
16
            "PEP Id in PEPID object", HFILL }
4265
16
        },
4266
16
        { &hf_cops_report_type,
4267
16
          { "Contents: Report-Type",           "cops.report_type",
4268
16
            FT_UINT16, BASE_DEC, VALS(cops_report_type_vals), 0,
4269
16
            "Report-Type in Report-Type object", HFILL }
4270
16
        },
4271
16
        { &hf_cops_pdprediraddr_ipv4,
4272
16
          { "IPv4 address",           "cops.pdprediraddr.ipv4",
4273
16
            FT_IPv4, BASE_NONE, NULL, 0,
4274
16
            "IPv4 address in COPS PDPRedirAddr object", HFILL }
4275
16
        },
4276
16
        { &hf_cops_pdprediraddr_ipv6,
4277
16
          { "IPv6 address",           "cops.pdprediraddr.ipv6",
4278
16
            FT_IPv6, BASE_NONE, NULL, 0,
4279
16
            "IPv6 address in COPS PDPRedirAddr object", HFILL }
4280
16
        },
4281
16
        { &hf_cops_lastpdpaddr_ipv4,
4282
16
          { "IPv4 address",           "cops.lastpdpaddr.ipv4",
4283
16
            FT_IPv4, BASE_NONE, NULL, 0,
4284
16
            "IPv4 address in COPS LastPDPAddr object", HFILL }
4285
16
        },
4286
16
        { &hf_cops_lastpdpaddr_ipv6,
4287
16
          { "IPv6 address",           "cops.lastpdpaddr.ipv6",
4288
16
            FT_IPv6, BASE_NONE, NULL, 0,
4289
16
            "IPv6 address in COPS LastPDPAddr object", HFILL }
4290
16
        },
4291
16
        { &hf_cops_pdp_tcp_port,
4292
16
          { "TCP Port Number",           "cops.pdp.tcp_port",
4293
16
            FT_UINT32, BASE_DEC, NULL, 0x0,
4294
16
            "TCP Port Number of PDP in PDPRedirAddr/LastPDPAddr object", HFILL }
4295
16
        },
4296
16
        { &hf_cops_accttimer,
4297
16
          { "Contents: ACCT Timer Value",           "cops.accttimer.value",
4298
16
            FT_UINT16, BASE_DEC, NULL, 0,
4299
16
            "Accounting Timer Value in AcctTimer object", HFILL }
4300
16
        },
4301
16
        { &hf_cops_key_id,
4302
16
          { "Contents: Key ID",           "cops.integrity.key_id",
4303
16
            FT_UINT32, BASE_DEC, NULL, 0,
4304
16
            "Key ID in Integrity object", HFILL }
4305
16
        },
4306
16
        { &hf_cops_seq_num,
4307
16
          { "Contents: Sequence Number",           "cops.integrity.seq_num",
4308
16
            FT_UINT32, BASE_DEC, NULL, 0,
4309
16
            "Sequence Number in Integrity object", HFILL }
4310
16
        },
4311
16
        { &hf_cops_keyed_message_digest,
4312
16
          { "Contents: Keyed Message Digest",           "cops.integrity.keyed_message_digest",
4313
16
            FT_BYTES, BASE_NONE, NULL, 0,
4314
16
            NULL, HFILL }
4315
16
        },
4316
16
        { &hf_cops_integrity_contents,
4317
16
          { "Contents",           "cops.integrity.contents",
4318
16
            FT_BYTES, BASE_NONE, NULL, 0,
4319
16
            NULL, HFILL }
4320
16
        },
4321
16
        { &hf_cops_opaque_data,
4322
16
          { "Opaque Data",           "cops.opaque_data",
4323
16
            FT_BYTES, BASE_NONE, NULL, 0,
4324
16
            NULL, HFILL }
4325
16
        },
4326
16
        { &hf_cops_gperror,
4327
16
          { "Error",           "cops.gperror",
4328
16
            FT_UINT16, BASE_DEC, VALS(cops_gperror_vals), 0,
4329
16
            "Error in Error object", HFILL }
4330
16
        },
4331
16
        { &hf_cops_gperror_sub,
4332
16
          { "Error Sub-code",           "cops.gperror_sub",
4333
16
            FT_UINT16, BASE_HEX, NULL, 0,
4334
16
            "Error Sub-code in Error object", HFILL }
4335
16
        },
4336
16
        { &hf_cops_cperror,
4337
16
          { "Error",           "cops.cperror",
4338
16
            FT_UINT16, BASE_DEC, VALS(cops_cperror_vals), 0,
4339
16
            "Error in Error object", HFILL }
4340
16
        },
4341
16
        { &hf_cops_cperror_sub,
4342
16
          { "Error Sub-code",           "cops.cperror_sub",
4343
16
            FT_UINT16, BASE_HEX, NULL, 0,
4344
16
            "Error Sub-code in Error object", HFILL }
4345
16
        },
4346
4347
16
        { &hf_cops_reserved8, { "Reserved", "cops.reserved", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } },
4348
16
        { &hf_cops_reserved16, { "Reserved", "cops.reserved", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } },
4349
16
        { &hf_cops_reserved24, { "Reserved", "cops.reserved", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL } },
4350
4351
16
        { &hf_cops_prid_oid, { "PRID Instance Identifier", "cops.prid.instance_id", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
4352
16
        { &hf_cops_pprid_oid, { "Prefix Identifier", "cops.pprid.prefix_id", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
4353
16
        { &hf_cops_errprid_oid, { "ErrorPRID Instance Identifier", "cops.errprid.instance_id", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
4354
16
        { &hf_cops_epd_unknown, { "EPD Unknown Data", "cops.epd.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
4355
16
        { &hf_cops_epd_null, { "EPD Null Data", "cops.epd.null", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
4356
16
        { &hf_cops_epd_int, { "EPD Integer Data", "cops.epd.int", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL } },
4357
16
        { &hf_cops_epd_octets, { "EPD Octet String Data", "cops.epd.octets", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
4358
16
        { &hf_cops_epd_oid, { "EPD OID Data", "cops.epd.oid", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL } },
4359
16
        { &hf_cops_epd_ipv4, { "EPD IPAddress Data", "cops.epd.ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } },
4360
16
        { &hf_cops_epd_u32, { "EPD Unsigned32 Data", "cops.epd.unsigned32", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
4361
16
        { &hf_cops_epd_ticks, { "EPD TimeTicks Data", "cops.epd.timeticks", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
4362
16
        { &hf_cops_epd_opaque, { "EPD Opaque Data", "cops.epd.opaque", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } },
4363
16
        { &hf_cops_epd_i64, { "EPD Integer64 Data", "cops.epd.integer64", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL } },
4364
16
        { &hf_cops_epd_u64, { "EPD Unsigned64 Data", "cops.epd.unsigned64", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
4365
4366
        /* Added for PacketCable */
4367
4368
16
        { &hf_cops_subtree,
4369
16
          { "Object Subtree", "cops.pc_subtree",
4370
16
            FT_NONE, BASE_NONE, NULL, 0,
4371
16
            NULL, HFILL }
4372
16
        },
4373
16
        { &hf_cops_pc_ds_field,
4374
16
          { "DS Field (DSCP or TOS)", "cops.pc_ds_field",
4375
16
            FT_UINT8, BASE_HEX, NULL, 0x00,
4376
16
            NULL, HFILL }
4377
16
        },
4378
16
        { &hf_cops_pc_direction,
4379
16
          { "Direction", "cops.pc_direction",
4380
16
            FT_UINT8, BASE_DEC, VALS(table_cops_direction), 0x00,
4381
16
            NULL, HFILL }
4382
16
        },
4383
16
        { &hf_cops_pc_gate_spec_flags,
4384
16
          { "Flags", "cops.pc_gate_spec_flags",
4385
16
            FT_UINT16, BASE_HEX, NULL, 0x00,
4386
16
            NULL, HFILL }
4387
16
        },
4388
16
        { &hf_cops_pc_protocol_id,
4389
16
          { "Protocol ID", "cops.pc_protocol_id",
4390
16
            FT_UINT8, BASE_DEC, NULL, 0x00,
4391
16
            NULL, HFILL }
4392
16
        },
4393
16
        { &hf_cops_pc_session_class,
4394
16
          { "Session Class", "cops.pc_session_class",
4395
16
            FT_UINT8, BASE_DEC, VALS(table_cops_session_class), 0x00,
4396
16
            NULL, HFILL }
4397
16
        },
4398
16
        { &hf_cops_pc_algorithm,
4399
16
          { "Algorithm", "cops.pc_algorithm",
4400
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4401
16
            NULL, HFILL }
4402
16
        },
4403
16
        { &hf_cops_pc_cmts_ip_port,
4404
16
          { "CMTS IP Port", "cops.pc_cmts_ip_port",
4405
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4406
16
            NULL, HFILL }
4407
16
        },
4408
16
        { &hf_cops_pc_prks_ip_port,
4409
16
          { "PRKS IP Port", "cops.pc_prks_ip_port",
4410
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4411
16
            NULL, HFILL }
4412
16
        },
4413
16
        { &hf_cops_pc_srks_ip_port,
4414
16
          { "SRKS IP Port", "cops.pc_srks_ip_port",
4415
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4416
16
            NULL, HFILL }
4417
16
        },
4418
16
        { &hf_cops_pc_dest_port,
4419
16
          { "Destination IP Port", "cops.pc_dest_port",
4420
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4421
16
            NULL, HFILL }
4422
16
        },
4423
16
        { &hf_cops_pc_packetcable_err_code,
4424
16
          { "Error Code", "cops.pc_packetcable_err_code",
4425
16
            FT_UINT16, BASE_DEC, VALS(table_cops_packetcable_error), 0x00,
4426
16
            NULL, HFILL }
4427
16
        },
4428
16
        { &hf_cops_pc_packetcable_sub_code,
4429
16
          { "Error Sub Code", "cops.pc_packetcable_sub_code",
4430
16
            FT_UINT16, BASE_HEX, NULL, 0x00,
4431
16
            NULL, HFILL }
4432
16
        },
4433
16
        { &hf_cops_pc_remote_flags,
4434
16
          { "Flags", "cops.pc_remote_flags",
4435
16
            FT_UINT16, BASE_HEX, NULL, 0x00,
4436
16
            NULL, HFILL }
4437
16
        },
4438
16
        { &hf_cops_pc_close_subcode,
4439
16
          { "Reason Sub Code", "cops.pc_close_subcode",
4440
16
            FT_UINT16, BASE_DEC, VALS(table_cops_reason_subcode_close), 0x00,
4441
16
            NULL, HFILL }
4442
16
        },
4443
16
        { &hf_cops_pc_gate_command_type,
4444
16
          { "Gate Command Type", "cops.pc_gate_command_type",
4445
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4446
16
            NULL, HFILL }
4447
16
        },
4448
16
        { &hf_cops_pc_dqos_gate_command_type,
4449
16
          { "Gate Command Type", "cops.pc_dqos_gate_command_type",
4450
16
            FT_UINT16, BASE_DEC, VALS(table_cops_dqos_transaction_id), 0x00,
4451
16
            NULL, HFILL }
4452
16
        },
4453
16
        { &hf_cops_pc_mm_gate_command_type,
4454
16
          { "Gate Command Type", "cops.pc_mm_gate_command_type",
4455
16
            FT_UINT16, BASE_DEC, VALS(table_cops_mm_transaction_id), 0x00,
4456
16
            NULL, HFILL }
4457
16
        },
4458
16
        { &hf_cops_pc_reason_code,
4459
16
          { "Reason Code", "cops.pc_reason_code",
4460
16
            FT_UINT16, BASE_HEX, VALS(table_cops_reason_code), 0x00,
4461
16
            NULL, HFILL }
4462
16
        },
4463
16
        { &hf_cops_pc_delete_subcode,
4464
16
          { "Reason Sub Code", "cops.pc_delete_subcode",
4465
16
            FT_UINT16, BASE_DEC, VALS(table_cops_reason_subcode_delete), 0x00,
4466
16
            NULL, HFILL }
4467
16
        },
4468
16
        { &hf_cops_pc_src_port,
4469
16
          { "Source IP Port", "cops.pc_src_port",
4470
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4471
16
            NULL, HFILL }
4472
16
        },
4473
16
        { &hf_cops_pc_t1_value,
4474
16
          { "Timer T1 Value", "cops.pc_t1_value",
4475
16
            FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_second_seconds), 0x00,
4476
16
            NULL, HFILL }
4477
16
        },
4478
16
        { &hf_cops_pc_t7_value,
4479
16
          { "Timer T7 Value", "cops.pc_t7_value",
4480
16
            FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_second_seconds), 0x00,
4481
16
            NULL, HFILL }
4482
16
        },
4483
16
        { &hf_cops_pc_t8_value,
4484
16
          { "Timer T8 Value", "cops.pc_t8_value",
4485
16
            FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_second_seconds), 0x00,
4486
16
            NULL, HFILL }
4487
16
        },
4488
16
        { &hf_cops_pc_transaction_id,
4489
16
          { "Transaction Identifier", "cops.pc_transaction_id",
4490
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4491
16
            NULL, HFILL }
4492
16
        },
4493
16
        { &hf_cops_pc_dqos_transaction_id,
4494
16
          { "D-QoS Transaction Identifier", "cops.pc_dqos_transaction_id",
4495
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4496
16
            NULL, HFILL }
4497
16
        },
4498
16
        { &hf_cops_pc_mm_transaction_id,
4499
16
          { "Multimedia Transaction Identifier", "cops.pc_mm_transaction_id",
4500
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4501
16
            NULL, HFILL }
4502
16
        },
4503
16
        { &hf_cops_pc_cmts_ip,
4504
16
          { "CMTS IP Address", "cops.pc_cmts_ip",
4505
16
            FT_IPv4, BASE_NONE, NULL, 0x00,
4506
16
            NULL, HFILL }
4507
16
        },
4508
16
        { &hf_cops_pc_prks_ip,
4509
16
          { "PRKS IP Address", "cops.pc_prks_ip",
4510
16
            FT_IPv4, BASE_NONE, NULL, 0x00,
4511
16
            NULL, HFILL }
4512
16
        },
4513
16
        { &hf_cops_pc_srks_ip,
4514
16
          { "SRKS IP Address", "cops.pc_srks_ip",
4515
16
            FT_IPv4, BASE_NONE, NULL, 0x00,
4516
16
            NULL, HFILL }
4517
16
        },
4518
16
        { &hf_cops_pc_dfcdc_ip,
4519
16
          { "DF IP Address CDC", "cops.pc_dfcdc_ip",
4520
16
            FT_IPv4, BASE_NONE, NULL, 0x00,
4521
16
            NULL, HFILL }
4522
16
        },
4523
16
        { &hf_cops_pc_dfccc_ip,
4524
16
          { "DF IP Address CCC", "cops.pc_dfccc_ip",
4525
16
            FT_IPv4, BASE_NONE, NULL, 0x00,
4526
16
            NULL, HFILL }
4527
16
        },
4528
16
        { &hf_cops_pc_dfcdc_ip_port,
4529
16
          { "DF IP Port CDC", "cops.pc_dfcdc_ip_port",
4530
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4531
16
            NULL, HFILL }
4532
16
        },
4533
16
        { &hf_cops_pc_dfccc_ip_port,
4534
16
          { "DF IP Port CCC", "cops.pc_dfccc_ip_port",
4535
16
            FT_UINT16, BASE_DEC, NULL, 0x00,
4536
16
            NULL, HFILL }
4537
16
        },
4538
16
        { &hf_cops_pc_dfccc_id,
4539
16
          { "CCC ID", "cops.pc_dfccc_id",
4540
16
            FT_UINT32, BASE_DEC, NULL, 0x00,
4541
16
            NULL, HFILL }
4542
16
        },
4543
16
        { &hf_cops_pc_activity_count,
4544
16
          { "Count", "cops.pc_activity_count",
4545
16
            FT_UINT32, BASE_DEC, NULL, 0x00,
4546
16
            NULL, HFILL }
4547
16
        },
4548
16
        { &hf_cops_pc_dest_ip,
4549
16
          { "Destination IP Address", "cops.pc_dest_ip",
4550
16
            FT_IPv4, BASE_NONE, NULL, 0x00,
4551
16
            NULL, HFILL }
4552
16
        },
4553
16
        { &hf_cops_pc_gate_id,
4554
16
          { "Gate Identifier", "cops.pc_gate_id",
4555
16
            FT_UINT32, BASE_HEX, NULL, 0x00,
4556
16
            NULL, HFILL }
4557
16
        },
4558
16
        { &hf_cops_pc_max_packet_size,
4559
16
          { "Maximum Packet Size", "cops.pc_max_packet_size",
4560
16
            FT_UINT32, BASE_DEC, NULL, 0x00,
4561
16
            NULL, HFILL }
4562
16
        },
4563
16
        { &hf_cops_pc_min_policed_unit,
4564
16
          { "Minimum Policed Unit", "cops.pc_min_policed_unit",
4565
16
            FT_UINT32, BASE_DEC, NULL, 0x00,
4566
16
            NULL, HFILL }
4567
16
        },
4568
16
        { &hf_cops_pc_peak_data_rate,
4569
16
          { "Peak Data Rate", "cops.pc_peak_data_rate",
4570
16
            FT_FLOAT, BASE_NONE, NULL, 0x00,
4571
16
            NULL, HFILL }
4572
16
        },
4573
16
        { &hf_cops_pc_spec_rate,
4574
16
          { "Rate", "cops.pc_spec_rate",
4575
16
            FT_FLOAT, BASE_NONE, NULL, 0x00,
4576
16
            NULL, HFILL }
4577
16
        },
4578
16
        { &hf_cops_pc_remote_gate_id,
4579
16
          { "Remote Gate ID", "cops.pc_remote_gate_id",
4580
16
            FT_UINT32, BASE_HEX, NULL, 0x00,
4581
16
            NULL, HFILL }
4582
16
        },
4583
16
        { &hf_cops_pc_reserved,
4584
16
          { "Reserved", "cops.pc_reserved",
4585
16
            FT_UINT32, BASE_HEX, NULL, 0x00,
4586
16
            NULL, HFILL }
4587
16
        },
4588
16
        { &hf_cops_pc_key,
4589
16
          { "Security Key", "cops.pc_key",
4590
16
            FT_BYTES, BASE_NONE, NULL, 0x00,
4591
16
            NULL, HFILL }
4592
16
        },
4593
16
        { &hf_cops_pc_slack_term,
4594
16
          { "Slack Term", "cops.pc_slack_term",
4595
16
            FT_UINT32, BASE_DEC, NULL, 0x00,
4596
16
            NULL, HFILL }
4597
16
        },
4598
16
        { &hf_cops_pc_src_ip,
4599
16
          { "Source IP Address", "cops.pc_src_ip",
4600
16
            FT_IPv4, BASE_NONE, NULL, 0x00,
4601
16
            NULL, HFILL }
4602
16
        },
4603
16
        { &hf_cops_pc_subscriber_id_ipv4,
4604
16
          { "Subscriber Identifier (IPv4)", "cops.pc_subscriber_id4",
4605
16
            FT_IPv4, BASE_NONE, NULL, 0x00,
4606
16
            NULL, HFILL }
4607
16
        },
4608
16
        { &hf_cops_pc_subscriber_id_ipv6,
4609
16
          { "Subscriber Identifier (IPv6)", "cops.pc_subscriber_id6",
4610
16
            FT_IPv6, BASE_NONE, NULL, 0x00,
4611
16
            NULL, HFILL }
4612
16
        },
4613
16
        { &hf_cops_pc_token_bucket_rate,
4614
16
          { "Token Bucket Rate", "cops.pc_token_bucket_rate",
4615
16
            FT_FLOAT, BASE_NONE, NULL, 0x00,
4616
16
            NULL, HFILL }
4617
16
        },
4618
16
        { &hf_cops_pc_token_bucket_size,
4619
16
          { "Token Bucket Size", "cops.pc_token_bucket_size",
4620
16
            FT_FLOAT, BASE_NONE, NULL, 0x00,
4621
16
            NULL, HFILL }
4622
16
        },
4623
16
        { &hf_cops_pc_bcid_id,
4624
16
          { "BCID - Element ID", "cops.pc_bcid.id",
4625
16
            FT_STRING, BASE_NONE, NULL, 0x00,
4626
16
            NULL, HFILL }
4627
16
        },
4628
16
        { &hf_cops_pc_bcid_tz,
4629
16
          { "BCID - Time Zone", "cops.pc_bcid.tz",
4630
16
            FT_STRING, BASE_NONE, NULL, 0x00,
4631
16
            NULL, HFILL }
4632
16
        },
4633
16
        { &hf_cops_pc_bcid_ts,
4634
16
          { "BDID Timestamp", "cops.pc_bcid_ts",
4635
16
            FT_UINT32, BASE_HEX, NULL, 0x00,
4636
16
            "BCID Timestamp", HFILL }
4637
16
        },
4638
16
        { &hf_cops_pc_bcid_ev,
4639
16
          { "BDID Event Counter", "cops.pc_bcid_ev",
4640
16
            FT_UINT32, BASE_DEC, NULL, 0x00,
4641
16
            "BCID Event Counter", HFILL }
4642
16
        },
4643
4644
16
        { &hf_cops_pcmm_amid_app_type,
4645
16
          { "AMID Application Type", "cops.pc_mm_amid_application_type",
4646
16
            FT_UINT32, BASE_DEC, NULL, 0,
4647
16
            "PacketCable Multimedia AMID Application Type", HFILL }
4648
16
        },
4649
16
        { &hf_cops_pcmm_amid_am_tag,
4650
16
          { "AMID Application Manager Tag", "cops.pc_mm_amid_am_tag",
4651
16
            FT_UINT32, BASE_DEC, NULL, 0,
4652
16
            "PacketCable Multimedia AMID Application Manager Tag", HFILL }
4653
16
        },
4654
4655
16
        { &hf_cops_pcmm_gate_spec_flags,
4656
16
          { "Flags", "cops.pc_mm_gs_flags",
4657
16
            FT_UINT8, BASE_HEX, NULL, 0,
4658
16
            "PacketCable Multimedia GateSpec Flags", HFILL }
4659
16
        },
4660
4661
16
        { &hf_cops_pcmm_gate_spec_flags_gate,
4662
16
          { "Gate", "cops.pc_mm_gs_flags.gate",
4663
16
            FT_BOOLEAN, 8, TFS(&tfs_upstream_downstream), 0x1,
4664
16
            NULL, HFILL }
4665
16
        },
4666
4667
16
        { &hf_cops_pcmm_gate_spec_flags_dscp_overwrite,
4668
16
          { "DSCP/TOS overwrite", "cops.pc_mm_gs_flags.dscp_overwrite",
4669
16
            FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x2,
4670
16
            NULL, HFILL }
4671
16
        },
4672
4673
16
        { &hf_cops_pcmm_gate_spec_dscp_tos_field,
4674
16
          { "DSCP/TOS Field",           "cops.pc_mm_gs_dscp",
4675
16
            FT_UINT8, BASE_HEX, NULL, 0,
4676
16
            "PacketCable Multimedia GateSpec DSCP/TOS Field", HFILL }
4677
16
        },
4678
16
        { &hf_cops_pcmm_gate_spec_dscp_tos_mask,
4679
16
          { "DSCP/TOS Mask",           "cops.pc_mm_gs_dscp_mask",
4680
16
            FT_UINT8, BASE_HEX, NULL, 0,
4681
16
            "PacketCable Multimedia GateSpec DSCP/TOS Mask", HFILL }
4682
16
        },
4683
16
        { &hf_cops_pcmm_gate_spec_session_class_id,
4684
16
          { "SessionClassID", "cops.pc_mm_gs_scid",
4685
16
            FT_UINT8, BASE_DEC, VALS(table_cops_session_class), 0,
4686
16
            "PacketCable Multimedia GateSpec SessionClassID", HFILL }
4687
16
        },
4688
16
        { &hf_cops_pcmm_gate_spec_session_class_id_priority,
4689
16
          { "SessionClassID Priority", "cops.pc_mm_gs_scid_prio",
4690
16
            FT_UINT8, BASE_DEC, NULL, 0x07,
4691
16
            "PacketCable Multimedia GateSpec SessionClassID Priority", HFILL }
4692
16
        },
4693
16
        { &hf_cops_pcmm_gate_spec_session_class_id_preemption,
4694
16
          { "SessionClassID Preemption", "cops.pc_mm_gs_scid_preempt",
4695
16
            FT_UINT8, BASE_DEC, NULL, 0x08,
4696
16
            "PacketCable Multimedia GateSpec SessionClassID Preemption", HFILL }
4697
16
        },
4698
16
        { &hf_cops_pcmm_gate_spec_session_class_id_configurable,
4699
16
          { "SessionClassID Configurable", "cops.pc_mm_gs_scid_conf",
4700
16
            FT_UINT8, BASE_DEC, NULL, 0xf0,
4701
16
            "PacketCable Multimedia GateSpec SessionClassID Configurable", HFILL }
4702
16
        },
4703
16
        { &hf_cops_pcmm_gate_spec_timer_t1,
4704
16
          { "Timer T1", "cops.pc_mm_gs_timer_t1",
4705
16
            FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_second_seconds), 0,
4706
16
            "PacketCable Multimedia GateSpec Timer T1", HFILL }
4707
16
        },
4708
16
        { &hf_cops_pcmm_gate_spec_timer_t2,
4709
16
          { "Timer T2", "cops.pc_mm_gs_timer_t2",
4710
16
            FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_second_seconds), 0,
4711
16
            "PacketCable Multimedia GateSpec Timer T2", HFILL }
4712
16
        },
4713
16
        { &hf_cops_pcmm_gate_spec_timer_t3,
4714
16
          { "Timer T3", "cops.pc_mm_gs_timer_t3",
4715
16
            FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_second_seconds), 0,
4716
16
            "PacketCable Multimedia GateSpec Timer T3", HFILL }
4717
16
        },
4718
16
        { &hf_cops_pcmm_gate_spec_timer_t4,
4719
16
          { "Timer T4", "cops.pc_mm_gs_timer_t4",
4720
16
            FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_second_seconds), 0,
4721
16
            "PacketCable Multimedia GateSpec Timer T4", HFILL }
4722
16
        },
4723
4724
16
        { &hf_cops_pcmm_classifier_protocol_id,
4725
16
          { "Protocol ID", "cops.pc_mm_classifier_proto_id",
4726
16
            FT_UINT16, BASE_DEC, NULL, 0,
4727
16
            "PacketCable Multimedia Classifier Protocol ID", HFILL }
4728
16
        },
4729
16
        { &hf_cops_pcmm_classifier_dscp_tos_field,
4730
16
          { "DSCP/TOS Field", "cops.pc_mm_classifier_dscp",
4731
16
            FT_UINT8, BASE_HEX, NULL, 0,
4732
16
            "PacketCable Multimedia Classifier DSCP/TOS Field", HFILL }
4733
16
        },
4734
16
        { &hf_cops_pcmm_classifier_dscp_tos_mask,
4735
16
          { "DSCP/TOS Mask", "cops.pc_mm_classifier_dscp_mask",
4736
16
            FT_UINT8, BASE_HEX, NULL, 0,
4737
16
            "PacketCable Multimedia Classifier DSCP/TOS Mask", HFILL }
4738
16
        },
4739
16
        { &hf_cops_pcmm_classifier_src_addr,
4740
16
          { "Source address", "cops.pc_mm_classifier_src_addr",
4741
16
            FT_IPv4, BASE_NONE, NULL, 0,
4742
16
            "PacketCable Multimedia Classifier Source IP Address", HFILL }
4743
16
        },
4744
16
        { &hf_cops_pcmm_classifier_src_mask,
4745
16
          { "Source mask", "cops.pc_mm_classifier_src_mask",
4746
16
            FT_IPv4, BASE_NONE, NULL, 0,
4747
16
            "PacketCable Multimedia Classifier Source Mask", HFILL }
4748
16
        },
4749
16
        { &hf_cops_pcmm_classifier_dst_addr,
4750
16
          { "Destination address", "cops.pc_mm_classifier_dst_addr",
4751
16
            FT_IPv4, BASE_NONE, NULL, 0,
4752
16
            "PacketCable Multimedia Classifier Destination IP Address", HFILL }
4753
16
        },
4754
16
        { &hf_cops_pcmm_classifier_dst_mask,
4755
16
          { "Destination mask", "cops.pc_mm_classifier_dst_mask",
4756
16
            FT_IPv4, BASE_NONE, NULL, 0,
4757
16
            "PacketCable Multimedia Classifier Destination Mask", HFILL }
4758
16
        },
4759
16
        { &hf_cops_pcmm_classifier_src_port,
4760
16
          { "Source Port", "cops.pc_mm_classifier_src_port",
4761
16
            FT_UINT16, BASE_DEC, NULL, 0,
4762
16
            "PacketCable Multimedia Classifier Source Port", HFILL }
4763
16
        },
4764
16
        { &hf_cops_pcmm_classifier_src_port_end,
4765
16
          { "Source Port End", "cops.pc_mm_classifier_src_port_end",
4766
16
            FT_UINT16, BASE_DEC, NULL, 0,
4767
16
            "PacketCable Multimedia Classifier Source Port End", HFILL }
4768
16
        },
4769
16
        { &hf_cops_pcmm_classifier_dst_port,
4770
16
          { "Destination Port", "cops.pc_mm_classifier_dst_port",
4771
16
            FT_UINT16, BASE_DEC, NULL, 0,
4772
16
            "PacketCable Multimedia Classifier Source Port", HFILL }
4773
16
        },
4774
16
        { &hf_cops_pcmm_classifier_dst_port_end,
4775
16
          { "Destination Port End", "cops.pc_mm_classifier_dst_port_end",
4776
16
            FT_UINT16, BASE_DEC, NULL, 0,
4777
16
            "PacketCable Multimedia Classifier Source Port End", HFILL }
4778
16
        },
4779
16
        { &hf_cops_pcmm_classifier_priority,
4780
16
          { "Priority", "cops.pc_mm_classifier_priority",
4781
16
            FT_UINT8, BASE_HEX, NULL, 0,
4782
16
            "PacketCable Multimedia Classifier Priority", HFILL }
4783
16
        },
4784
16
        { &hf_cops_pcmm_classifier_classifier_id,
4785
16
          { "Classifier Id", "cops.pc_mm_classifier_id",
4786
16
            FT_UINT16, BASE_HEX, NULL, 0,
4787
16
            "PacketCable Multimedia Classifier ID", HFILL }
4788
16
        },
4789
16
        { &hf_cops_pcmm_classifier_activation_state,
4790
16
          { "Activation State", "cops.pc_mm_classifier_activation_state",
4791
16
            FT_UINT8, BASE_HEX, VALS(pcmm_activation_state_vals), 0,
4792
16
            "PacketCable Multimedia Classifier Activation State", HFILL }
4793
16
        },
4794
16
        { &hf_cops_pcmm_classifier_action,
4795
16
          { "Action", "cops.pc_mm_classifier_action",
4796
16
            FT_UINT8, BASE_HEX, VALS(pcmm_action_vals), 0,
4797
16
            "PacketCable Multimedia Classifier Action", HFILL }
4798
16
        },
4799
16
        { &hf_cops_pcmm_classifier_flags,
4800
16
          { "Flags", "cops.pc_mm_classifier_flags",
4801
16
            FT_UINT8, BASE_HEX, NULL, 0,
4802
16
            "PacketCable Multimedia Classifier Flags", HFILL }
4803
16
        },
4804
16
        { &hf_cops_pcmm_classifier_tc_low,
4805
16
          { "tc-low", "cops.pc_mm_classifier_tc_low",
4806
16
            FT_UINT8, BASE_HEX, NULL, 0,
4807
16
            "PacketCable Multimedia Classifier tc-low", HFILL }
4808
16
        },
4809
16
        { &hf_cops_pcmm_classifier_tc_high,
4810
16
          { "tc-high", "cops.pc_mm_classifier_tc_high",
4811
16
            FT_UINT8, BASE_HEX, NULL, 0,
4812
16
            "PacketCable Multimedia Classifier tc-high", HFILL }
4813
16
        },
4814
16
        { &hf_cops_pcmm_classifier_tc_mask,
4815
16
          { "tc-mask", "cops.pc_mm_classifier_tc_mask",
4816
16
            FT_UINT8, BASE_HEX, NULL, 0,
4817
16
            "PacketCable Multimedia Classifier tc-mask", HFILL }
4818
16
        },
4819
16
        { &hf_cops_pcmm_classifier_flow_label,
4820
16
          { "Flow Label", "cops.pc_mm_classifier_flow_label",
4821
16
            FT_UINT32, BASE_HEX, NULL, 0,
4822
16
            "PacketCable Multimedia Classifier Flow Label", HFILL }
4823
16
        },
4824
16
        { &hf_cops_pcmm_classifier_next_header_type,
4825
16
          { "Next Header Type", "cops.pc_mm_classifier_next_header_type",
4826
16
            FT_UINT16, BASE_DEC, NULL, 0,
4827
16
            "PacketCable Multimedia Classifier Next Header Type", HFILL }
4828
16
        },
4829
16
        { &hf_cops_pcmm_classifier_source_prefix_length,
4830
16
          { "Source Prefix Length", "cops.pc_mm_classifier_source_prefix_length",
4831
16
            FT_UINT8, BASE_DEC, NULL, 0,
4832
16
            "PacketCable Multimedia Classifier Source Prefix Length", HFILL }
4833
16
        },
4834
16
        { &hf_cops_pcmm_classifier_destination_prefix_length,
4835
16
          { "Destination Prefix Length", "cops.pc_mm_classifier_destination_prefix_length",
4836
16
            FT_UINT8, BASE_DEC, NULL, 0,
4837
16
            "PacketCable Multimedia Classifier Destination Prefix Length", HFILL }
4838
16
        },
4839
16
        { &hf_cops_pcmm_classifier_src_addr_v6,
4840
16
          { "IPv6 Source Address", "cops.pc_mm_classifier_src_addr_v6",
4841
16
            FT_IPv6, BASE_NONE, NULL, 0,
4842
16
            "PacketCable Multimedia Classifier IPv6 Source Address", HFILL }
4843
16
        },
4844
16
        { &hf_cops_pcmm_classifier_dst_addr_v6,
4845
16
          { "IPv6 Destination Address", "cops.pc_mm_classifier_dst_addr_v6",
4846
16
            FT_IPv6, BASE_NONE, NULL, 0,
4847
16
            "PacketCable Multimedia Classifier IPv6 Destination Address", HFILL }
4848
16
        },
4849
4850
16
        { &hf_cops_pcmm_flow_spec_envelope,
4851
16
          { "Envelope", "cops.pc_mm_fs_envelope",
4852
16
            FT_UINT8, BASE_DEC, NULL, 0,
4853
16
            "PacketCable Multimedia Flow Spec Envelope", HFILL }
4854
16
        },
4855
16
        { &hf_cops_pcmm_flow_spec_service_number,
4856
16
          { "Service Number", "cops.pc_mm_fs_svc_num",
4857
16
            FT_UINT8, BASE_DEC, VALS(pcmm_flow_spec_service_vals), 0,
4858
16
            "PacketCable Multimedia Flow Spec Service Number", HFILL }
4859
16
        },
4860
4861
16
        { &hf_cops_pcmm_docsis_scn,
4862
16
          { "Service Class Name", "cops.pc_mm_docsis_scn",
4863
16
            FT_STRINGZ, BASE_NONE, NULL, 0,
4864
16
            "PacketCable Multimedia DOCSIS Service Class Name", HFILL }
4865
16
        },
4866
4867
16
        { &hf_cops_pcmm_envelope,
4868
16
          { "Envelope", "cops.pc_mm_envelope",
4869
16
            FT_UINT8, BASE_DEC, NULL, 0,
4870
16
            "PacketCable Multimedia Envelope", HFILL }
4871
16
        },
4872
4873
16
        { &hf_cops_pcmm_traffic_priority,
4874
16
          { "Traffic Priority", "cops.pc_mm_tp",
4875
16
            FT_UINT8, BASE_DEC, NULL, 0,
4876
16
            "PacketCable Multimedia Committed Envelope Traffic Priority", HFILL }
4877
16
        },
4878
16
        { &hf_cops_pcmm_request_transmission_policy,
4879
16
          { "Request Transmission Policy", "cops.pc_mm_rtp",
4880
16
            FT_UINT32, BASE_HEX, NULL, 0,
4881
16
            "PacketCable Multimedia Committed Envelope Traffic Priority", HFILL }
4882
16
        },
4883
16
        { &hf_cops_pcmm_request_transmission_policy_sf_all_cm,
4884
16
          { "The Service Flow MUST NOT use \"all CMs\" broadcast request opportunities", "cops.pc_mm_rtp.sf.all_cm",
4885
16
            FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
4886
16
            NULL, HFILL }
4887
16
        },
4888
16
        { &hf_cops_pcmm_request_transmission_policy_sf_priority,
4889
16
          { "The Service Flow MUST NOT use Priority Request multicast request opportunities", "cops.pc_mm_rtp.sf.priority",
4890
16
            FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
4891
16
            NULL, HFILL }
4892
16
        },
4893
16
        { &hf_cops_pcmm_request_transmission_policy_sf_request_for_request,
4894
16
          { "The Service Flow MUST NOT use Request/Data opportunities for Requests", "cops.pc_mm_rtp.sf.request_for_request",
4895
16
            FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000004,
4896
16
            NULL, HFILL }
4897
16
        },
4898
16
        { &hf_cops_pcmm_request_transmission_policy_sf_data_for_data,
4899
16
          { "The Service Flow MUST NOT use Request/Data opportunities for Data", "cops.pc_mm_rtp.sf.data_for_data",
4900
16
            FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000008,
4901
16
            NULL, HFILL }
4902
16
        },
4903
16
        { &hf_cops_pcmm_request_transmission_policy_sf_piggyback,
4904
16
          { "The Service Flow MUST NOT piggyback requests with data", "cops.pc_mm_rtp.sf.piggyback",
4905
16
            FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000010,
4906
16
            NULL, HFILL }
4907
16
        },
4908
16
        { &hf_cops_pcmm_request_transmission_policy_sf_concatenate,
4909
16
          { "The Service Flow MUST NOT concatenate data", "cops.pc_mm_rtp.sf.concatenate",
4910
16
            FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000020,
4911
16
            NULL, HFILL }
4912
16
        },
4913
16
        { &hf_cops_pcmm_request_transmission_policy_sf_fragment,
4914
16
          { "The Service Flow MUST NOT fragment data", "cops.pc_mm_rtp.sf.fragment",
4915
16
            FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000040,
4916
16
            NULL, HFILL }
4917
16
        },
4918
16
        { &hf_cops_pcmm_request_transmission_policy_sf_suppress,
4919
16
          { "The Service Flow MUST NOT suppress payload headers", "cops.pc_mm_rtp.sf.suppress",
4920
16
            FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000080,
4921
16
            NULL, HFILL }
4922
16
        },
4923
16
        { &hf_cops_pcmm_request_transmission_policy_sf_drop_packets,
4924
16
          { "The Service Flow MUST drop packets that do not fit in the Unsolicited Grant Size", "cops.pc_mm_rtp.sf.drop_packets",
4925
16
            FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000100,
4926
16
            NULL, HFILL }
4927
16
        },
4928
16
        { &hf_cops_pcmm_max_sustained_traffic_rate,
4929
16
          { "Maximum Sustained Traffic Rate", "cops.pc_mm_mstr",
4930
16
            FT_UINT32, BASE_DEC, NULL, 0,
4931
16
            "PacketCable Multimedia Committed Envelope Maximum Sustained Traffic Rate", HFILL }
4932
16
        },
4933
16
        { &hf_cops_pcmm_max_traffic_burst,
4934
16
          { "Maximum Traffic Burst", "cops.pc_mm_mtb",
4935
16
            FT_UINT32, BASE_DEC, NULL, 0,
4936
16
            "PacketCable Multimedia Committed Envelope Maximum Traffic Burst", HFILL }
4937
16
        },
4938
16
        { &hf_cops_pcmm_min_reserved_traffic_rate,
4939
16
          { "Minimum Reserved Traffic Rate", "cops.pc_mm_mrtr",
4940
16
            FT_UINT32, BASE_DEC, NULL, 0,
4941
16
            "PacketCable Multimedia Committed Envelope Minimum Reserved Traffic Rate", HFILL }
4942
16
        },
4943
16
        { &hf_cops_pcmm_ass_min_rtr_packet_size,
4944
16
          { "Assumed Minimum Reserved Traffic Rate Packet Size", "cops.pc_mm_amrtrps",
4945
16
            FT_UINT16, BASE_DEC, NULL, 0,
4946
16
            "PacketCable Multimedia Committed Envelope Assumed Minimum Reserved Traffic Rate Packet Size", HFILL }
4947
16
        },
4948
16
        { &hf_cops_pcmm_max_concat_burst,
4949
16
          { "Maximum Concatenated Burst", "cops.pc_mm_mcburst",
4950
16
            FT_UINT16, BASE_DEC, NULL, 0,
4951
16
            "PacketCable Multimedia Committed Envelope Maximum Concatenated Burst", HFILL }
4952
16
        },
4953
16
        { &hf_cops_pcmm_req_att_mask,
4954
16
          { "Required Attribute Mask", "cops.pc_mm_ramask",
4955
16
            FT_UINT32, BASE_HEX, NULL, 0,
4956
16
            "PacketCable Multimedia Committed Envelope Required Attribute Mask", HFILL }
4957
16
        },
4958
16
        { &hf_cops_pcmm_forbid_att_mask,
4959
16
          { "Forbidden Attribute Mask", "cops.pc_mm_famask",
4960
16
            FT_UINT32, BASE_HEX, NULL, 0,
4961
16
            "PacketCable Multimedia Committed Envelope Forbidden Attribute Mask", HFILL }
4962
16
        },
4963
16
        { &hf_cops_pcmm_att_aggr_rule_mask,
4964
16
          { "Attribute Aggregation Rule Mask", "cops.pc_mm_aarmask",
4965
16
            FT_UINT32, BASE_HEX, NULL, 0,
4966
16
            "PacketCable Multimedia Committed Envelope Attribute Aggregation Rule Mask", HFILL }
4967
16
        },
4968
4969
16
        { &hf_cops_pcmm_nominal_polling_interval,
4970
16
          { "Nominal Polling Interval", "cops.pc_mm_npi",
4971
16
            FT_UINT32, BASE_DEC, NULL, 0,
4972
16
            "PacketCable Multimedia Nominal Polling Interval", HFILL }
4973
16
        },
4974
4975
16
        { &hf_cops_pcmm_tolerated_poll_jitter,
4976
16
          { "Tolerated Poll Jitter", "cops.pc_mm_tpj",
4977
16
            FT_UINT32, BASE_DEC, NULL, 0,
4978
16
            "PacketCable Multimedia Tolerated Poll Jitter", HFILL }
4979
16
        },
4980
4981
16
        { &hf_cops_pcmm_unsolicited_grant_size,
4982
16
          { "Unsolicited Grant Size", "cops.pc_mm_ugs",
4983
16
            FT_UINT16, BASE_DEC, NULL, 0,
4984
16
            "PacketCable Multimedia Unsolicited Grant Size", HFILL }
4985
16
        },
4986
16
        { &hf_cops_pcmm_grants_per_interval,
4987
16
          { "Grants Per Interval", "cops.pc_mm_gpi",
4988
16
            FT_UINT8, BASE_DEC, NULL, 0,
4989
16
            "PacketCable Multimedia Grants Per Interval", HFILL }
4990
16
        },
4991
16
        { &hf_cops_pcmm_nominal_grant_interval,
4992
16
          { "Nominal Grant Interval", "cops.pc_mm_ngi",
4993
16
            FT_UINT32, BASE_DEC, NULL, 0,
4994
16
            "PacketCable Multimedia Nominal Grant Interval", HFILL }
4995
16
        },
4996
16
        { &hf_cops_pcmm_tolerated_grant_jitter,
4997
16
          { "Tolerated Grant Jitter", "cops.pc_mm_tgj",
4998
16
            FT_UINT32, BASE_DEC, NULL, 0,
4999
16
            "PacketCable Multimedia Tolerated Grant Jitter", HFILL }
5000
16
        },
5001
5002
16
        { &hf_cops_pcmm_down_resequencing,
5003
16
          { "Downstream Resequencing", "cops.pc_mm_downres",
5004
16
            FT_UINT32, BASE_DEC, NULL, 0,
5005
16
            "PacketCable Multimedia Downstream Resequencing", HFILL }
5006
16
        },
5007
5008
16
        { &hf_cops_pcmm_down_peak_traffic_rate,
5009
16
          { "Downstream Peak Traffic Rate", "cops.pc_mm_downpeak",
5010
16
            FT_UINT32, BASE_DEC, NULL, 0,
5011
16
            "PacketCable Multimedia Downstream Peak Traffic Rate", HFILL }
5012
16
        },
5013
5014
16
        { &hf_cops_pcmm_max_downstream_latency,
5015
16
          { "Maximum Downstream Latency", "cops.pc_mm_mdl",
5016
16
            FT_UINT32, BASE_DEC, NULL, 0,
5017
16
            "PacketCable Multimedia Maximum Downstream Latency", HFILL }
5018
16
        },
5019
5020
16
        { &hf_cops_pcmm_volume_based_usage_limit,
5021
16
          { "Usage Limit", "cops.pc_mm_vbul_ul",
5022
16
            FT_UINT64, BASE_DEC, NULL, 0,
5023
16
            "PacketCable Multimedia Volume-Based Usage Limit", HFILL }
5024
16
        },
5025
5026
16
        { &hf_cops_pcmm_time_based_usage_limit,
5027
16
          { "Usage Limit", "cops.pc_mm_tbul_ul",
5028
16
            FT_UINT32, BASE_DEC, NULL, 0,
5029
16
            "PacketCable Multimedia Time-Based Usage Limit", HFILL }
5030
16
        },
5031
5032
16
        { &hf_cops_pcmm_gate_time_info,
5033
16
          { "Gate Time Info", "cops.pc_mm_gti",
5034
16
            FT_UINT32, BASE_DEC, NULL, 0,
5035
16
            "PacketCable Multimedia Gate Time Info", HFILL }
5036
16
        },
5037
5038
16
        { &hf_cops_pcmm_gate_usage_info,
5039
16
          { "Gate Usage Info", "cops.pc_mm_gui",
5040
16
            FT_UINT64, BASE_DEC, NULL, 0,
5041
16
            "PacketCable Multimedia Gate Usage Info", HFILL }
5042
16
        },
5043
5044
16
        { &hf_cops_pcmm_packetcable_error_code,
5045
16
          { "Error Code", "cops.pc_mm_error_ec",
5046
16
            FT_UINT16, BASE_DEC, VALS(pcmm_packetcable_error_code), 0,
5047
16
            "PacketCable Multimedia PacketCable-Error Error-Code", HFILL }
5048
16
        },
5049
16
        { &hf_cops_pcmm_packetcable_error_subcode,
5050
16
          { "Error Subcode", "cops.pc_mm_error_esc",
5051
16
            FT_UINT16, BASE_HEX, NULL, 0,
5052
16
            "PacketCable Multimedia PacketCable-Error Error Sub-code", HFILL }
5053
16
        },
5054
5055
16
        { &hf_cops_pcmm_packetcable_gate_state,
5056
16
          { "State", "cops.pc_mm_gs_state",
5057
16
            FT_UINT16, BASE_DEC, VALS(pcmm_gate_state), 0,
5058
16
            "PacketCable Multimedia Gate State", HFILL }
5059
16
        },
5060
16
        { &hf_cops_pcmm_packetcable_gate_state_reason,
5061
16
          { "Reason", "cops.pc_mm_gs_reason",
5062
16
            FT_UINT16, BASE_DEC, VALS(pcmm_gate_state_reason), 0,
5063
16
            "PacketCable Multimedia Gate State Reason", HFILL }
5064
16
        },
5065
16
        { &hf_cops_pcmm_packetcable_version_info_major,
5066
16
          { "Major Version Number", "cops.pc_mm_vi_major",
5067
16
            FT_UINT16, BASE_DEC, NULL, 0,
5068
16
            "PacketCable Multimedia Major Version Number", HFILL }
5069
16
        },
5070
16
        { &hf_cops_pcmm_packetcable_version_info_minor,
5071
16
          { "Minor Version Number", "cops.pc_mm_vi_minor",
5072
16
            FT_UINT16, BASE_DEC, NULL, 0,
5073
16
            "PacketCable Multimedia Minor Version Number", HFILL }
5074
16
        },
5075
5076
16
        { &hf_cops_pcmm_psid,
5077
16
          { "PSID", "cops.pc_mm_psid",
5078
16
            FT_UINT32, BASE_DEC, NULL, 0,
5079
16
            "PacketCable Multimedia PSID", HFILL }
5080
16
        },
5081
5082
16
        { &hf_cops_pcmm_synch_options_report_type,
5083
16
          { "Report Type", "cops.pc_mm_synch_options_report_type",
5084
16
            FT_UINT8, BASE_DEC, VALS(pcmm_report_type_vals), 0,
5085
16
            "PacketCable Multimedia Synch Options Report Type", HFILL }
5086
16
        },
5087
16
        { &hf_cops_pcmm_synch_options_synch_type,
5088
16
          { "Synch Type", "cops.pc_mm_synch_options_synch_type",
5089
16
            FT_UINT8, BASE_DEC, VALS(pcmm_synch_type_vals), 0,
5090
16
            "PacketCable Multimedia Synch Options Synch Type", HFILL }
5091
16
        },
5092
5093
16
        { &hf_cops_pcmm_msg_receipt_key,
5094
16
          { "Msg Receipt Key", "cops.pc_mm_msg_receipt_key",
5095
16
            FT_UINT32, BASE_HEX, NULL, 0,
5096
16
            "PacketCable Multimedia Msg Receipt Key", HFILL }
5097
16
        },
5098
5099
16
        { &hf_cops_pcmm_userid,
5100
16
          { "UserID", "cops.pc_mm_userid",
5101
16
            FT_STRING, BASE_NONE, NULL, 0,
5102
16
            "PacketCable Multimedia UserID", HFILL }
5103
16
        },
5104
5105
16
        { &hf_cops_pcmm_sharedresourceid,
5106
16
          { "SharedResourceID", "cops.pc_mm_sharedresourceid",
5107
16
            FT_UINT32, BASE_HEX, NULL, 0,
5108
16
            "PacketCable Multimedia SharedResourceID", HFILL }
5109
16
        },
5110
5111
        /* End of addition for PacketCable */
5112
5113
16
    };
5114
5115
    /* Setup protocol subtree array */
5116
16
    static int* ett[] = {
5117
16
        &ett_cops,
5118
16
        &ett_cops_ver_flags,
5119
16
        &ett_cops_obj,
5120
16
        &ett_cops_pr_obj,
5121
16
        &ett_cops_obj_data,
5122
16
        &ett_cops_r_type_flags,
5123
16
        &ett_cops_itf,
5124
16
        &ett_cops_reason,
5125
16
        &ett_cops_decision,
5126
16
        &ett_cops_error,
5127
16
        &ett_cops_clientsi,
5128
16
        &ett_cops_asn1,
5129
16
        &ett_cops_gperror,
5130
16
        &ett_cops_cperror,
5131
16
        &ett_cops_pdp,
5132
16
        &ett_cops_subtree,
5133
16
        &ett_docsis_request_transmission_policy,
5134
16
        &ett_cops_pcmm_gate_spec_flags,
5135
16
        &ett_cops_pcmm_gate_spec_session_class_id,
5136
16
    };
5137
5138
16
    static ei_register_info ei[] = {
5139
16
        { &ei_cops_pepid_not_null, { "cops.pepid.not_null", PI_MALFORMED, PI_NOTE, "PEP Id is not a NULL terminated ASCII string", EXPFILL }},
5140
16
        { &ei_cops_trailing_garbage, { "cops.trailing_garbage", PI_UNDECODED, PI_NOTE, "Trailing garbage", EXPFILL }},
5141
16
        { &ei_cops_bad_cops_object_length, { "cops.bad_cops_object_length", PI_MALFORMED, PI_ERROR, "COPS object length is too short", EXPFILL }},
5142
16
        { &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 }},
5143
16
        { &ei_cops_unknown_c_num, { "cops.unknown_c_num", PI_UNDECODED, PI_NOTE, "Unknown C-Num value", EXPFILL }},
5144
#if 0
5145
        { &ei_cops_unknown_s_num, { "cops.unknown_s_num", PI_UNDECODED, PI_NOTE, "Unknown S-Num value", EXPFILL }},
5146
#endif
5147
16
    };
5148
5149
5150
16
    module_t* cops_module;
5151
16
    expert_module_t* expert_cops;
5152
5153
    /* Register the protocol name and description */
5154
16
    proto_cops = proto_register_protocol("Common Open Policy Service", "COPS", "cops");
5155
5156
    /* Required function calls to register the header fields and subtrees used */
5157
16
    proto_register_field_array(proto_cops, hf, array_length(hf));
5158
16
    proto_register_subtree_array(ett, array_length(ett));
5159
16
    expert_cops = expert_register_protocol(proto_cops);
5160
16
    expert_register_field_array(expert_cops, ei, array_length(ei));
5161
5162
    /* Make dissector findable by name */
5163
16
    cops_handle = register_dissector("cops", dissect_cops, proto_cops);
5164
5165
    /* Register our configuration options for cops */
5166
16
    cops_module = prefs_register_protocol(proto_cops, NULL);
5167
16
    prefs_register_bool_preference(cops_module, "desegment",
5168
16
        "Reassemble COPS messages spanning multiple TCP segments",
5169
16
        "Whether the COPS dissector should reassemble messages spanning multiple TCP segments."
5170
16
        " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
5171
16
        &cops_desegment);
5172
5173
    /* For PacketCable */
5174
16
    prefs_register_bool_preference(cops_module, "packetcable",
5175
16
        "Decode for PacketCable clients",
5176
16
        "Decode the COPS messages using PacketCable clients. (Select port 2126)",
5177
16
        &cops_packetcable);
5178
5179
16
    prefs_register_static_text_preference(cops_module, "info_pibs",
5180
16
        "PIB settings can be changed in the Name Resolution preferences",
5181
16
        "PIB settings can be changed in the Name Resolution preferences");
5182
5183
16
    prefs_register_obsolete_preference(cops_module, "typefrommib");
5184
16
}
5185
5186
void proto_reg_handoff_cops(void)
5187
16
{
5188
    /* These could use a separate "preference name" (to avoid collision),
5189
        but they are IANA registered and users could still use Decode As */
5190
16
    dissector_add_uint("tcp.port", TCP_PORT_PKTCABLE_COPS, cops_handle);
5191
16
    dissector_add_uint("tcp.port", TCP_PORT_PKTCABLE_MM_COPS, cops_handle);
5192
5193
16
    dissector_add_uint_with_preference("tcp.port", TCP_PORT_COPS, cops_handle);
5194
16
}
5195
5196
/*
5197
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
5198
 *
5199
 * Local variables:
5200
 * c-basic-offset: 4
5201
 * tab-width: 8
5202
 * indent-tabs-mode: nil
5203
 * End:
5204
 *
5205
 * vi: set shiftwidth=4 tabstop=8 expandtab:
5206
 * :indentSize=4:tabSize=8:noTabs=true:
5207
 */