~jelmer/wireshark/daily-ppa

« back to all changes in this revision

Viewing changes to epan/dissectors/packet-3g-a11.c

  • Committer: Bazaar Package Importer
  • Author(s): Balint Reczey
  • Date: 2010-11-20 18:41:41 UTC
  • mfrom: (1.1.28 upstream) (42.1.5 experimental)
  • Revision ID: james.westby@ubuntu.com-20101120184141-19e4sxq2kfsdnc9i
Tags: 1.4.2-1
* New upstream release 1.4.2
  - release notes:
    http://www.wireshark.org/docs/relnotes/wireshark-1.4.2.html
  - security fixes
     - Nephi Johnson of BreakingPoint discovered that the LDSS dissector
       could overflow a buffer. (No assigned CVE number.)
     - The ZigBee ZCL dissector could go into an infinite loop.
       (No assigned CVE number.)
* drop 05_fix-display-filter-update-when-changing-profile.patch
  patch since it has been integrated upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 * Routines for Mobile IP dissection
12
12
 * Copyright 2000, Stefan Raab <sraab@cisco.com>
13
13
 *
14
 
 * $Id: packet-3g-a11.c 27781 2009-03-18 20:41:45Z guy $
 
14
 * $Id: packet-3g-a11.c 32089 2010-03-03 13:52:17Z etxrab $
15
15
 *
16
16
 * Wireshark - Network traffic analyzer
17
17
 * By Gerald Combs <gerald@wireshark.org>
158
158
#define UDP_PORT_3GA11    699
159
159
 
160
160
typedef enum {
161
 
    REGISTRATION_REQUEST = 1,
162
 
    REGISTRATION_REPLY = 3,
163
 
    REGISTRATION_UPDATE = 20,
164
 
    REGISTRATION_ACK =21,
165
 
    SESSION_UPDATE = 22,
166
 
    SESSION_ACK = 23,
167
 
    CAPABILITIES_INFO = 24,
 
161
    REGISTRATION_REQUEST  = 1,
 
162
    REGISTRATION_REPLY    = 3,
 
163
    REGISTRATION_UPDATE   = 20,
 
164
    REGISTRATION_ACK      = 21,
 
165
    SESSION_UPDATE        = 22,
 
166
    SESSION_ACK           = 23,
 
167
    CAPABILITIES_INFO     = 24,
168
168
    CAPABILITIES_INFO_ACK = 25
169
169
} a11MessageTypes;
170
170
 
171
171
static const value_string a11_types[] = {
172
 
  {REGISTRATION_REQUEST, "Registration Request"},
173
 
  {REGISTRATION_REPLY,   "Registration Reply"},
174
 
  {REGISTRATION_UPDATE,   "Registration Update"},
175
 
  {REGISTRATION_ACK,   "Registration Ack"},
176
 
  {SESSION_UPDATE,   "Session Update"},
177
 
  {SESSION_ACK,   "Session Update Ack"},
178
 
  {CAPABILITIES_INFO,   "Capabilities Info"},
179
 
  {CAPABILITIES_INFO_ACK,   "Capabilities Info Ack"},
180
 
  {0, NULL},
 
172
    {REGISTRATION_REQUEST,  "Registration Request"},
 
173
    {REGISTRATION_REPLY,    "Registration Reply"},
 
174
    {REGISTRATION_UPDATE,   "Registration Update"},
 
175
    {REGISTRATION_ACK,      "Registration Ack"},
 
176
    {SESSION_UPDATE,        "Session Update"},
 
177
    {SESSION_ACK,           "Session Update Ack"},
 
178
    {CAPABILITIES_INFO,     "Capabilities Info"},
 
179
    {CAPABILITIES_INFO_ACK, "Capabilities Info Ack"},
 
180
    {0, NULL},
181
181
};
182
182
 
183
183
static const value_string a11_ses_ptype_vals[] = {
184
 
        {0x8881, "Unstructured Byte Stream"},
185
 
        {0x88D2, "3GPP2 Packet"},
186
 
        {0, NULL},
 
184
    {0x8881, "Unstructured Byte Stream"},
 
185
    {0x88D2, "3GPP2 Packet"},
 
186
    {0, NULL},
187
187
};
188
188
 
189
189
static const value_string a11_reply_codes[]= {
190
 
  {0, "Reg Accepted"},
191
 
  {9, "Connection Update"},
 
190
    {0,  "Reg Accepted"},
 
191
    {9,  "Connection Update"},
192
192
#if 0
193
 
  {1, "Reg Accepted, but Simultaneous Bindings Unsupported."},
194
 
  {64, "Reg Deny (FA)- Unspecified Reason"},
195
 
  {65, "Reg Deny (FA)- Administratively Prohibited"},
196
 
  {66, "Reg Deny (FA)- Insufficient Resources"},
197
 
  {67, "Reg Deny (FA)- MN failed Authentication"},
198
 
  {68, "Reg Deny (FA)- HA failed Authentication"},
199
 
  {69, "Reg Deny (FA)- Requested Lifetime too Long"},
200
 
  {70, "Reg Deny (FA)- Poorly Formed Request"},
201
 
  {71, "Reg Deny (FA)- Poorly Formed Reply"},
202
 
  {72, "Reg Deny (FA)- Requested Encapsulation Unavailable"},
203
 
  {73, "Reg Deny (FA)- VJ Compression Unavailable"},
204
 
  {74, "Reg Deny (FA)- Requested Reverse Tunnel Unavailable"},
205
 
  {75, "Reg Deny (FA)- Reverse Tunnel is Mandatory and 'T' Bit Not Set"},
206
 
  {76, "Reg Deny (FA)- Mobile Node Too Distant"},
207
 
  {79, "Reg Deny (FA)- Delivery Style Not Supported"},
208
 
  {80, "Reg Deny (FA)- Home Network Unreachable"},
209
 
  {81, "Reg Deny (FA)- HA Host Unreachable"},
210
 
  {82, "Reg Deny (FA)- HA Port Unreachable"},
211
 
  {88, "Reg Deny (FA)- HA Unreachable"},
212
 
  {96, "Reg Deny (FA)(NAI) - Non Zero Home Address Required"},
213
 
  {97, "Reg Deny (FA)(NAI) - Missing NAI"},
214
 
  {98, "Reg Deny (FA)(NAI) - Missing Home Agent"},
215
 
  {99, "Reg Deny (FA)(NAI) - Missing Home Address"},
 
193
    {1,  "Reg Accepted, but Simultaneous Bindings Unsupported."},
 
194
    {64, "Reg Deny (FA)- Unspecified Reason"},
 
195
    {65, "Reg Deny (FA)- Administratively Prohibited"},
 
196
    {66, "Reg Deny (FA)- Insufficient Resources"},
 
197
    {67, "Reg Deny (FA)- MN failed Authentication"},
 
198
    {68, "Reg Deny (FA)- HA failed Authentication"},
 
199
    {69, "Reg Deny (FA)- Requested Lifetime too Long"},
 
200
    {70, "Reg Deny (FA)- Poorly Formed Request"},
 
201
    {71, "Reg Deny (FA)- Poorly Formed Reply"},
 
202
    {72, "Reg Deny (FA)- Requested Encapsulation Unavailable"},
 
203
    {73, "Reg Deny (FA)- VJ Compression Unavailable"},
 
204
    {74, "Reg Deny (FA)- Requested Reverse Tunnel Unavailable"},
 
205
    {75, "Reg Deny (FA)- Reverse Tunnel is Mandatory and 'T' Bit Not Set"},
 
206
    {76, "Reg Deny (FA)- Mobile Node Too Distant"},
 
207
    {79, "Reg Deny (FA)- Delivery Style Not Supported"},
 
208
    {80, "Reg Deny (FA)- Home Network Unreachable"},
 
209
    {81, "Reg Deny (FA)- HA Host Unreachable"},
 
210
    {82, "Reg Deny (FA)- HA Port Unreachable"},
 
211
    {88, "Reg Deny (FA)- HA Unreachable"},
 
212
    {96, "Reg Deny (FA)(NAI) - Non Zero Home Address Required"},
 
213
    {97, "Reg Deny (FA)(NAI) - Missing NAI"},
 
214
    {98, "Reg Deny (FA)(NAI) - Missing Home Agent"},
 
215
    {99, "Reg Deny (FA)(NAI) - Missing Home Address"},
216
216
#endif
217
 
  {128, "Reg Deny (HA)- Unspecified"},
218
 
  {129, "Reg Deny (HA)- Administratively Prohibited"},
219
 
  {130, "Reg Deny (HA)- Insufficient Resources"},
220
 
  {131, "Reg Deny (HA)- PCF Failed Authentication"},
221
 
  /* {132, "Reg Deny (HA)- FA Failed Authentication"}, */
222
 
  {133, "Reg Deny (HA)- Identification Mismatch"},
223
 
  {134, "Reg Deny (HA)- Poorly Formed Request"},
224
 
  /* {135, "Reg Deny (HA)- Too Many Simultaneous Bindings"}, */
225
 
  {136, "Reg Deny (HA)- Unknown PDSN Address"},
226
 
  {137, "Reg Deny (HA)- Requested Reverse Tunnel Unavailable"},
227
 
  {138, "Reg Deny (HA)- Reverse Tunnel is Mandatory and 'T' Bit Not Set"},
228
 
  {139, "Reg Deny (HA)- Requested Encapsulation Unavailable"},
229
 
  {140, "Registration Denied - no CID available"},
230
 
  {141, "Reg Deny (HA)- unsupported Vendor ID / Application Type in CVSE"},
231
 
  {142, "Registration Denied - nonexistent A10 or IP flow"},
232
 
  {0, NULL},
 
217
    {128, "Reg Deny (HA)- Unspecified"},
 
218
    {129, "Reg Deny (HA)- Administratively Prohibited"},
 
219
    {130, "Reg Deny (HA)- Insufficient Resources"},
 
220
    {131, "Reg Deny (HA)- PCF Failed Authentication"},
 
221
    /* {132, "Reg Deny (HA)- FA Failed Authentication"}, */
 
222
    {133, "Reg Deny (HA)- Identification Mismatch"},
 
223
    {134, "Reg Deny (HA)- Poorly Formed Request"},
 
224
    /* {135, "Reg Deny (HA)- Too Many Simultaneous Bindings"}, */
 
225
    {136, "Reg Deny (HA)- Unknown PDSN Address"},
 
226
    {137, "Reg Deny (HA)- Requested Reverse Tunnel Unavailable"},
 
227
    {138, "Reg Deny (HA)- Reverse Tunnel is Mandatory and 'T' Bit Not Set"},
 
228
    {139, "Reg Deny (HA)- Requested Encapsulation Unavailable"},
 
229
    {140, "Registration Denied - no CID available"},
 
230
    {141, "Reg Deny (HA)- unsupported Vendor ID / Application Type in CVSE"},
 
231
    {142, "Registration Denied - nonexistent A10 or IP flow"},
 
232
    {0, NULL},
233
233
};
234
234
 
235
235
 
236
236
static const value_string a11_ack_status[]= {
237
 
  {0, "Update Accepted"},
238
 
  {1, "Partial QoS updated"},
239
 
  {128, "Update Deny - Unspecified"},
240
 
  {131, "Update Deny - Sending Node Failed Authentication"},
241
 
  {133, "Update Deny - Registration ID Mismatch"},
242
 
  {134, "Update Deny - Poorly Formed Request"},
243
 
  {193, "Update Deny - Session Parameter Not Updated"},
244
 
  {253, "Update Denied - QoS profileID not supported"},
245
 
  {254, "Update Denied - insufficient resources"},
246
 
  {255, "Update Denied - handoff in progress"},
247
 
  {0, NULL},
 
237
    {0, "Update Accepted"},
 
238
    {1, "Partial QoS updated"},
 
239
    {128, "Update Deny - Unspecified"},
 
240
    {131, "Update Deny - Sending Node Failed Authentication"},
 
241
    {133, "Update Deny - Registration ID Mismatch"},
 
242
    {134, "Update Deny - Poorly Formed Request"},
 
243
    {193, "Update Deny - Session Parameter Not Updated"},
 
244
    {253, "Update Denied - QoS profileID not supported"},
 
245
    {254, "Update Denied - insufficient resources"},
 
246
    {255, "Update Denied - handoff in progress"},
 
247
    {0, NULL},
248
248
};
249
249
 
250
250
typedef enum {
251
 
  MH_AUTH_EXT = 32,
252
 
  MF_AUTH_EXT = 33,
253
 
  FH_AUTH_EXT = 34,
254
 
  GEN_AUTH_EXT = 36,      /* RFC 3012 */
255
 
  OLD_CVSE_EXT = 37,      /* RFC 3115 */
256
 
  CVSE_EXT = 38,          /* RFC 3115 */
257
 
  SS_EXT = 39,            /* 3GPP2 IOS4.2 */
258
 
  RU_AUTH_EXT = 40,       /* 3GPP2 IOS4.2 */
259
 
  MN_NAI_EXT = 131,
260
 
  MF_CHALLENGE_EXT = 132, /* RFC 3012 */
261
 
  OLD_NVSE_EXT = 133,     /* RFC 3115 */
262
 
  NVSE_EXT = 134          /* RFC 3115 */
 
251
    MH_AUTH_EXT      = 32,
 
252
    MF_AUTH_EXT      = 33,
 
253
    FH_AUTH_EXT      = 34,
 
254
    GEN_AUTH_EXT     = 36,  /* RFC 3012 */
 
255
    OLD_CVSE_EXT     = 37,  /* RFC 3115 */
 
256
    CVSE_EXT         = 38,  /* RFC 3115 */
 
257
    SS_EXT           = 39,  /* 3GPP2 IOS4.2 */
 
258
    RU_AUTH_EXT      = 40,  /* 3GPP2 IOS4.2 */
 
259
    MN_NAI_EXT       = 131,
 
260
    MF_CHALLENGE_EXT = 132, /* RFC 3012 */
 
261
    OLD_NVSE_EXT     = 133, /* RFC 3115 */
 
262
    NVSE_EXT         = 134  /* RFC 3115 */
263
263
} MIP_EXTS;
264
264
 
265
265
 
266
266
static const value_string a11_ext_types[]= {
267
 
  {MH_AUTH_EXT, "Mobile-Home Authentication Extension"},
268
 
  {MF_AUTH_EXT, "Mobile-Foreign Authentication Extension"},
269
 
  {FH_AUTH_EXT, "Foreign-Home Authentication Extension"},
270
 
  {MN_NAI_EXT,  "Mobile Node NAI Extension"},
271
 
  {GEN_AUTH_EXT, "Generalized Mobile-IP Authentication Extension"},
272
 
  {MF_CHALLENGE_EXT, "MN-FA Challenge Extension"},
273
 
  {CVSE_EXT, "Critical Vendor/Organization Specific Extension"},
274
 
  {SS_EXT, "Session Specific Extension"},
275
 
  {RU_AUTH_EXT, "Registration Update Authentication Extension"},
276
 
  {OLD_CVSE_EXT, "Critical Vendor/Organization Specific Extension (OLD)"},
277
 
  {NVSE_EXT, "Normal Vendor/Organization Specific Extension"},
278
 
  {OLD_NVSE_EXT, "Normal Vendor/Organization Specific Extension (OLD)"},
279
 
  {0, NULL},
 
267
    {MH_AUTH_EXT,      "Mobile-Home Authentication Extension"},
 
268
    {MF_AUTH_EXT,      "Mobile-Foreign Authentication Extension"},
 
269
    {FH_AUTH_EXT,      "Foreign-Home Authentication Extension"},
 
270
    {MN_NAI_EXT,       "Mobile Node NAI Extension"},
 
271
    {GEN_AUTH_EXT,     "Generalized Mobile-IP Authentication Extension"},
 
272
    {MF_CHALLENGE_EXT, "MN-FA Challenge Extension"},
 
273
    {CVSE_EXT,         "Critical Vendor/Organization Specific Extension"},
 
274
    {SS_EXT,           "Session Specific Extension"},
 
275
    {RU_AUTH_EXT,      "Registration Update Authentication Extension"},
 
276
    {OLD_CVSE_EXT,     "Critical Vendor/Organization Specific Extension (OLD)"},
 
277
    {NVSE_EXT,         "Normal Vendor/Organization Specific Extension"},
 
278
    {OLD_NVSE_EXT,     "Normal Vendor/Organization Specific Extension (OLD)"},
 
279
    {0, NULL},
280
280
};
281
281
 
282
282
static const value_string a11_ext_stypes[]= {
283
 
  {1, "MN AAA Extension"},
284
 
  {0, NULL},
 
283
    {1, "MN AAA Extension"},
 
284
    {0, NULL},
285
285
};
286
286
 
287
287
static const value_string a11_ext_nvose_qosmode[]= {
288
 
  {0x00, "QoS Disabled"},
289
 
  {0x01, "QoS Enabled"},
290
 
  {0, NULL},
 
288
    {0x00, "QoS Disabled"},
 
289
    {0x01, "QoS Enabled"},
 
290
    {0, NULL},
291
291
};
292
292
 
293
293
static const value_string a11_ext_nvose_srvopt[]= {
294
 
  {0x0021, "3G High Speed Packet Data"},
295
 
  {0x003B, "HRPD Main Service Connection"},
296
 
  {0x003C, "Link Layer Assisted Header Removal"},
297
 
  {0x003D, "Link Layer Assisted Robust Header Compression"},
298
 
  {0x0040, "HRPD Auxiliary Service Connection"},
299
 
  {0, NULL},
 
294
    {0x0021, "3G High Speed Packet Data"},
 
295
    {0x003B, "HRPD Main Service Connection"},
 
296
    {0x003C, "Link Layer Assisted Header Removal"},
 
297
    {0x003D, "Link Layer Assisted Robust Header Compression"},
 
298
    {0x0040, "HRPD Auxiliary Service Connection"},
 
299
    {0, NULL},
300
300
};
301
301
 
302
302
static const value_string a11_ext_nvose_pdsn_code[]= {
303
 
  {0xc1, "Connection Release - reason unspecified"},
304
 
  {0xc2, "Connection Release - PPP time-out"},
305
 
  {0xc3, "Connection Release - registration time-out"},
306
 
  {0xc4, "Connection Release - PDSN error"},
307
 
  {0xc5, "Connection Release - inter-PCF handoff"},
308
 
  {0xc6, "Connection Release - inter-PDSN handoff"},
309
 
  {0xc7, "Connection Release - PDSN OAM&P intervention"},
310
 
  {0xc8, "Connection Release - accounting error"},
311
 
  {0xca, "Connection Release - user (NAI) failed authentication"},
312
 
  {0x00, NULL},
 
303
    {0xc1, "Connection Release - reason unspecified"},
 
304
    {0xc2, "Connection Release - PPP time-out"},
 
305
    {0xc3, "Connection Release - registration time-out"},
 
306
    {0xc4, "Connection Release - PDSN error"},
 
307
    {0xc5, "Connection Release - inter-PCF handoff"},
 
308
    {0xc6, "Connection Release - inter-PDSN handoff"},
 
309
    {0xc7, "Connection Release - PDSN OAM&P intervention"},
 
310
    {0xc8, "Connection Release - accounting error"},
 
311
    {0xca, "Connection Release - user (NAI) failed authentication"},
 
312
    {0x00, NULL},
313
313
};
314
314
 
315
315
static const value_string a11_ext_dormant[]= {
316
 
  {0x0000, "all MS packet data service instances are dormant"},
317
 
  {0, NULL},
 
316
    {0x0000, "all MS packet data service instances are dormant"},
 
317
    {0, NULL},
318
318
};
319
319
 
320
320
static const value_string a11_ext_app[]= {
321
 
  {0x0101, "Accounting (RADIUS)"},
322
 
  {0x0102, "Accounting (DIAMETER)"},
323
 
  {0x0201, "Mobility Event Indicator (Mobility)"},
324
 
  {0x0301, "Data Available Indicator (Data Ready to Send)"},
325
 
  {0x0401, "Access Network Identifiers (ANID)"},
326
 
  {0x0501, "PDSN Identifiers (Anchor P-P Address)"},
327
 
  {0x0601, "Indicators (All Dormant Indicator)"},
328
 
  {0x0701, "PDSN Code (PDSN Code)"},
329
 
  {0x0801, "Session Parameter (RN-PDIT:Radio Network Packet Data Inactivity Timer)"},
330
 
  {0x0802, "Session Parameter (Always On)"},
331
 
  {0x0803, "Session Parameter (QoS Mode)"},
332
 
  {0x0901, "Service Option (Service Option Value)"},
333
 
  {0x0A01, "PDSN Enabled Features (Flow Control Enabled)"},
334
 
  {0x0A02, "PDSN Enabled Features (Packet Boundary Enabled)"},
335
 
  {0x0A03, "PDSN Enabled Features (GRE Segmentation Enabled)"},
336
 
  {0x0B01, "PCF Enabled Features (Short Data Indication Supported)"},
337
 
  {0x0B02, "PCF Enabled Features (GRE Segmentation Enabled)"},
338
 
  {0x0C01, "Additional Session Info"},
339
 
  {0x0D01, "QoS Information (Forward QoS Information)"},
340
 
  {0x0D02, "QoS Information (Reverse QoS Information)"},
341
 
  {0x0D03, "QoS Information (Subscriber QoS Profile)"},
342
 
  {0x0DFE, "QoS Information (Forward QoS Update Information)"},
343
 
  {0x0DFF, "QoS Information (Reverse QoS Update Information)"},
344
 
  {0x0E01, "Header Compression (ROHC Configuration Parameters)"},
345
 
  {0, NULL},
 
321
    {0x0101, "Accounting (RADIUS)"},
 
322
    {0x0102, "Accounting (DIAMETER)"},
 
323
    {0x0201, "Mobility Event Indicator (Mobility)"},
 
324
    {0x0301, "Data Available Indicator (Data Ready to Send)"},
 
325
    {0x0401, "Access Network Identifiers (ANID)"},
 
326
    {0x0501, "PDSN Identifiers (Anchor P-P Address)"},
 
327
    {0x0601, "Indicators (All Dormant Indicator)"},
 
328
    {0x0701, "PDSN Code (PDSN Code)"},
 
329
    {0x0801, "Session Parameter (RN-PDIT:Radio Network Packet Data Inactivity Timer)"},
 
330
    {0x0802, "Session Parameter (Always On)"},
 
331
    {0x0803, "Session Parameter (QoS Mode)"},
 
332
    {0x0901, "Service Option (Service Option Value)"},
 
333
    {0x0A01, "PDSN Enabled Features (Flow Control Enabled)"},
 
334
    {0x0A02, "PDSN Enabled Features (Packet Boundary Enabled)"},
 
335
    {0x0A03, "PDSN Enabled Features (GRE Segmentation Enabled)"},
 
336
    {0x0B01, "PCF Enabled Features (Short Data Indication Supported)"},
 
337
    {0x0B02, "PCF Enabled Features (GRE Segmentation Enabled)"},
 
338
    {0x0C01, "Additional Session Info"},
 
339
    {0x0D01, "QoS Information (Forward QoS Information)"},
 
340
    {0x0D02, "QoS Information (Reverse QoS Information)"},
 
341
    {0x0D03, "QoS Information (Subscriber QoS Profile)"},
 
342
    {0x0DFE, "QoS Information (Forward QoS Update Information)"},
 
343
    {0x0DFF, "QoS Information (Reverse QoS Update Information)"},
 
344
    {0x0E01, "Header Compression (ROHC Configuration Parameters)"},
 
345
    {0, NULL},
346
346
};
347
347
 
348
348
static const value_string a11_airlink_types[]= {
349
 
  {1, "Session Setup (Y=1)"},
350
 
  {2, "Active Start (Y=2)"},
351
 
  {3, "Active Stop (Y=3)"},
352
 
  {4, "Short Data Burst (Y=4)"},
353
 
  {0, NULL},
 
349
    {1, "Session Setup (Y=1)"},
 
350
    {2, "Active Start (Y=2)"},
 
351
    {3, "Active Stop (Y=3)"},
 
352
    {4, "Short Data Burst (Y=4)"},
 
353
    {0, NULL},
354
354
};
355
355
 
356
356
#define ATTRIBUTE_NAME_LEN_MAX 128
365
365
 
366
366
 
367
367
struct radius_attribute {
368
 
  char attrname[ATTRIBUTE_NAME_LEN_MAX];
369
 
  int type;
370
 
  int subtype;
371
 
  int bytes;
372
 
  int data_type;
 
368
    char attrname[ATTRIBUTE_NAME_LEN_MAX];
 
369
    int type;
 
370
    int subtype;
 
371
    int bytes;
 
372
    int data_type;
373
373
};
374
374
 
375
375
static const struct radius_attribute attrs[]={
376
 
  {"Airlink Record",          26, 40,  4, ATTR_TYPE_TYPE},
377
 
  {"R-P Session ID",          26, 41,  4, ATTR_TYPE_INT},
378
 
  {"Airlink Sequence Number", 26, 42,  4, ATTR_TYPE_INT},
 
376
    {"Airlink Record",          26, 40,  4, ATTR_TYPE_TYPE},
 
377
    {"R-P Session ID",          26, 41,  4, ATTR_TYPE_INT},
 
378
    {"Airlink Sequence Number", 26, 42,  4, ATTR_TYPE_INT},
379
379
#if 0
380
 
  {"MSID",                    31, -1, 15, ATTR_TYPE_MSID},
 
380
    {"MSID",                    31, -1, 15, ATTR_TYPE_MSID},
381
381
#endif
382
 
  {"Serving PCF",             26,  9,  4, ATTR_TYPE_IPV4},
383
 
  {"BSID",                    26, 10, 12, ATTR_TYPE_STR},
384
 
  {"ESN",                     26, 52, 15, ATTR_TYPE_STR},
385
 
  {"User Zone",               26, 11,  4, ATTR_TYPE_INT},
386
 
  {"Forward FCH Mux Option",  26, 12,  4, ATTR_TYPE_INT},
387
 
  {"Reverse FCH Mux Option",  26, 13,  4, ATTR_TYPE_INT},
388
 
  {"Forward Fundamental Rate (IOS 4.1)",26, 14,  4, ATTR_TYPE_INT},
389
 
  {"Reverse Fundamental Rate (IOS 4.1)",26, 15,  4, ATTR_TYPE_INT},
390
 
  {"Service Option",          26, 16,  4, ATTR_TYPE_INT},
391
 
  {"Forward Traffic Type",    26, 17,  4, ATTR_TYPE_INT},
392
 
  {"Reverse Traffic Type",    26, 18,  4, ATTR_TYPE_INT},
393
 
  {"FCH Frame Size",          26, 19,  4, ATTR_TYPE_INT},
394
 
  {"Forward FCH RC",          26, 20,  4, ATTR_TYPE_INT},
395
 
  {"Reverse FCH RC",          26, 21,  4, ATTR_TYPE_INT},
396
 
  {"DCCH Frame Size 0/5/20",  26, 50,  4, ATTR_TYPE_INT},
397
 
  {"Forward DCCH Mux Option", 26, 84,  4, ATTR_TYPE_INT},
398
 
  {"Reverse DCCH Mux Option", 26, 85,  4, ATTR_TYPE_INT},
399
 
  {"Forward DCCH RC",         26, 86,  4, ATTR_TYPE_INT},
400
 
  {"Reverse DCCH RC",         26, 87,  4, ATTR_TYPE_INT},
401
 
  {"Airlink Priority",        26, 39,  4, ATTR_TYPE_INT},
402
 
  {"Active Connection Time",  26, 49,  4, ATTR_TYPE_INT},
403
 
  {"Mobile Orig/Term Ind.",   26, 45,  4, ATTR_TYPE_INT},
404
 
  {"SDB Octet Count (Term.)", 26, 31,  4, ATTR_TYPE_INT},
405
 
  {"SDB Octet Count (Orig.)", 26, 32,  4, ATTR_TYPE_INT},
406
 
  {"ESN (Integer)",           26, 48,  4, ATTR_TYPE_INT},
407
 
  {"Sublink",                 26, 108,  4, ATTR_TYPE_STR},
408
 
  {"MEID",                    26, 116, 14, ATTR_TYPE_STR},
409
 
  {"Reverse PDCH RC",         26, 114,  2, ATTR_TYPE_INT},
410
 
  {"Flow ID Parameter",       26, 144,  4, ATTR_TYPE_INT},
411
 
  {"Granted QoS Parameters",  26, 132,  4, ATTR_TYPE_INT},
412
 
  {"Flow Status",             26, 145,  4, ATTR_TYPE_INT},
413
 
  {"Unknown",                 -1, -1, -1, ATTR_TYPE_NULL},
 
382
    {"Serving PCF",             26,  9,  4, ATTR_TYPE_IPV4},
 
383
    {"BSID",                    26, 10, 12, ATTR_TYPE_STR},
 
384
    {"ESN",                     26, 52, 15, ATTR_TYPE_STR},
 
385
    {"User Zone",               26, 11,  4, ATTR_TYPE_INT},
 
386
    {"Forward FCH Mux Option",  26, 12,  4, ATTR_TYPE_INT},
 
387
    {"Reverse FCH Mux Option",  26, 13,  4, ATTR_TYPE_INT},
 
388
    {"Forward Fundamental Rate (IOS 4.1)",26, 14,  4, ATTR_TYPE_INT},
 
389
    {"Reverse Fundamental Rate (IOS 4.1)",26, 15,  4, ATTR_TYPE_INT},
 
390
    {"Service Option",          26, 16,  4, ATTR_TYPE_INT},
 
391
    {"Forward Traffic Type",    26, 17,  4, ATTR_TYPE_INT},
 
392
    {"Reverse Traffic Type",    26, 18,  4, ATTR_TYPE_INT},
 
393
    {"FCH Frame Size",          26, 19,  4, ATTR_TYPE_INT},
 
394
    {"Forward FCH RC",          26, 20,  4, ATTR_TYPE_INT},
 
395
    {"Reverse FCH RC",          26, 21,  4, ATTR_TYPE_INT},
 
396
    {"DCCH Frame Size 0/5/20",  26, 50,  4, ATTR_TYPE_INT},
 
397
    {"Forward DCCH Mux Option", 26, 84,  4, ATTR_TYPE_INT},
 
398
    {"Reverse DCCH Mux Option", 26, 85,  4, ATTR_TYPE_INT},
 
399
    {"Forward DCCH RC",         26, 86,  4, ATTR_TYPE_INT},
 
400
    {"Reverse DCCH RC",         26, 87,  4, ATTR_TYPE_INT},
 
401
    {"Airlink Priority",        26, 39,  4, ATTR_TYPE_INT},
 
402
    {"Active Connection Time",  26, 49,  4, ATTR_TYPE_INT},
 
403
    {"Mobile Orig/Term Ind.",   26, 45,  4, ATTR_TYPE_INT},
 
404
    {"SDB Octet Count (Term.)", 26, 31,  4, ATTR_TYPE_INT},
 
405
    {"SDB Octet Count (Orig.)", 26, 32,  4, ATTR_TYPE_INT},
 
406
    {"ESN (Integer)",           26, 48,  4, ATTR_TYPE_INT},
 
407
    {"Sublink",                 26, 108,  4, ATTR_TYPE_STR},
 
408
    {"MEID",                    26, 116, 14, ATTR_TYPE_STR},
 
409
    {"Reverse PDCH RC",         26, 114,  2, ATTR_TYPE_INT},
 
410
    {"Flow ID Parameter",       26, 144,  4, ATTR_TYPE_INT},
 
411
    {"Granted QoS Parameters",  26, 132,  4, ATTR_TYPE_INT},
 
412
    {"Flow Status",             26, 145,  4, ATTR_TYPE_INT},
 
413
    {"Unknown",                 -1, -1, -1, ATTR_TYPE_NULL},
414
414
};
415
415
#define NUM_ATTR (sizeof(attrs)/sizeof(struct radius_attribute))
416
416
 
420
420
/* decode MSID from SSE */
421
421
 
422
422
/* MSID is encoded in Binary Coded Decimal format
423
 
   Fisrt Byte: [odd-indicator] [Digit 1]
424
 
   Seond Byte: [Digit 3] [Digit 2]
 
423
   First  Byte: [odd-indicator] [Digit 1]
 
424
   Second Byte: [Digit 3] [Digit 2]
425
425
   ..
426
426
   if[odd]
427
427
   Last Byte: [Digit N] [Digit N-1]
431
431
static void
432
432
decode_sse(proto_tree* ext_tree, tvbuff_t* tvb, int offset, guint ext_len)
433
433
{
434
 
    guint8 msid_len =  0;
435
 
    guint8 msid_start_offset =  0;
436
 
    guint8 msid_num_digits = 0;
437
 
    guint8 msid_index = 0;
 
434
    guint8 msid_len;
 
435
    guint8 msid_start_offset;
 
436
    guint8 msid_num_digits;
 
437
    guint8 msid_index;
438
438
    char  *msid_digits;
439
439
    const char* p_msid;
440
 
    gboolean odd_even_ind = 0;
 
440
    gboolean odd_even_ind;
441
441
 
442
442
    /* Decode Protocol Type */
 
443
    if (ext_len < 2)
 
444
    {
 
445
        proto_tree_add_text(ext_tree, tvb, offset, 0,
 
446
                    "Cannot decode Protocol Type - SSE too short");
 
447
        return;
 
448
    }
443
449
    proto_tree_add_item(ext_tree, hf_a11_ses_ptype, tvb, offset, 2, FALSE);
444
450
    offset += 2;
445
451
    ext_len -= 2;
517
523
    if(msid_len > A11_MSG_MSID_ELEM_LEN_MAX)
518
524
    {
519
525
        p_msid = "MSID is too long";
520
 
    }else if(msid_len < 1)
 
526
    }else if(msid_len == 0)
521
527
    {
522
528
        p_msid = "MSID is too short";
523
529
    }else
524
530
    {
525
 
       /* Decode the BCD digits */
526
 
       for(msid_index=0; msid_index<msid_len; msid_index++)
527
 
       {
528
 
           guint8 msid_digit = tvb_get_guint8(tvb, offset);
529
 
           offset += 1;
530
 
           ext_len -= 1;
531
 
 
532
 
           msid_digits[msid_index*2] = (msid_digit & 0x0F) + '0';
533
 
           msid_digits[(msid_index*2) + 1] = ((msid_digit & 0xF0) >> 4) + '0';
534
 
       }
535
 
 
536
 
       odd_even_ind = (msid_digits[0] == '1');
537
 
       msid_num_digits = 0;
538
 
 
539
 
       if(odd_even_ind)
540
 
       {
541
 
           msid_num_digits = ((msid_len-1) * 2) + 1;
542
 
       }else
543
 
       {
544
 
           msid_num_digits = (msid_len-1) * 2;
545
 
       }
546
 
 
547
 
       msid_digits[msid_num_digits + 1] = '\0';
548
 
       p_msid = msid_digits + 1;
 
531
        /* Decode the BCD digits */
 
532
        for(msid_index=0; msid_index<msid_len; msid_index++)
 
533
        {
 
534
            guint8 msid_digit = tvb_get_guint8(tvb, offset);
 
535
            offset += 1;
 
536
            ext_len -= 1;
 
537
 
 
538
            msid_digits[msid_index*2] = (msid_digit & 0x0F) + '0';
 
539
            msid_digits[(msid_index*2) + 1] = ((msid_digit & 0xF0) >> 4) + '0';
 
540
        }
 
541
 
 
542
        odd_even_ind = (msid_digits[0] == '1');
 
543
 
 
544
        if(odd_even_ind)
 
545
        {
 
546
            msid_num_digits = ((msid_len-1) * 2) + 1;
 
547
        }else
 
548
        {
 
549
            msid_num_digits = (msid_len-1) * 2;
 
550
        }
 
551
 
 
552
        msid_digits[msid_num_digits + 1] = '\0';
 
553
        p_msid = msid_digits + 1;
549
554
    }
550
555
 
551
556
 
552
557
    proto_tree_add_string
553
 
      (ext_tree, hf_a11_ses_msid, tvb, msid_start_offset, msid_len, p_msid);
 
558
        (ext_tree, hf_a11_ses_msid, tvb, msid_start_offset, msid_len, p_msid);
554
559
 
555
560
    return;
556
561
}
559
564
static void
560
565
dissect_a11_radius( tvbuff_t *tvb, int offset, proto_tree *tree, int app_len)
561
566
{
562
 
  proto_item *ti;
563
 
  proto_tree *radius_tree=NULL;
564
 
  guint      radius_len;
565
 
  guint8     radius_type;
566
 
  guint8     radius_subtype;
567
 
  int        attribute_type;
568
 
  guint      attribute_len;
569
 
  guint      offset0;
570
 
  guint      radius_offset;
571
 
  guint      i;
572
 
  guint8     *str_val;
573
 
  guint      radius_vendor_id = 0;
574
 
 
575
 
  /* None of this really matters if we don't have a tree */
576
 
  if (!tree) return;
577
 
 
578
 
  offset0 = offset;
579
 
 
580
 
  /* return if length of extension is not valid */
581
 
  if (tvb_reported_length_remaining(tvb, offset)  < 12) {
582
 
    return;
583
 
  }
584
 
 
585
 
  ti = proto_tree_add_text(tree, tvb, offset - 2, app_len, "Airlink Record");
586
 
 
587
 
  radius_tree = proto_item_add_subtree(ti, ett_a11_radiuses);
588
 
 
589
 
  /* And, handle each record */
590
 
  while (tvb_reported_length_remaining(tvb, offset) > 0
591
 
         && ((int)offset-(int)offset0) <app_len-2)
592
 
  {
593
 
 
594
 
    radius_type = tvb_get_guint8(tvb, offset);
595
 
    radius_len = tvb_get_guint8(tvb, offset + 1);
596
 
    if (radius_len < 2)
597
 
    {
598
 
      proto_tree_add_text(radius_tree, tvb, offset, 2,
599
 
                "Bogus RADIUS length %u, should be >= 2",
600
 
                radius_len);
601
 
      break;
602
 
    }
603
 
 
604
 
    if (radius_type == RADIUS_VENDOR_SPECIFIC)
605
 
    {
606
 
      if (radius_len < SKIP_HDR_LEN)
607
 
      {
608
 
        proto_tree_add_text(radius_tree, tvb, offset, radius_len,
609
 
                  "Bogus RADIUS length %u, should be >= %u",
610
 
                  radius_len, SKIP_HDR_LEN);
611
 
        offset += radius_len;
612
 
        continue;
613
 
      }
614
 
      radius_vendor_id = tvb_get_ntohl(tvb, offset +2);
615
 
 
616
 
      if(radius_vendor_id != VENDOR_THE3GPP2)
617
 
      {
618
 
        proto_tree_add_text(radius_tree, tvb, offset, radius_len,
619
 
                "Unknown Vendor-specific Attribute (Vendor Id: %x)", radius_vendor_id);
620
 
        offset += radius_len;
621
 
        continue;
622
 
      }
623
 
    }
624
 
    else
625
 
    {
626
 
 
627
 
      /**** ad-hoc ***/
628
 
      if(radius_type == 31)
629
 
      {
630
 
        str_val = tvb_get_ephemeral_string(tvb,offset+2,radius_len-2);
631
 
        proto_tree_add_text(radius_tree, tvb, offset, radius_len,
632
 
            "MSID: %s", str_val);
633
 
      }
634
 
      else if (radius_type == 46)
635
 
      {
636
 
        if (radius_len < 2+4)
637
 
        {
638
 
          proto_tree_add_text(radius_tree, tvb, offset, radius_len,
639
 
                    "Bogus RADIUS length %u, should be >= %u",
640
 
                    radius_len, 2+4);
 
567
    proto_item *ti;
 
568
    proto_tree *radius_tree;
 
569
    gint       radius_len;
 
570
    guint8     radius_type;
 
571
    guint8     radius_subtype;
 
572
    int        attribute_type;
 
573
    gint       attribute_len;
 
574
    gint       offset0;
 
575
    gint       radius_offset;
 
576
    guint      i;
 
577
    guint8     *str_val;
 
578
    guint      radius_vendor_id;
 
579
 
 
580
    /* None of this really matters if we don't have a tree */
 
581
    if (!tree) return;
 
582
 
 
583
    offset0 = offset;
 
584
 
 
585
    /* return if length of extension is not valid */
 
586
    if (tvb_reported_length_remaining(tvb, offset)  < 12) {
 
587
        return;
 
588
    }
 
589
 
 
590
    ti = proto_tree_add_text(tree, tvb, offset - 2, app_len, "Airlink Record");
 
591
 
 
592
    radius_tree = proto_item_add_subtree(ti, ett_a11_radiuses);
 
593
 
 
594
    /* And, handle each record */
 
595
    while ((tvb_reported_length_remaining(tvb, offset) > 0)
 
596
           && ((offset-offset0) < (app_len-2)))
 
597
    {
 
598
 
 
599
        radius_type = tvb_get_guint8(tvb, offset);
 
600
        radius_len = tvb_get_guint8(tvb, offset + 1);
 
601
        if (radius_len < 2)
 
602
        {
 
603
            proto_tree_add_text(radius_tree, tvb, offset, 2,
 
604
                                "Bogus RADIUS length %u, should be >= 2",
 
605
                                radius_len);
 
606
            break;
 
607
        }
 
608
 
 
609
        if (radius_type == RADIUS_VENDOR_SPECIFIC)
 
610
        {
 
611
            if (radius_len < SKIP_HDR_LEN)
 
612
            {
 
613
                proto_tree_add_text(radius_tree, tvb, offset, radius_len,
 
614
                                    "Bogus RADIUS length %u, should be >= %u",
 
615
                                    radius_len, SKIP_HDR_LEN);
 
616
                offset += radius_len;
 
617
                continue;
 
618
            }
 
619
            radius_vendor_id = tvb_get_ntohl(tvb, offset +2);
 
620
 
 
621
            if(radius_vendor_id != VENDOR_THE3GPP2)
 
622
            {
 
623
                proto_tree_add_text(radius_tree, tvb, offset, radius_len,
 
624
                                    "Unknown Vendor-specific Attribute (Vendor Id: %x)", radius_vendor_id);
 
625
                offset += radius_len;
 
626
                continue;
 
627
            }
641
628
        }
642
629
        else
643
630
        {
644
 
          proto_tree_add_text(radius_tree, tvb, offset, radius_len,
645
 
              "Acct Session Time: %d",tvb_get_ntohl(tvb,offset+2));
646
 
        }
647
 
      }
648
 
      else
649
 
      {
650
 
        proto_tree_add_text(radius_tree, tvb, offset, radius_len,
651
 
              "Unknown RADIUS Attributes (Type: %d)", radius_type);
652
 
      }
653
 
 
654
 
      offset += radius_len;
655
 
      continue;
656
 
    }
657
 
 
658
 
    offset += SKIP_HDR_LEN;
659
 
    radius_len -= SKIP_HDR_LEN;
660
 
    radius_offset = 0;
661
 
 
662
 
    /* Detect Airlink Record Type */
663
 
 
664
 
    while (radius_len > radius_offset)
665
 
    {
666
 
      if (radius_len < radius_offset + 2)
667
 
      {
668
 
        proto_tree_add_text(radius_tree, tvb, offset + radius_offset, 2,
669
 
                  "Bogus RADIUS length %u, should be >= %u",
670
 
                  radius_len + SKIP_HDR_LEN,
671
 
                  radius_offset + 2 + SKIP_HDR_LEN);
672
 
        return;
673
 
      }
674
 
 
675
 
      radius_subtype = tvb_get_guint8(tvb, offset + radius_offset);
676
 
      attribute_len = tvb_get_guint8(tvb, offset + radius_offset + 1);
677
 
      if (attribute_len < 2)
678
 
      {
679
 
        proto_tree_add_text(radius_tree, tvb, offset + radius_offset, 2,
680
 
                  "Bogus attribute length %u, should be >= 2", attribute_len);
681
 
        return;
682
 
      }
683
 
      if (attribute_len > radius_len - radius_offset)
684
 
      {
685
 
        proto_tree_add_text(radius_tree, tvb, offset + radius_offset, 2,
686
 
                  "Bogus attribute length %u, should be <= %u",
687
 
                  attribute_len, radius_len - radius_offset);
688
 
        return;
689
 
      }
690
 
 
691
 
      attribute_type = -1;
692
 
      for(i = 0; i < NUM_ATTR; i++) {
693
 
        if (attrs[i].subtype == radius_subtype) {
694
 
            attribute_type = i;
695
 
            break;
696
 
        }
697
 
      }
698
 
 
699
 
      if ((radius_subtype == 48) &&
700
 
        (attribute_len == 0x0a))
701
 
      {
702
 
        /*
703
 
         * trying to compensate for Spec. screwups where
704
 
         * certain versions had subtype 48 being a 4 octet integer
705
 
         * and others had it being a 15 octet string!
706
 
         */
707
 
        str_val = tvb_get_ephemeral_string(tvb,offset+radius_offset+2,attribute_len-2);
708
 
        proto_tree_add_text(radius_tree, tvb, offset+radius_offset,
709
 
           attribute_len,
710
 
          "3GPP2: ESN-48 (String) (%s)", str_val);
711
 
      }
712
 
      else if(attribute_type >= 0) {
713
 
        switch(attrs[attribute_type].data_type) {
714
 
        case ATTR_TYPE_INT:
715
 
          proto_tree_add_text(radius_tree, tvb, offset + radius_offset,
716
 
            attribute_len, "3GPP2: %s (0x%04x)", attrs[attribute_type].attrname,
717
 
            tvb_get_ntohl(tvb,offset + radius_offset + 2));
718
 
          break;
719
 
        case ATTR_TYPE_IPV4:
720
 
          proto_tree_add_text(radius_tree, tvb, offset + radius_offset,
721
 
            attribute_len, "3GPP2: %s (%s)", attrs[attribute_type].attrname,
722
 
            ip_to_str(tvb_get_ptr(tvb,offset + radius_offset + 2,4)));
723
 
          break;
724
 
        case ATTR_TYPE_TYPE:
725
 
          proto_tree_add_text(radius_tree, tvb, offset + radius_offset,
726
 
            attribute_len, "3GPP2: %s (%s)", attrs[attribute_type].attrname,
727
 
            val_to_str(tvb_get_ntohl(tvb,offset+radius_offset+2),
728
 
            a11_airlink_types,"Unknown"));
729
 
          break;
730
 
        case ATTR_TYPE_STR:
731
 
          str_val = tvb_get_ephemeral_string(tvb,offset+radius_offset+2,attribute_len-2);
732
 
          proto_tree_add_text(radius_tree, tvb, offset+radius_offset,
733
 
             attribute_len,
734
 
            "3GPP2: %s (%s)", attrs[attribute_type].attrname, str_val);
735
 
          break;
736
 
        case ATTR_TYPE_NULL:
737
 
          break;
738
 
        default:
739
 
          proto_tree_add_text(radius_tree, tvb, offset+radius_offset, attribute_len,
740
 
            "RADIUS: %s", attrs[attribute_type].attrname);
741
 
          break;
742
 
        }
743
 
      }
744
 
      else {
745
 
        proto_tree_add_text(radius_tree, tvb, offset+radius_offset, attribute_len,
746
 
          "RADIUS: Unknown 3GPP2 Attribute (Type:%d, SubType:%d)",
747
 
          radius_type,radius_subtype);
748
 
      }
749
 
 
750
 
      radius_offset += attribute_len;
751
 
    }
752
 
    offset += radius_len;
753
 
 
754
 
  }
 
631
 
 
632
            /**** ad-hoc ***/
 
633
            if(radius_type == 31)
 
634
            {
 
635
                str_val = tvb_get_ephemeral_string(tvb,offset+2,radius_len-2);
 
636
                proto_tree_add_text(radius_tree, tvb, offset, radius_len,
 
637
                                    "MSID: %s", str_val);
 
638
            }
 
639
            else if (radius_type == 46)
 
640
            {
 
641
                if (radius_len < (2+4))
 
642
                {
 
643
                    proto_tree_add_text(radius_tree, tvb, offset, radius_len,
 
644
                                        "Bogus RADIUS length %u, should be >= %u",
 
645
                                        radius_len, 2+4);
 
646
                }
 
647
                else
 
648
                {
 
649
                    proto_tree_add_text(radius_tree, tvb, offset, radius_len,
 
650
                                        "Acct Session Time: %d",tvb_get_ntohl(tvb,offset+2));
 
651
                }
 
652
            }
 
653
            else
 
654
            {
 
655
                proto_tree_add_text(radius_tree, tvb, offset, radius_len,
 
656
                                    "Unknown RADIUS Attributes (Type: %d)", radius_type);
 
657
            }
 
658
 
 
659
            offset += radius_len;
 
660
            continue;
 
661
        }
 
662
 
 
663
        offset += SKIP_HDR_LEN;
 
664
        radius_len -= SKIP_HDR_LEN;
 
665
        radius_offset = 0;
 
666
 
 
667
        /* Detect Airlink Record Type */
 
668
 
 
669
        while (radius_len > radius_offset)
 
670
        {
 
671
            if (radius_len < (radius_offset + 2))
 
672
            {
 
673
                proto_tree_add_text(radius_tree, tvb, offset + radius_offset, 2,
 
674
                                    "Bogus RADIUS length %u, should be >= %u",
 
675
                                    radius_len + SKIP_HDR_LEN,
 
676
                                    radius_offset + 2 + SKIP_HDR_LEN);
 
677
                return;
 
678
            }
 
679
 
 
680
            radius_subtype = tvb_get_guint8(tvb, offset + radius_offset);
 
681
            attribute_len = tvb_get_guint8(tvb, offset + radius_offset + 1);
 
682
            if (attribute_len < 2)
 
683
            {
 
684
                proto_tree_add_text(radius_tree, tvb, offset + radius_offset, 2,
 
685
                                    "Bogus attribute length %u, should be >= 2", attribute_len);
 
686
                return;
 
687
            }
 
688
            if (attribute_len > (radius_len - radius_offset))
 
689
            {
 
690
                proto_tree_add_text(radius_tree, tvb, offset + radius_offset, 2,
 
691
                                    "Bogus attribute length %u, should be <= %u",
 
692
                                    attribute_len, radius_len - radius_offset);
 
693
                return;
 
694
            }
 
695
 
 
696
            attribute_type = -1;
 
697
            for(i = 0; i < NUM_ATTR; i++) {
 
698
                if (attrs[i].subtype == radius_subtype) {
 
699
                    attribute_type = i;
 
700
                    break;
 
701
                }
 
702
            }
 
703
 
 
704
            if ((radius_subtype == 48) &&
 
705
                (attribute_len == 0x0a))
 
706
            {
 
707
                /*
 
708
                 * trying to compensate for Spec. screwups where
 
709
                 * certain versions had subtype 48 being a 4 octet integer
 
710
                 * and others had it being a 15 octet string!
 
711
                 */
 
712
                str_val = tvb_get_ephemeral_string(tvb,offset+radius_offset+2,attribute_len-2);
 
713
                proto_tree_add_text(radius_tree, tvb, offset+radius_offset,
 
714
                                    attribute_len,
 
715
                                    "3GPP2: ESN-48 (String) (%s)", str_val);
 
716
            }
 
717
            else if(attribute_type >= 0) {
 
718
                switch(attrs[attribute_type].data_type) {
 
719
                case ATTR_TYPE_INT:
 
720
                    proto_tree_add_text(radius_tree, tvb, offset + radius_offset,
 
721
                                        attribute_len, "3GPP2: %s (0x%04x)", attrs[attribute_type].attrname,
 
722
                                        tvb_get_ntohl(tvb,offset + radius_offset + 2));
 
723
                    break;
 
724
                case ATTR_TYPE_IPV4:
 
725
                    proto_tree_add_text(radius_tree, tvb, offset + radius_offset,
 
726
                                        attribute_len, "3GPP2: %s (%s)", attrs[attribute_type].attrname,
 
727
                                        ip_to_str(tvb_get_ptr(tvb,offset + radius_offset + 2,4)));
 
728
                    break;
 
729
                case ATTR_TYPE_TYPE:
 
730
                    proto_tree_add_text(radius_tree, tvb, offset + radius_offset,
 
731
                                        attribute_len, "3GPP2: %s (%s)", attrs[attribute_type].attrname,
 
732
                                        val_to_str(tvb_get_ntohl(tvb,offset+radius_offset+2),
 
733
                                                   a11_airlink_types,"Unknown"));
 
734
                    break;
 
735
                case ATTR_TYPE_STR:
 
736
                    str_val = tvb_get_ephemeral_string(tvb,offset+radius_offset+2,attribute_len-2);
 
737
                    proto_tree_add_text(radius_tree, tvb, offset+radius_offset,
 
738
                                        attribute_len,
 
739
                                        "3GPP2: %s (%s)", attrs[attribute_type].attrname, str_val);
 
740
                    break;
 
741
                case ATTR_TYPE_NULL:
 
742
                    break;
 
743
                default:
 
744
                    proto_tree_add_text(radius_tree, tvb, offset+radius_offset, attribute_len,
 
745
                                        "RADIUS: %s", attrs[attribute_type].attrname);
 
746
                    break;
 
747
                }
 
748
            }
 
749
            else {
 
750
                proto_tree_add_text(radius_tree, tvb, offset+radius_offset, attribute_len,
 
751
                                    "RADIUS: Unknown 3GPP2 Attribute (Type:%d, SubType:%d)",
 
752
                                    radius_type,radius_subtype);
 
753
            }
 
754
 
 
755
            radius_offset += attribute_len;
 
756
        }
 
757
        offset += radius_len;
 
758
 
 
759
    }
755
760
 
756
761
}
757
762
 
759
764
/* Code to dissect Additional Session Info */
760
765
static void dissect_ase(tvbuff_t* tvb, int offset, guint ase_len, proto_tree* ext_tree)
761
766
{
762
 
   guint clen = 0; /* consumed length */
763
 
 
764
 
   while(clen < ase_len)
765
 
   {
766
 
      guint8 srid = tvb_get_guint8(tvb, offset+clen+1);
767
 
      proto_item* ti = proto_tree_add_text
768
 
              (ext_tree, tvb, offset+clen, 0x0D+1, "GRE Key Entry (SRID: %d)", srid);
769
 
      proto_tree* exts_tree = proto_item_add_subtree(ti, ett_a11_ase);
770
 
 
771
 
      /* Entry Length */
772
 
      proto_tree_add_item(exts_tree, hf_a11_ase_len_type, tvb, offset+clen, 1, FALSE);
773
 
      clen++;
774
 
 
775
 
      /* SRID */
776
 
      proto_tree_add_item(exts_tree, hf_a11_ase_srid_type, tvb, offset+clen, 1, FALSE);
777
 
      clen++;
778
 
 
779
 
      /* Service Option */
780
 
      proto_tree_add_item(exts_tree, hf_a11_ase_servopt_type, tvb, offset+clen, 2, FALSE);
781
 
      clen+=2;
782
 
 
783
 
      /* GRE Protocol Type*/
784
 
      proto_tree_add_item(exts_tree, hf_a11_ase_gre_proto_type, tvb, offset+clen, 2, FALSE);
785
 
      clen+=2;
786
 
 
787
 
      /* GRE Key */
788
 
      proto_tree_add_item(exts_tree, hf_a11_ase_gre_key, tvb, offset+clen, 4, FALSE);
789
 
      clen+=4;
790
 
 
791
 
      /* PCF IP Address */
792
 
      proto_tree_add_item(exts_tree, hf_a11_ase_pcf_addr_key, tvb, offset+clen, 4, FALSE);
793
 
      clen+=4;
794
 
   }
 
767
    guint clen = 0; /* consumed length */
 
768
 
 
769
    while(clen < ase_len)
 
770
    {
 
771
        guint8 srid = tvb_get_guint8(tvb, offset+clen+1);
 
772
        proto_item* ti = proto_tree_add_text
 
773
            (ext_tree, tvb, offset+clen, 0x0D+1, "GRE Key Entry (SRID: %d)", srid);
 
774
        proto_tree* exts_tree = proto_item_add_subtree(ti, ett_a11_ase);
 
775
 
 
776
        /* Entry Length */
 
777
        proto_tree_add_item(exts_tree, hf_a11_ase_len_type, tvb, offset+clen, 1, FALSE);
 
778
        clen++;
 
779
 
 
780
        /* SRID */
 
781
        proto_tree_add_item(exts_tree, hf_a11_ase_srid_type, tvb, offset+clen, 1, FALSE);
 
782
        clen++;
 
783
 
 
784
        /* Service Option */
 
785
        proto_tree_add_item(exts_tree, hf_a11_ase_servopt_type, tvb, offset+clen, 2, FALSE);
 
786
        clen+=2;
 
787
 
 
788
        /* GRE Protocol Type*/
 
789
        proto_tree_add_item(exts_tree, hf_a11_ase_gre_proto_type, tvb, offset+clen, 2, FALSE);
 
790
        clen+=2;
 
791
 
 
792
        /* GRE Key */
 
793
        proto_tree_add_item(exts_tree, hf_a11_ase_gre_key, tvb, offset+clen, 4, FALSE);
 
794
        clen+=4;
 
795
 
 
796
        /* PCF IP Address */
 
797
        proto_tree_add_item(exts_tree, hf_a11_ase_pcf_addr_key, tvb, offset+clen, 4, FALSE);
 
798
        clen+=4;
 
799
    }
795
800
}
796
801
 
797
802
#define A11_FQI_IPFLOW_DISC_ENABLED 0x80
800
805
static void dissect_fwd_qosinfo_flags
801
806
       (tvbuff_t* tvb, int offset, proto_tree* ext_tree, guint8* p_dscp_included)
802
807
{
803
 
      guint8 flags = tvb_get_guint8(tvb, offset);
804
 
      guint8 nbits = sizeof(flags) * 8;
805
 
 
806
 
      proto_item* ti = proto_tree_add_text(ext_tree, tvb, offset, sizeof(flags),
807
 
                           "Flags: %#02x", flags);
808
 
 
809
 
      proto_tree* flags_tree = proto_item_add_subtree(ti, ett_a11_fqi_flags);
810
 
 
811
 
      proto_tree_add_text(flags_tree, tvb, offset, sizeof(flags), "%s",
812
 
                      decode_boolean_bitfield(flags, A11_FQI_IPFLOW_DISC_ENABLED, nbits,
813
 
                       "IP Flow Discriminator Enabled", "IP Flow Discriminator Disabled"));
814
 
 
815
 
      proto_tree_add_text(flags_tree, tvb, offset, sizeof(flags), "%s",
816
 
                      decode_boolean_bitfield(flags, A11_FQI_DSCP_INCLUDED, nbits,
817
 
                                        "DSCP Included", "DSCP Not Included"));
818
 
      if(flags & A11_FQI_DSCP_INCLUDED)
819
 
      {
820
 
         *p_dscp_included = 1;
821
 
      }else
822
 
      {
823
 
         *p_dscp_included = 0;
824
 
      }
 
808
    guint8 flags = tvb_get_guint8(tvb, offset);
 
809
    guint8 nbits = sizeof(flags) * 8;
 
810
 
 
811
    proto_item* ti = proto_tree_add_text(ext_tree, tvb, offset, sizeof(flags),
 
812
                                         "Flags: %#02x", flags);
 
813
 
 
814
    proto_tree* flags_tree = proto_item_add_subtree(ti, ett_a11_fqi_flags);
 
815
 
 
816
    proto_tree_add_text(flags_tree, tvb, offset, sizeof(flags), "%s",
 
817
                        decode_boolean_bitfield(flags, A11_FQI_IPFLOW_DISC_ENABLED, nbits,
 
818
                                                "IP Flow Discriminator Enabled", "IP Flow Discriminator Disabled"));
 
819
 
 
820
    proto_tree_add_text(flags_tree, tvb, offset, sizeof(flags), "%s",
 
821
                        decode_boolean_bitfield(flags, A11_FQI_DSCP_INCLUDED, nbits,
 
822
                                                "DSCP Included", "DSCP Not Included"));
 
823
    if(flags & A11_FQI_DSCP_INCLUDED)
 
824
    {
 
825
        *p_dscp_included = 1;
 
826
    }else
 
827
    {
 
828
        *p_dscp_included = 0;
 
829
    }
825
830
}
826
831
 
827
832
 
831
836
static void dissect_fqi_entry_flags
832
837
       (tvbuff_t* tvb, int offset, proto_tree* ext_tree, guint8 dscp_enabled)
833
838
{
834
 
      guint8 dscp = tvb_get_guint8(tvb, offset);
835
 
      guint8 nbits = sizeof(dscp) * 8;
836
 
 
837
 
      proto_item* ti = proto_tree_add_text(ext_tree, tvb, offset, sizeof(dscp),
838
 
                           "DSCP and Flow State: %#02x", dscp);
839
 
 
840
 
      proto_tree* flags_tree = proto_item_add_subtree(ti, ett_a11_fqi_entry_flags);
841
 
 
842
 
      if(dscp_enabled)
843
 
      {
844
 
         proto_tree_add_text(flags_tree, tvb, offset, sizeof(dscp), "%s",
845
 
                      decode_numeric_bitfield(dscp, A11_FQI_DSCP, nbits,
846
 
                                              "DSCP: %u"));
847
 
      }
848
 
 
849
 
      proto_tree_add_text(flags_tree, tvb, offset, sizeof(dscp), "%s",
850
 
                      decode_boolean_bitfield(dscp, A11_FQI_FLOW_STATE, nbits,
851
 
                          "Flow State: Active", "Flow State: Inactive"));
 
839
    guint8 dscp = tvb_get_guint8(tvb, offset);
 
840
    guint8 nbits = sizeof(dscp) * 8;
 
841
 
 
842
    proto_item* ti = proto_tree_add_text(ext_tree, tvb, offset, sizeof(dscp),
 
843
                                         "DSCP and Flow State: %#02x", dscp);
 
844
 
 
845
    proto_tree* flags_tree = proto_item_add_subtree(ti, ett_a11_fqi_entry_flags);
 
846
 
 
847
    if(dscp_enabled)
 
848
    {
 
849
        proto_tree_add_text(flags_tree, tvb, offset, sizeof(dscp), "%s",
 
850
                            decode_numeric_bitfield(dscp, A11_FQI_DSCP, nbits,
 
851
                                                    "DSCP: %u"));
 
852
    }
 
853
 
 
854
    proto_tree_add_text(flags_tree, tvb, offset, sizeof(dscp), "%s",
 
855
                        decode_boolean_bitfield(dscp, A11_FQI_FLOW_STATE, nbits,
 
856
                                                "Flow State: Active", "Flow State: Inactive"));
852
857
}
853
858
 
854
859
 
857
862
static void dissect_rqi_entry_flags
858
863
       (tvbuff_t* tvb, int offset, proto_tree* ext_tree)
859
864
{
860
 
      guint8 flags = tvb_get_guint8(tvb, offset);
861
 
      guint8 nbits = sizeof(flags) * 8;
862
 
 
863
 
      proto_item* ti = proto_tree_add_text(ext_tree, tvb, offset, sizeof(flags),
864
 
                           "Flags: %#02x", flags);
865
 
 
866
 
      proto_tree* flags_tree = proto_item_add_subtree(ti, ett_a11_rqi_entry_flags);
867
 
 
868
 
      proto_tree_add_text(flags_tree, tvb, offset, sizeof(flags), "%s",
869
 
                      decode_boolean_bitfield(flags, A11_RQI_FLOW_STATE, nbits,
870
 
                          "Flow State: Active", "Flow State: Inactive"));
 
865
    guint8 flags = tvb_get_guint8(tvb, offset);
 
866
    guint8 nbits = sizeof(flags) * 8;
 
867
 
 
868
    proto_item* ti = proto_tree_add_text(ext_tree, tvb, offset, sizeof(flags),
 
869
                                         "Flags: %#02x", flags);
 
870
 
 
871
    proto_tree* flags_tree = proto_item_add_subtree(ti, ett_a11_rqi_entry_flags);
 
872
 
 
873
    proto_tree_add_text(flags_tree, tvb, offset, sizeof(flags), "%s",
 
874
                        decode_boolean_bitfield(flags, A11_RQI_FLOW_STATE, nbits,
 
875
                                                "Flow State: Active", "Flow State: Inactive"));
871
876
}
872
877
 
873
878
/* Code to dissect Forward QoS Info */
874
879
static void dissect_fwd_qosinfo(tvbuff_t* tvb, int offset, proto_tree* ext_tree)
875
880
{
876
 
   int clen = 0; /* consumed length */
877
 
   guint8 srid = 0;
878
 
   guint8 flow_count = 0;
879
 
   guint8 flow_index = 0;
880
 
   guint8 dscp_enabled = 0;
881
 
 
882
 
   /* 
883
 
    * Starts with a length field 
884
 
    * http://www.3gpp2.org/Public_html/specs/A.S0009-C_v1.0_070801.pdf
885
 
    */
886
 
        proto_tree_add_item(ext_tree, hf_a11_fqi_length, tvb, offset+clen, 2, FALSE);
887
 
        clen = clen + 2;
888
 
 
889
 
   /* SR Id */
890
 
   srid = tvb_get_guint8(tvb, offset+clen);
891
 
   proto_tree_add_item(ext_tree, hf_a11_fqi_srid, tvb, offset+clen, 1, FALSE);
892
 
   clen++;
893
 
 
894
 
   /* Flags */
895
 
   dissect_fwd_qosinfo_flags(tvb, offset+clen, ext_tree, &dscp_enabled);
896
 
   clen++;
897
 
 
898
 
   /* Flow Count */
899
 
   flow_count = tvb_get_guint8(tvb, offset+clen);
900
 
   flow_count &= 0x1F;
901
 
   proto_tree_add_item(ext_tree, hf_a11_fqi_flowcount, tvb, offset+clen, 1, FALSE);
902
 
   clen++;
903
 
 
904
 
   for(flow_index=0; flow_index<flow_count; flow_index++)
905
 
   {
906
 
      guint8 requested_qos_len = 0;
907
 
      guint8 granted_qos_len = 0;
908
 
 
909
 
      guint8 entry_len = tvb_get_guint8(tvb, offset+clen);
910
 
      guint8 flow_id = tvb_get_guint8(tvb, offset+clen+1);
911
 
 
912
 
      proto_item* ti = proto_tree_add_text
913
 
          (ext_tree, tvb, offset+clen, entry_len+1, "Forward Flow Entry (Flow Id: %d)", flow_id);
914
 
 
915
 
      proto_tree* exts_tree = proto_item_add_subtree(ti, ett_a11_fqi_flowentry);
916
 
 
917
 
      /* Entry Length */
918
 
      proto_tree_add_item(exts_tree, hf_a11_fqi_entrylen, tvb, offset+clen, 1, FALSE);
919
 
      clen++;
920
 
 
921
 
      /* Flow Id */
922
 
      proto_tree_add_item(exts_tree, hf_a11_fqi_flowid, tvb, offset+clen, 1, FALSE);
923
 
      clen++;
924
 
 
925
 
      /* DSCP and Flow State*/
926
 
      dissect_fqi_entry_flags(tvb, offset+clen, exts_tree, dscp_enabled);
927
 
      clen++;
928
 
 
929
 
 
930
 
      /* Requested QoS Length */
931
 
      requested_qos_len = tvb_get_guint8(tvb, offset+clen);
932
 
      proto_tree_add_item
933
 
        (exts_tree, hf_a11_fqi_requested_qoslen, tvb, offset+clen, 1, FALSE);
934
 
      clen++;
935
 
 
936
 
      /* Requested QoS Blob */
937
 
      if(requested_qos_len)
938
 
      {
939
 
        proto_tree_add_item
940
 
          (exts_tree, hf_a11_fqi_requested_qos, tvb, offset+clen,
941
 
              requested_qos_len, FALSE);
942
 
        clen += requested_qos_len;
943
 
      }
944
 
 
945
 
      /* Granted QoS Length */
946
 
      granted_qos_len = tvb_get_guint8(tvb, offset+clen);
947
 
      proto_tree_add_item(exts_tree, hf_a11_fqi_granted_qoslen, tvb, offset+clen, 1, FALSE);
948
 
      clen++;
949
 
 
950
 
      /* Granted QoS Blob */
951
 
      if(granted_qos_len)
952
 
      {
953
 
        proto_tree_add_item
954
 
          (exts_tree, hf_a11_fqi_granted_qos, tvb, offset+clen, granted_qos_len, FALSE);
955
 
        clen += granted_qos_len;
956
 
      }
957
 
   }
 
881
    int clen = 0; /* consumed length */
 
882
    guint8 flow_count;
 
883
    guint8 flow_index;
 
884
    guint8 dscp_enabled = 0;
 
885
 
 
886
    /* 
 
887
     * Starts with a length field 
 
888
     * http://www.3gpp2.org/Public_html/specs/A.S0009-C_v1.0_070801.pdf
 
889
     */
 
890
    proto_tree_add_item(ext_tree, hf_a11_fqi_length, tvb, offset+clen, 2, FALSE);
 
891
    clen = clen + 2;
 
892
 
 
893
    /* SR Id */
 
894
    proto_tree_add_item(ext_tree, hf_a11_fqi_srid, tvb, offset+clen, 1, FALSE);
 
895
    clen++;
 
896
 
 
897
    /* Flags */
 
898
    dissect_fwd_qosinfo_flags(tvb, offset+clen, ext_tree, &dscp_enabled);
 
899
    clen++;
 
900
 
 
901
    /* Flow Count */
 
902
    flow_count = tvb_get_guint8(tvb, offset+clen);
 
903
    flow_count &= 0x1F;
 
904
    proto_tree_add_item(ext_tree, hf_a11_fqi_flowcount, tvb, offset+clen, 1, FALSE);
 
905
    clen++;
 
906
 
 
907
    for(flow_index=0; flow_index<flow_count; flow_index++)
 
908
    {
 
909
        guint8 requested_qos_len = 0;
 
910
        guint8 granted_qos_len = 0;
 
911
 
 
912
        guint8 entry_len = tvb_get_guint8(tvb, offset+clen);
 
913
        guint8 flow_id = tvb_get_guint8(tvb, offset+clen+1);
 
914
 
 
915
        proto_item* ti = proto_tree_add_text
 
916
            (ext_tree, tvb, offset+clen, entry_len+1, "Forward Flow Entry (Flow Id: %d)", flow_id);
 
917
 
 
918
        proto_tree* exts_tree = proto_item_add_subtree(ti, ett_a11_fqi_flowentry);
 
919
 
 
920
        /* Entry Length */
 
921
        proto_tree_add_item(exts_tree, hf_a11_fqi_entrylen, tvb, offset+clen, 1, FALSE);
 
922
        clen++;
 
923
 
 
924
        /* Flow Id */
 
925
        proto_tree_add_item(exts_tree, hf_a11_fqi_flowid, tvb, offset+clen, 1, FALSE);
 
926
        clen++;
 
927
 
 
928
        /* DSCP and Flow State*/
 
929
        dissect_fqi_entry_flags(tvb, offset+clen, exts_tree, dscp_enabled);
 
930
        clen++;
 
931
 
 
932
 
 
933
        /* Requested QoS Length */
 
934
        requested_qos_len = tvb_get_guint8(tvb, offset+clen);
 
935
        proto_tree_add_item
 
936
            (exts_tree, hf_a11_fqi_requested_qoslen, tvb, offset+clen, 1, FALSE);
 
937
        clen++;
 
938
 
 
939
        /* Requested QoS Blob */
 
940
        if(requested_qos_len)
 
941
        {
 
942
            proto_tree_add_item
 
943
                (exts_tree, hf_a11_fqi_requested_qos, tvb, offset+clen,
 
944
                 requested_qos_len, FALSE);
 
945
            clen += requested_qos_len;
 
946
        }
 
947
 
 
948
        /* Granted QoS Length */
 
949
        granted_qos_len = tvb_get_guint8(tvb, offset+clen);
 
950
        proto_tree_add_item(exts_tree, hf_a11_fqi_granted_qoslen, tvb, offset+clen, 1, FALSE);
 
951
        clen++;
 
952
 
 
953
        /* Granted QoS Blob */
 
954
        if(granted_qos_len)
 
955
        {
 
956
            proto_tree_add_item
 
957
                (exts_tree, hf_a11_fqi_granted_qos, tvb, offset+clen, granted_qos_len, FALSE);
 
958
            clen += granted_qos_len;
 
959
        }
 
960
    }
958
961
}
959
962
 
960
963
/* Code to dissect Reverse QoS Info */
961
964
static void dissect_rev_qosinfo(tvbuff_t* tvb, int offset, proto_tree* ext_tree)
962
965
{
963
 
   int clen = 0; /* consumed length */
964
 
   guint8 srid = 0;
965
 
   guint8 flow_count = 0;
966
 
   guint8 flow_index = 0;
967
 
 
968
 
   /* 
969
 
    * Starts with a length field 
970
 
    * http://www.3gpp2.org/Public_html/specs/A.S0009-C_v1.0_070801.pdf
971
 
    */
972
 
        proto_tree_add_item(ext_tree, hf_a11_fqi_length, tvb, offset+clen, 2, FALSE);
973
 
        clen = clen + 2;
974
 
 
975
 
        /* SR Id */
976
 
   srid = tvb_get_guint8(tvb, offset+clen);
977
 
   proto_tree_add_item(ext_tree, hf_a11_rqi_srid, tvb, offset+clen, 1, FALSE);
978
 
   clen++;
979
 
 
980
 
   /* Flow Count */
981
 
   flow_count = tvb_get_guint8(tvb, offset+clen);
982
 
   flow_count &= 0x1F;
983
 
   proto_tree_add_item(ext_tree, hf_a11_rqi_flowcount, tvb, offset+clen, 1, FALSE);
984
 
   clen++;
985
 
 
986
 
   for(flow_index=0; flow_index<flow_count; flow_index++)
987
 
   {
988
 
      guint8 requested_qos_len = 0;
989
 
      guint8 granted_qos_len = 0;
990
 
 
991
 
      guint8 entry_len = tvb_get_guint8(tvb, offset+clen);
992
 
      guint8 flow_id = tvb_get_guint8(tvb, offset+clen+1);
993
 
 
994
 
      proto_item* ti = proto_tree_add_text
995
 
          (ext_tree, tvb, offset+clen, entry_len+1, "Reverse Flow Entry (Flow Id: %d)", flow_id);
996
 
 
997
 
      proto_tree* exts_tree = proto_item_add_subtree(ti, ett_a11_rqi_flowentry);
998
 
 
999
 
      /* Entry Length */
1000
 
      proto_tree_add_item(exts_tree, hf_a11_rqi_entrylen, tvb, offset+clen, 1, FALSE);
1001
 
      clen++;
1002
 
 
1003
 
      /* Flow Id */
1004
 
      proto_tree_add_item(exts_tree, hf_a11_rqi_flowid, tvb, offset+clen, 1, FALSE);
1005
 
      clen++;
1006
 
 
1007
 
      /* Flags */
1008
 
      dissect_rqi_entry_flags(tvb, offset+clen, exts_tree);
1009
 
      clen++;
1010
 
 
1011
 
      /* Requested QoS Length */
1012
 
      requested_qos_len = tvb_get_guint8(tvb, offset+clen);
1013
 
      proto_tree_add_item(exts_tree, hf_a11_rqi_requested_qoslen, tvb, offset+clen, 1, FALSE);
1014
 
      clen++;
1015
 
 
1016
 
      /* Requested QoS Blob */
1017
 
      if(requested_qos_len)
1018
 
      {
1019
 
        proto_tree_add_item
1020
 
          (exts_tree, hf_a11_rqi_requested_qos, tvb, offset+clen, requested_qos_len, FALSE);
1021
 
        clen += requested_qos_len;
1022
 
      }
1023
 
 
1024
 
      /* Granted QoS Length */
1025
 
      granted_qos_len = tvb_get_guint8(tvb, offset+clen);
1026
 
      proto_tree_add_item(exts_tree, hf_a11_rqi_granted_qoslen, tvb, offset+clen, 1, FALSE);
1027
 
      clen++;
1028
 
 
1029
 
      /* Granted QoS Blob */
1030
 
      if(granted_qos_len)
1031
 
      {
1032
 
        proto_tree_add_item
1033
 
          (exts_tree, hf_a11_rqi_granted_qos, tvb, offset+clen, granted_qos_len, FALSE);
1034
 
        clen += granted_qos_len;
1035
 
      }
1036
 
   }
 
966
    int clen = 0; /* consumed length */
 
967
    guint8 flow_count;
 
968
    guint8 flow_index;
 
969
 
 
970
    /* 
 
971
     * Starts with a length field 
 
972
     * http://www.3gpp2.org/Public_html/specs/A.S0009-C_v1.0_070801.pdf
 
973
     */
 
974
    proto_tree_add_item(ext_tree, hf_a11_fqi_length, tvb, offset+clen, 2, FALSE);
 
975
    clen = clen + 2;
 
976
 
 
977
    /* SR Id */
 
978
    proto_tree_add_item(ext_tree, hf_a11_rqi_srid, tvb, offset+clen, 1, FALSE);
 
979
    clen++;
 
980
 
 
981
    /* Flow Count */
 
982
    flow_count = tvb_get_guint8(tvb, offset+clen);
 
983
    flow_count &= 0x1F;
 
984
    proto_tree_add_item(ext_tree, hf_a11_rqi_flowcount, tvb, offset+clen, 1, FALSE);
 
985
    clen++;
 
986
 
 
987
    for(flow_index=0; flow_index<flow_count; flow_index++)
 
988
    {
 
989
        guint8 requested_qos_len;
 
990
        guint8 granted_qos_len;
 
991
 
 
992
        guint8 entry_len = tvb_get_guint8(tvb, offset+clen);
 
993
        guint8 flow_id = tvb_get_guint8(tvb, offset+clen+1);
 
994
 
 
995
        proto_item* ti = proto_tree_add_text
 
996
            (ext_tree, tvb, offset+clen, entry_len+1, "Reverse Flow Entry (Flow Id: %d)", flow_id);
 
997
 
 
998
        proto_tree* exts_tree = proto_item_add_subtree(ti, ett_a11_rqi_flowentry);
 
999
 
 
1000
        /* Entry Length */
 
1001
        proto_tree_add_item(exts_tree, hf_a11_rqi_entrylen, tvb, offset+clen, 1, FALSE);
 
1002
        clen++;
 
1003
 
 
1004
        /* Flow Id */
 
1005
        proto_tree_add_item(exts_tree, hf_a11_rqi_flowid, tvb, offset+clen, 1, FALSE);
 
1006
        clen++;
 
1007
 
 
1008
        /* Flags */
 
1009
        dissect_rqi_entry_flags(tvb, offset+clen, exts_tree);
 
1010
        clen++;
 
1011
 
 
1012
        /* Requested QoS Length */
 
1013
        requested_qos_len = tvb_get_guint8(tvb, offset+clen);
 
1014
        proto_tree_add_item(exts_tree, hf_a11_rqi_requested_qoslen, tvb, offset+clen, 1, FALSE);
 
1015
        clen++;
 
1016
 
 
1017
        /* Requested QoS Blob */
 
1018
        if(requested_qos_len)
 
1019
        {
 
1020
            proto_tree_add_item
 
1021
                (exts_tree, hf_a11_rqi_requested_qos, tvb, offset+clen, requested_qos_len, FALSE);
 
1022
            clen += requested_qos_len;
 
1023
        }
 
1024
 
 
1025
        /* Granted QoS Length */
 
1026
        granted_qos_len = tvb_get_guint8(tvb, offset+clen);
 
1027
        proto_tree_add_item(exts_tree, hf_a11_rqi_granted_qoslen, tvb, offset+clen, 1, FALSE);
 
1028
        clen++;
 
1029
 
 
1030
        /* Granted QoS Blob */
 
1031
        if(granted_qos_len)
 
1032
        {
 
1033
            proto_tree_add_item
 
1034
                (exts_tree, hf_a11_rqi_granted_qos, tvb, offset+clen, granted_qos_len, FALSE);
 
1035
            clen += granted_qos_len;
 
1036
        }
 
1037
    }
1037
1038
}
1038
1039
 
1039
1040
 
1040
1041
/* Code to dissect Subscriber QoS Profile */
1041
1042
static void dissect_subscriber_qos_profile(tvbuff_t* tvb, int offset, int ext_len, proto_tree* ext_tree)
1042
1043
{
1043
 
    proto_tree* exts_tree = 0;
 
1044
    proto_tree* exts_tree;
1044
1045
 
1045
1046
    int qos_profile_len = ext_len;
1046
1047
 
1047
1048
    proto_item* ti =
1048
 
       proto_tree_add_text (ext_tree, tvb, offset, 0,
1049
 
                            "Subscriber Qos Profile (%d bytes)",
1050
 
                            qos_profile_len);
 
1049
        proto_tree_add_text (ext_tree, tvb, offset, 0,
 
1050
                             "Subscriber Qos Profile (%d bytes)",
 
1051
                             qos_profile_len);
1051
1052
 
1052
1053
    exts_tree = proto_item_add_subtree(ti, ett_a11_subscriber_profile);
1053
1054
 
1055
1056
    if(qos_profile_len)
1056
1057
    {
1057
1058
        proto_tree_add_item
1058
 
          (exts_tree,  hf_a11_subsciber_profile, tvb, offset,
1059
 
              qos_profile_len, FALSE);
 
1059
            (exts_tree,  hf_a11_subsciber_profile, tvb, offset,
 
1060
             qos_profile_len, FALSE);
1060
1061
    }
1061
1062
}
1062
1063
 
1063
1064
/* Code to dissect Forward QoS Update Info */
1064
1065
static void dissect_fwd_qosupdate_info(tvbuff_t* tvb, int offset, proto_tree* ext_tree)
1065
1066
{
1066
 
   int clen = 0; /* consumed length */
1067
 
   guint8 flow_count = 0;
1068
 
   guint8 flow_index = 0;
1069
 
 
1070
 
   /* Flow Count */
1071
 
   flow_count = tvb_get_guint8(tvb, offset+clen);
1072
 
   proto_tree_add_item(ext_tree, hf_a11_fqui_flowcount, tvb, offset+clen, 1, FALSE);
1073
 
   clen++;
1074
 
 
1075
 
   for(flow_index=0; flow_index<flow_count; flow_index++)
1076
 
   {
1077
 
      proto_tree* exts_tree = 0;
1078
 
      guint8 granted_qos_len = 0;
1079
 
 
1080
 
      guint8 flow_id = tvb_get_guint8(tvb, offset+clen);
1081
 
 
1082
 
      proto_item* ti = proto_tree_add_text
1083
 
          (ext_tree, tvb, offset+clen, 1, "Forward Flow Entry (Flow Id: %d)", flow_id);
1084
 
 
1085
 
      clen++;
1086
 
      exts_tree = proto_item_add_subtree(ti, ett_a11_fqui_flowentry);
1087
 
 
1088
 
      /* Forward QoS Sub Blob Length */
1089
 
      granted_qos_len = tvb_get_guint8(tvb, offset+clen);
1090
 
      proto_tree_add_item
1091
 
        (exts_tree, hf_a11_fqui_updated_qoslen, tvb, offset+clen, 1, FALSE);
1092
 
      clen++;
1093
 
 
1094
 
      /* Forward QoS Sub Blob */
1095
 
      if(granted_qos_len)
1096
 
      {
 
1067
    int clen = 0; /* consumed length */
 
1068
    guint8 flow_count;
 
1069
    guint8 flow_index;
 
1070
 
 
1071
    /* Flow Count */
 
1072
    flow_count = tvb_get_guint8(tvb, offset+clen);
 
1073
    proto_tree_add_item(ext_tree, hf_a11_fqui_flowcount, tvb, offset+clen, 1, FALSE);
 
1074
    clen++;
 
1075
 
 
1076
    for(flow_index=0; flow_index<flow_count; flow_index++)
 
1077
    {
 
1078
        proto_tree* exts_tree;
 
1079
        guint8 granted_qos_len;
 
1080
 
 
1081
        guint8 flow_id = tvb_get_guint8(tvb, offset+clen);
 
1082
 
 
1083
        proto_item* ti = proto_tree_add_text
 
1084
            (ext_tree, tvb, offset+clen, 1, "Forward Flow Entry (Flow Id: %d)", flow_id);
 
1085
 
 
1086
        clen++;
 
1087
        exts_tree = proto_item_add_subtree(ti, ett_a11_fqui_flowentry);
 
1088
 
 
1089
        /* Forward QoS Sub Blob Length */
 
1090
        granted_qos_len = tvb_get_guint8(tvb, offset+clen);
1097
1091
        proto_tree_add_item
1098
 
          (exts_tree, hf_a11_fqui_updated_qos, tvb, offset+clen,
1099
 
              granted_qos_len, FALSE);
1100
 
        clen += granted_qos_len;
1101
 
      }
1102
 
   }
 
1092
            (exts_tree, hf_a11_fqui_updated_qoslen, tvb, offset+clen, 1, FALSE);
 
1093
        clen++;
 
1094
 
 
1095
        /* Forward QoS Sub Blob */
 
1096
        if(granted_qos_len)
 
1097
        {
 
1098
            proto_tree_add_item
 
1099
                (exts_tree, hf_a11_fqui_updated_qos, tvb, offset+clen,
 
1100
                 granted_qos_len, FALSE);
 
1101
            clen += granted_qos_len;
 
1102
        }
 
1103
    }
1103
1104
}
1104
1105
 
1105
1106
 
1106
1107
/* Code to dissect Reverse QoS Update Info */
1107
1108
static void dissect_rev_qosupdate_info(tvbuff_t* tvb, int offset, proto_tree* ext_tree)
1108
1109
{
1109
 
   int clen = 0; /* consumed length */
1110
 
   guint8 flow_count = 0;
1111
 
   guint8 flow_index = 0;
1112
 
 
1113
 
   /* Flow Count */
1114
 
   flow_count = tvb_get_guint8(tvb, offset+clen);
1115
 
   proto_tree_add_item(ext_tree, hf_a11_rqui_flowcount, tvb, offset+clen, 1, FALSE);
1116
 
   clen++;
1117
 
 
1118
 
   for(flow_index=0; flow_index<flow_count; flow_index++)
1119
 
   {
1120
 
      proto_tree* exts_tree = 0;
1121
 
      guint8 granted_qos_len = 0;
1122
 
 
1123
 
      guint8 flow_id = tvb_get_guint8(tvb, offset+clen);
1124
 
 
1125
 
      proto_item* ti = proto_tree_add_text
1126
 
          (ext_tree, tvb, offset+clen, 1, "Reverse Flow Entry (Flow Id: %d)", flow_id);
1127
 
      clen++;
1128
 
      exts_tree = proto_item_add_subtree(ti, ett_a11_rqui_flowentry);
1129
 
 
1130
 
      /* Reverse QoS Sub Blob Length */
1131
 
      granted_qos_len = tvb_get_guint8(tvb, offset+clen);
1132
 
      proto_tree_add_item
1133
 
        (exts_tree, hf_a11_rqui_updated_qoslen, tvb, offset+clen, 1, FALSE);
1134
 
      clen++;
1135
 
 
1136
 
      /* Reverse QoS Sub Blob */
1137
 
      if(granted_qos_len)
1138
 
      {
 
1110
    int clen = 0; /* consumed length */
 
1111
    guint8 flow_count;
 
1112
    guint8 flow_index;
 
1113
 
 
1114
    /* Flow Count */
 
1115
    flow_count = tvb_get_guint8(tvb, offset+clen);
 
1116
    proto_tree_add_item(ext_tree, hf_a11_rqui_flowcount, tvb, offset+clen, 1, FALSE);
 
1117
    clen++;
 
1118
 
 
1119
    for(flow_index=0; flow_index<flow_count; flow_index++)
 
1120
    {
 
1121
        proto_tree* exts_tree;
 
1122
        guint8 granted_qos_len;
 
1123
 
 
1124
        guint8 flow_id = tvb_get_guint8(tvb, offset+clen);
 
1125
 
 
1126
        proto_item* ti = proto_tree_add_text
 
1127
            (ext_tree, tvb, offset+clen, 1, "Reverse Flow Entry (Flow Id: %d)", flow_id);
 
1128
        clen++;
 
1129
        exts_tree = proto_item_add_subtree(ti, ett_a11_rqui_flowentry);
 
1130
 
 
1131
        /* Reverse QoS Sub Blob Length */
 
1132
        granted_qos_len = tvb_get_guint8(tvb, offset+clen);
1139
1133
        proto_tree_add_item
1140
 
          (exts_tree, hf_a11_rqui_updated_qos, tvb, offset+clen,
1141
 
              granted_qos_len, FALSE);
1142
 
        clen += granted_qos_len;
1143
 
      }
1144
 
   }
 
1134
            (exts_tree, hf_a11_rqui_updated_qoslen, tvb, offset+clen, 1, FALSE);
 
1135
        clen++;
 
1136
 
 
1137
        /* Reverse QoS Sub Blob */
 
1138
        if(granted_qos_len)
 
1139
        {
 
1140
            proto_tree_add_item
 
1141
                (exts_tree, hf_a11_rqui_updated_qos, tvb, offset+clen,
 
1142
                 granted_qos_len, FALSE);
 
1143
            clen += granted_qos_len;
 
1144
        }
 
1145
    }
1145
1146
}
1146
1147
 
1147
1148
/* Code to dissect extensions */
1148
1149
static void
1149
1150
dissect_a11_extensions( tvbuff_t *tvb, int offset, proto_tree *tree)
1150
1151
{
1151
 
  proto_item   *ti;
1152
 
  proto_tree   *exts_tree=NULL;
1153
 
  proto_tree   *ext_tree;
1154
 
  guint         ext_len;
1155
 
  guint8        ext_type;
1156
 
  guint8        ext_subtype=0;
1157
 
  guint         hdrLen;
1158
 
 
1159
 
  gint16       apptype = -1;
1160
 
 
1161
 
  /* None of this really matters if we don't have a tree */
1162
 
  if (!tree) return;
1163
 
 
1164
 
  /* Add our tree, if we have extensions */
1165
 
  ti = proto_tree_add_text(tree, tvb, offset, -1, "Extensions");
1166
 
  exts_tree = proto_item_add_subtree(ti, ett_a11_exts);
1167
 
 
1168
 
  /* And, handle each extension */
1169
 
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
1170
 
 
1171
 
    /* Get our extension info */
1172
 
    ext_type = tvb_get_guint8(tvb, offset);
1173
 
    if (ext_type == GEN_AUTH_EXT) {
1174
 
      /*
1175
 
       * Very nasty . . breaks normal extensions, since the length is
1176
 
       * in the wrong place :(
1177
 
       */
1178
 
      ext_subtype = tvb_get_guint8(tvb, offset + 1);
1179
 
      ext_len = tvb_get_ntohs(tvb, offset + 2);
1180
 
      hdrLen = 4;
1181
 
    } else if (ext_type == CVSE_EXT || ext_type == OLD_CVSE_EXT) {
1182
 
      ext_len = tvb_get_ntohs(tvb, offset + 2);
1183
 
      ext_subtype = tvb_get_guint8(tvb, offset + 8);
1184
 
      hdrLen = 4;
1185
 
    } else {
1186
 
      ext_len = tvb_get_guint8(tvb, offset + 1);
1187
 
      hdrLen = 2;
1188
 
    }
1189
 
 
1190
 
    ti = proto_tree_add_text(exts_tree, tvb, offset, ext_len + hdrLen,
1191
 
                 "Extension: %s",
1192
 
                 val_to_str(ext_type, a11_ext_types,
1193
 
                            "Unknown Extension %u"));
1194
 
    ext_tree = proto_item_add_subtree(ti, ett_a11_ext);
1195
 
 
1196
 
    proto_tree_add_item(ext_tree, hf_a11_ext_type, tvb, offset, 1, ext_type);
1197
 
    offset++;
1198
 
 
1199
 
    if (ext_type == SS_EXT) {
1200
 
      proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len);
1201
 
      offset++;
1202
 
    }
1203
 
    else if(ext_type == CVSE_EXT || ext_type == OLD_CVSE_EXT) {
1204
 
      offset++;
1205
 
      proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 2, ext_len);
1206
 
      offset+=2;
1207
 
    }
1208
 
    else if (ext_type != GEN_AUTH_EXT) {
1209
 
      /* Another nasty hack since GEN_AUTH_EXT broke everything */
1210
 
      proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len);
1211
 
      offset++;
1212
 
    }
1213
 
 
1214
 
    switch(ext_type) {
1215
 
    case SS_EXT:
1216
 
      decode_sse(ext_tree, tvb, offset, ext_len);
1217
 
      offset += ext_len;
1218
 
      ext_len = 0;
1219
 
      break;
1220
 
 
1221
 
    case MH_AUTH_EXT:
1222
 
    case MF_AUTH_EXT:
1223
 
    case FH_AUTH_EXT:
1224
 
    case RU_AUTH_EXT:
1225
 
      /* All these extensions look the same.  4 byte SPI followed by a key */
1226
 
      if (ext_len < 4)
1227
 
        break;
1228
 
      proto_tree_add_item(ext_tree, hf_a11_aext_spi, tvb, offset, 4, FALSE);
1229
 
      offset += 4;
1230
 
      ext_len -= 4;
1231
 
      if (ext_len == 0)
1232
 
        break;
1233
 
      proto_tree_add_item(ext_tree, hf_a11_aext_auth, tvb, offset, ext_len,
1234
 
                          FALSE);
1235
 
      break;
1236
 
    case MN_NAI_EXT:
1237
 
      if (ext_len == 0)
1238
 
        break;
1239
 
      proto_tree_add_item(ext_tree, hf_a11_next_nai, tvb, offset,
1240
 
                          ext_len, FALSE);
1241
 
      break;
1242
 
 
1243
 
    case GEN_AUTH_EXT:      /* RFC 3012 */
1244
 
      /*
1245
 
       * Very nasty . . breaks normal extensions, since the length is
1246
 
       * in the wrong place :(
1247
 
       */
1248
 
      proto_tree_add_uint(ext_tree, hf_a11_ext_stype, tvb, offset, 1, ext_subtype);
1249
 
      offset++;
1250
 
      proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 2, ext_len);
1251
 
      offset+=2;
1252
 
      /* SPI */
1253
 
      if (ext_len < 4)
1254
 
        break;
1255
 
      proto_tree_add_item(ext_tree, hf_a11_aext_spi, tvb, offset, 4, FALSE);
1256
 
      offset += 4;
1257
 
      ext_len -= 4;
1258
 
      /* Key */
1259
 
      if (ext_len == 0)
1260
 
        break;
1261
 
      proto_tree_add_item(ext_tree, hf_a11_aext_auth, tvb, offset,
1262
 
                          ext_len, FALSE);
1263
 
 
1264
 
      break;
1265
 
    case OLD_CVSE_EXT:      /* RFC 3115 */
1266
 
    case CVSE_EXT:          /* RFC 3115 */
1267
 
      if (ext_len < 4)
1268
 
        break;
1269
 
      proto_tree_add_item(ext_tree, hf_a11_vse_vid, tvb, offset, 4, FALSE);
1270
 
      offset += 4;
1271
 
      ext_len -= 4;
1272
 
      if (ext_len < 2)
1273
 
        break;
1274
 
      apptype = tvb_get_ntohs(tvb, offset);
1275
 
      proto_tree_add_uint(ext_tree, hf_a11_vse_apptype, tvb, offset, 2, apptype);
1276
 
      offset += 2;
1277
 
      ext_len -= 2;
1278
 
      if(apptype == 0x0101) {
1279
 
        if (tvb_reported_length_remaining(tvb, offset) > 0) {
1280
 
          dissect_a11_radius(tvb, offset, ext_tree, ext_len + 2);
1281
 
        }
1282
 
      }
1283
 
      break;
1284
 
    case OLD_NVSE_EXT:      /* RFC 3115 */
1285
 
    case NVSE_EXT:          /* RFC 3115 */
1286
 
      if (ext_len < 6)
1287
 
        break;
1288
 
      proto_tree_add_item(ext_tree, hf_a11_vse_vid, tvb, offset+2, 4, FALSE);
1289
 
      offset += 6;
1290
 
      ext_len -= 6;
1291
 
      proto_tree_add_item(ext_tree, hf_a11_vse_apptype, tvb, offset, 2, FALSE);
1292
 
 
1293
 
      if (ext_len < 2)
1294
 
        break;
1295
 
      apptype = tvb_get_ntohs(tvb, offset);
1296
 
      offset += 2;
1297
 
      ext_len -= 2;
1298
 
      switch(apptype) {
1299
 
        case 0x0401:
1300
 
          if (ext_len < 5)
1301
 
            break;
1302
 
          proto_tree_add_item(ext_tree, hf_a11_vse_panid, tvb, offset, 5, FALSE);
1303
 
          offset += 5;
1304
 
          ext_len -= 5;
1305
 
          if (ext_len < 5)
1306
 
            break;
1307
 
          proto_tree_add_item(ext_tree, hf_a11_vse_canid, tvb, offset, 5, FALSE);
1308
 
          break;
1309
 
        case 0x0501:
1310
 
          if (ext_len < 4)
1311
 
            break;
1312
 
          proto_tree_add_item(ext_tree, hf_a11_vse_ppaddr, tvb, offset, 4, FALSE);
1313
 
          break;
1314
 
        case 0x0601:
1315
 
          if (ext_len < 2)
1316
 
            break;
1317
 
          proto_tree_add_item(ext_tree, hf_a11_vse_dormant, tvb, offset, 2, FALSE);
1318
 
          break;
1319
 
        case 0x0701:
1320
 
          if (ext_len < 1)
1321
 
            break;
1322
 
          proto_tree_add_item(ext_tree, hf_a11_vse_code, tvb, offset, 1, FALSE);
1323
 
          break;
1324
 
        case 0x0801:
1325
 
          if (ext_len < 1)
1326
 
            break;
1327
 
          proto_tree_add_item(ext_tree, hf_a11_vse_pdit, tvb, offset, 1, FALSE);
1328
 
          break;
1329
 
        case 0x0802:
1330
 
          proto_tree_add_text(ext_tree, tvb, offset, -1, "Session Parameter - Always On");
1331
 
          break;
1332
 
        case 0x0803:
1333
 
          proto_tree_add_item(ext_tree, hf_a11_vse_qosmode, tvb, offset, 1, FALSE);
1334
 
          break;
1335
 
        case 0x0901:
1336
 
          if (ext_len < 2)
1337
 
            break;
1338
 
          proto_tree_add_item(ext_tree, hf_a11_vse_srvopt, tvb, offset, 2, FALSE);
1339
 
          break;
1340
 
        case 0x0C01:
1341
 
          dissect_ase(tvb, offset, ext_len, ext_tree);
1342
 
          break;
1343
 
        case 0x0D01:
1344
 
          dissect_fwd_qosinfo(tvb, offset, ext_tree);
1345
 
          break;
1346
 
        case 0x0D02:
1347
 
          dissect_rev_qosinfo(tvb, offset, ext_tree);
1348
 
          break;
1349
 
        case 0x0D03:
1350
 
          dissect_subscriber_qos_profile(tvb, offset, ext_len, ext_tree);
1351
 
          break;
1352
 
        case 0x0DFE:
1353
 
          dissect_fwd_qosupdate_info(tvb, offset, ext_tree);
1354
 
          break;
1355
 
        case 0x0DFF:
1356
 
          dissect_rev_qosupdate_info(tvb, offset, ext_tree);
1357
 
          break;
1358
 
      }
1359
 
 
1360
 
      break;
1361
 
    case MF_CHALLENGE_EXT:  /* RFC 3012 */
1362
 
      /* The default dissector is good here.  The challenge is all hex anyway. */
1363
 
    default:
1364
 
      proto_tree_add_item(ext_tree, hf_a11_ext, tvb, offset, ext_len, FALSE);
1365
 
      break;
1366
 
    } /* ext type */
1367
 
 
1368
 
    offset += ext_len;
1369
 
  } /* while data remaining */
 
1152
    proto_item   *ti;
 
1153
    proto_tree   *exts_tree;
 
1154
    proto_tree   *ext_tree;
 
1155
    guint         ext_len;
 
1156
    guint8        ext_type;
 
1157
    guint8        ext_subtype = 0;
 
1158
    guint         hdrLen;
 
1159
 
 
1160
    gint16       apptype = -1;
 
1161
 
 
1162
    /* None of this really matters if we don't have a tree */
 
1163
    if (!tree) return;
 
1164
 
 
1165
    /* Add our tree, if we have extensions */
 
1166
    ti = proto_tree_add_text(tree, tvb, offset, -1, "Extensions");
 
1167
    exts_tree = proto_item_add_subtree(ti, ett_a11_exts);
 
1168
 
 
1169
    /* And, handle each extension */
 
1170
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
 
1171
 
 
1172
        /* Get our extension info */
 
1173
        ext_type = tvb_get_guint8(tvb, offset);
 
1174
        if (ext_type == GEN_AUTH_EXT) {
 
1175
            /*
 
1176
             * Very nasty . . breaks normal extensions, since the length is
 
1177
             * in the wrong place :(
 
1178
             */
 
1179
            ext_subtype = tvb_get_guint8(tvb, offset + 1);
 
1180
            ext_len = tvb_get_ntohs(tvb, offset + 2);
 
1181
            hdrLen = 4;
 
1182
        } else if ((ext_type == CVSE_EXT) || (ext_type == OLD_CVSE_EXT)) {
 
1183
            ext_len = tvb_get_ntohs(tvb, offset + 2);
 
1184
            ext_subtype = tvb_get_guint8(tvb, offset + 8);
 
1185
            hdrLen = 4;
 
1186
        } else {
 
1187
            ext_len = tvb_get_guint8(tvb, offset + 1);
 
1188
            hdrLen = 2;
 
1189
        }
 
1190
 
 
1191
        ti = proto_tree_add_text(exts_tree, tvb, offset, ext_len + hdrLen,
 
1192
                                 "Extension: %s",
 
1193
                                 val_to_str(ext_type, a11_ext_types,
 
1194
                                            "Unknown Extension %u"));
 
1195
        ext_tree = proto_item_add_subtree(ti, ett_a11_ext);
 
1196
 
 
1197
        proto_tree_add_item(ext_tree, hf_a11_ext_type, tvb, offset, 1, ext_type);
 
1198
        offset++;
 
1199
 
 
1200
        if (ext_type == SS_EXT) {
 
1201
            proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len);
 
1202
            offset++;
 
1203
        }
 
1204
        else if((ext_type == CVSE_EXT) || (ext_type == OLD_CVSE_EXT)) {
 
1205
            offset++;
 
1206
            proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 2, ext_len);
 
1207
            offset+=2;
 
1208
        }
 
1209
        else if (ext_type != GEN_AUTH_EXT) {
 
1210
            /* Another nasty hack since GEN_AUTH_EXT broke everything */
 
1211
            proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len);
 
1212
            offset++;
 
1213
        }
 
1214
 
 
1215
        switch(ext_type) {
 
1216
        case SS_EXT:
 
1217
            decode_sse(ext_tree, tvb, offset, ext_len);
 
1218
            offset += ext_len;
 
1219
            ext_len = 0;
 
1220
            break;
 
1221
 
 
1222
        case MH_AUTH_EXT:
 
1223
        case MF_AUTH_EXT:
 
1224
        case FH_AUTH_EXT:
 
1225
        case RU_AUTH_EXT:
 
1226
            /* All these extensions look the same.  4 byte SPI followed by a key */
 
1227
            if (ext_len < 4)
 
1228
                break;
 
1229
            proto_tree_add_item(ext_tree, hf_a11_aext_spi, tvb, offset, 4, FALSE);
 
1230
            offset += 4;
 
1231
            ext_len -= 4;
 
1232
            if (ext_len == 0)
 
1233
                break;
 
1234
            proto_tree_add_item(ext_tree, hf_a11_aext_auth, tvb, offset, ext_len,
 
1235
                                FALSE);
 
1236
            break;
 
1237
        case MN_NAI_EXT:
 
1238
            if (ext_len == 0)
 
1239
                break;
 
1240
            proto_tree_add_item(ext_tree, hf_a11_next_nai, tvb, offset,
 
1241
                                ext_len, FALSE);
 
1242
            break;
 
1243
 
 
1244
        case GEN_AUTH_EXT:      /* RFC 3012 */
 
1245
            /*
 
1246
             * Very nasty . . breaks normal extensions, since the length is
 
1247
             * in the wrong place :(
 
1248
             */
 
1249
            proto_tree_add_uint(ext_tree, hf_a11_ext_stype, tvb, offset, 1, ext_subtype);
 
1250
            offset++;
 
1251
            proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 2, ext_len);
 
1252
            offset+=2;
 
1253
            /* SPI */
 
1254
            if (ext_len < 4)
 
1255
                break;
 
1256
            proto_tree_add_item(ext_tree, hf_a11_aext_spi, tvb, offset, 4, FALSE);
 
1257
            offset += 4;
 
1258
            ext_len -= 4;
 
1259
            /* Key */
 
1260
            if (ext_len == 0)
 
1261
                break;
 
1262
            proto_tree_add_item(ext_tree, hf_a11_aext_auth, tvb, offset,
 
1263
                                ext_len, FALSE);
 
1264
 
 
1265
            break;
 
1266
        case OLD_CVSE_EXT:      /* RFC 3115 */
 
1267
        case CVSE_EXT:          /* RFC 3115 */
 
1268
            if (ext_len < 4)
 
1269
                break;
 
1270
            proto_tree_add_item(ext_tree, hf_a11_vse_vid, tvb, offset, 4, FALSE);
 
1271
            offset += 4;
 
1272
            ext_len -= 4;
 
1273
            if (ext_len < 2)
 
1274
                break;
 
1275
            apptype = tvb_get_ntohs(tvb, offset);
 
1276
            proto_tree_add_uint(ext_tree, hf_a11_vse_apptype, tvb, offset, 2, apptype);
 
1277
            offset += 2;
 
1278
            ext_len -= 2;
 
1279
            if(apptype == 0x0101) {
 
1280
                if (tvb_reported_length_remaining(tvb, offset) > 0) {
 
1281
                    dissect_a11_radius(tvb, offset, ext_tree, ext_len + 2);
 
1282
                }
 
1283
            }
 
1284
            break;
 
1285
        case OLD_NVSE_EXT:      /* RFC 3115 */
 
1286
        case NVSE_EXT:          /* RFC 3115 */
 
1287
            if (ext_len < 6)
 
1288
                break;
 
1289
            proto_tree_add_item(ext_tree, hf_a11_vse_vid, tvb, offset+2, 4, FALSE);
 
1290
            offset += 6;
 
1291
            ext_len -= 6;
 
1292
            proto_tree_add_item(ext_tree, hf_a11_vse_apptype, tvb, offset, 2, FALSE);
 
1293
 
 
1294
            if (ext_len < 2)
 
1295
                break;
 
1296
            apptype = tvb_get_ntohs(tvb, offset);
 
1297
            offset += 2;
 
1298
            ext_len -= 2;
 
1299
            switch(apptype) {
 
1300
            case 0x0401:
 
1301
                if (ext_len < 5)
 
1302
                    break;
 
1303
                proto_tree_add_item(ext_tree, hf_a11_vse_panid, tvb, offset, 5, FALSE);
 
1304
                offset += 5;
 
1305
                ext_len -= 5;
 
1306
                if (ext_len < 5)
 
1307
                    break;
 
1308
                proto_tree_add_item(ext_tree, hf_a11_vse_canid, tvb, offset, 5, FALSE);
 
1309
                break;
 
1310
            case 0x0501:
 
1311
                if (ext_len < 4)
 
1312
                    break;
 
1313
                proto_tree_add_item(ext_tree, hf_a11_vse_ppaddr, tvb, offset, 4, FALSE);
 
1314
                break;
 
1315
            case 0x0601:
 
1316
                if (ext_len < 2)
 
1317
                    break;
 
1318
                proto_tree_add_item(ext_tree, hf_a11_vse_dormant, tvb, offset, 2, FALSE);
 
1319
                break;
 
1320
            case 0x0701:
 
1321
                if (ext_len < 1)
 
1322
                    break;
 
1323
                proto_tree_add_item(ext_tree, hf_a11_vse_code, tvb, offset, 1, FALSE);
 
1324
                break;
 
1325
            case 0x0801:
 
1326
                if (ext_len < 1)
 
1327
                    break;
 
1328
                proto_tree_add_item(ext_tree, hf_a11_vse_pdit, tvb, offset, 1, FALSE);
 
1329
                break;
 
1330
            case 0x0802:
 
1331
                proto_tree_add_text(ext_tree, tvb, offset, -1, "Session Parameter - Always On");
 
1332
                break;
 
1333
            case 0x0803:
 
1334
                proto_tree_add_item(ext_tree, hf_a11_vse_qosmode, tvb, offset, 1, FALSE);
 
1335
                break;
 
1336
            case 0x0901:
 
1337
                if (ext_len < 2)
 
1338
                    break;
 
1339
                proto_tree_add_item(ext_tree, hf_a11_vse_srvopt, tvb, offset, 2, FALSE);
 
1340
                break;
 
1341
            case 0x0C01:
 
1342
                dissect_ase(tvb, offset, ext_len, ext_tree);
 
1343
                break;
 
1344
            case 0x0D01:
 
1345
                dissect_fwd_qosinfo(tvb, offset, ext_tree);
 
1346
                break;
 
1347
            case 0x0D02:
 
1348
                dissect_rev_qosinfo(tvb, offset, ext_tree);
 
1349
                break;
 
1350
            case 0x0D03:
 
1351
                dissect_subscriber_qos_profile(tvb, offset, ext_len, ext_tree);
 
1352
                break;
 
1353
            case 0x0DFE:
 
1354
                dissect_fwd_qosupdate_info(tvb, offset, ext_tree);
 
1355
                break;
 
1356
            case 0x0DFF:
 
1357
                dissect_rev_qosupdate_info(tvb, offset, ext_tree);
 
1358
                break;
 
1359
            }
 
1360
 
 
1361
            break;
 
1362
        case MF_CHALLENGE_EXT:  /* RFC 3012 */
 
1363
            /* The default dissector is good here.  The challenge is all hex anyway. */
 
1364
        default:
 
1365
            proto_tree_add_item(ext_tree, hf_a11_ext, tvb, offset, ext_len, FALSE);
 
1366
            break;
 
1367
        } /* ext type */
 
1368
 
 
1369
        offset += ext_len;
 
1370
    } /* while data remaining */
1370
1371
 
1371
1372
} /* dissect_a11_extensions */
1372
1373
 
1374
1375
static int
1375
1376
dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1376
1377
{
1377
 
  /* Set up structures we will need to add the protocol subtree and manage it */
1378
 
  proto_item    *ti;
1379
 
  proto_tree    *a11_tree=NULL;
1380
 
  proto_item    *tf;
1381
 
  proto_tree    *flags_tree;
1382
 
  guint8         type;
1383
 
  guint8         flags;
1384
 
  guint          offset=0;
1385
 
  const guint8  *reftime;
1386
 
 
1387
 
  if (!tvb_bytes_exist(tvb, offset, 1))
1388
 
        return 0;       /* not enough data to check message type */
1389
 
 
1390
 
  type = tvb_get_guint8(tvb, offset);
1391
 
  if (match_strval(type, a11_types) == NULL)
1392
 
        return 0;       /* not a known message type */
1393
 
 
1394
 
  /* Make entries in Protocol column and Info column on summary display */
1395
 
 
1396
 
  if (check_col(pinfo->cinfo, COL_PROTOCOL))
1397
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "3GPP2 A11");
1398
 
  if (check_col(pinfo->cinfo, COL_INFO))
1399
 
        col_clear(pinfo->cinfo, COL_INFO);
1400
 
 
1401
 
  switch (type) {
1402
 
  case REGISTRATION_REQUEST:
1403
 
        if (check_col(pinfo->cinfo, COL_INFO))
1404
 
          col_add_fstr(pinfo->cinfo, COL_INFO, "Reg Request: PDSN=%s PCF=%s",
1405
 
                                   ip_to_str(tvb_get_ptr(tvb, 8, 4)),
1406
 
                                   ip_to_str(tvb_get_ptr(tvb,12,4)));
1407
 
 
1408
 
        if (tree) {
1409
 
          ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
1410
 
          a11_tree = proto_item_add_subtree(ti, ett_a11);
1411
 
 
1412
 
          /* type */
1413
 
          proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
1414
 
          offset++;
1415
 
 
1416
 
          /* flags */
1417
 
          flags = tvb_get_guint8(tvb, offset);
1418
 
          tf = proto_tree_add_uint(a11_tree, hf_a11_flags, tvb,
1419
 
                                                           offset, 1, flags);
1420
 
          flags_tree = proto_item_add_subtree(tf, ett_a11_flags);
1421
 
          proto_tree_add_boolean(flags_tree, hf_a11_s, tvb, offset, 1, flags);
1422
 
          proto_tree_add_boolean(flags_tree, hf_a11_b, tvb, offset, 1, flags);
1423
 
          proto_tree_add_boolean(flags_tree, hf_a11_d, tvb, offset, 1, flags);
1424
 
          proto_tree_add_boolean(flags_tree, hf_a11_m, tvb, offset, 1, flags);
1425
 
          proto_tree_add_boolean(flags_tree, hf_a11_g, tvb, offset, 1, flags);
1426
 
          proto_tree_add_boolean(flags_tree, hf_a11_v, tvb, offset, 1, flags);
1427
 
          proto_tree_add_boolean(flags_tree, hf_a11_t, tvb, offset, 1, flags);
1428
 
          offset++;
1429
 
 
1430
 
          /* lifetime */
1431
 
          proto_tree_add_item(a11_tree, hf_a11_life, tvb, offset, 2, FALSE);
1432
 
          offset +=2;
1433
 
 
1434
 
          /* home address */
1435
 
          proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
1436
 
          offset += 4;
1437
 
 
1438
 
          /* home agent address */
1439
 
          proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
1440
 
          offset += 4;
1441
 
 
1442
 
          /* Care of Address */
1443
 
          proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
1444
 
          offset += 4;
1445
 
 
1446
 
          /* Identifier - assumed to be an NTP time here */
1447
 
          reftime = tvb_get_ptr(tvb, offset, 8);
1448
 
          proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
1449
 
                                            offset, 8, reftime,
1450
 
                                            "%s",
1451
 
                                            ntp_fmt_ts(reftime));
1452
 
          offset += 8;
1453
 
 
1454
 
        } /* if tree */
1455
 
        break;
1456
 
  case REGISTRATION_REPLY:
1457
 
        if (check_col(pinfo->cinfo, COL_INFO))
1458
 
          col_add_fstr(pinfo->cinfo, COL_INFO, "Reg Reply:   PDSN=%s, Code=%u",
1459
 
                                   ip_to_str(tvb_get_ptr(tvb,8,4)), tvb_get_guint8(tvb,1));
1460
 
 
1461
 
        if (tree) {
1462
 
          /* Add Subtree */
1463
 
          ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
1464
 
          a11_tree = proto_item_add_subtree(ti, ett_a11);
1465
 
 
1466
 
          /* Type */
1467
 
          proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
1468
 
          offset++;
1469
 
 
1470
 
          /* Reply Code */
1471
 
          proto_tree_add_item(a11_tree, hf_a11_code, tvb, offset, 1, FALSE);
1472
 
          offset++;
1473
 
 
1474
 
          /* Registration Lifetime */
1475
 
          proto_tree_add_item(a11_tree, hf_a11_life, tvb, offset, 2, FALSE);
1476
 
          offset += 2;
1477
 
 
1478
 
          /* Home address */
1479
 
          proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
1480
 
          offset += 4;
1481
 
 
1482
 
          /* Home Agent Address */
1483
 
          proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
1484
 
          offset += 4;
1485
 
 
1486
 
          /* Identifier - assumed to be an NTP time here */
1487
 
          reftime = tvb_get_ptr(tvb, offset, 8);
1488
 
          proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
1489
 
                                            offset, 8,
1490
 
                                            reftime,
1491
 
                                            "%s",
1492
 
                                            ntp_fmt_ts(reftime));
1493
 
          offset += 8;
1494
 
        } /* if tree */
1495
 
 
1496
 
        break;
1497
 
  case REGISTRATION_UPDATE:
1498
 
        if (check_col(pinfo->cinfo, COL_INFO))
1499
 
          col_add_fstr(pinfo->cinfo, COL_INFO,"Reg Update:  PDSN=%s",
1500
 
                                   ip_to_str(tvb_get_ptr(tvb,8,4)));
1501
 
        if (tree) {
1502
 
          /* Add Subtree */
1503
 
          ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
1504
 
          a11_tree = proto_item_add_subtree(ti, ett_a11);
1505
 
 
1506
 
          /* Type */
1507
 
          proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
1508
 
          offset++;
1509
 
 
1510
 
          /* Reserved */
1511
 
          offset+=3;
1512
 
 
1513
 
          /* Home address */
1514
 
          proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
1515
 
          offset += 4;
1516
 
 
1517
 
          /* Home Agent Address */
1518
 
          proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
1519
 
          offset += 4;
1520
 
 
1521
 
          /* Identifier - assumed to be an NTP time here */
1522
 
          reftime = tvb_get_ptr(tvb, offset, 8);
1523
 
          proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
1524
 
                                            offset, 8,
1525
 
                                            reftime,
1526
 
                                            "%s",
1527
 
                                            ntp_fmt_ts(reftime));
1528
 
          offset += 8;
1529
 
 
1530
 
        } /* if tree */
1531
 
        break;
1532
 
  case REGISTRATION_ACK:
1533
 
        if (check_col(pinfo->cinfo, COL_INFO))
1534
 
          col_add_fstr(pinfo->cinfo, COL_INFO, "Reg Ack:     PCF=%s Status=%u",
1535
 
                                   ip_to_str(tvb_get_ptr(tvb, 8, 4)),
1536
 
                                   tvb_get_guint8(tvb,3));
1537
 
        if (tree) {
1538
 
          /* Add Subtree */
1539
 
          ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
1540
 
          a11_tree = proto_item_add_subtree(ti, ett_a11);
1541
 
 
1542
 
          /* Type */
1543
 
          proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
1544
 
          offset++;
1545
 
 
1546
 
          /* Reserved */
1547
 
          offset+=2;
1548
 
 
1549
 
          /* Ack Status */
1550
 
          proto_tree_add_item(a11_tree, hf_a11_status, tvb, offset, 1, FALSE);
1551
 
          offset++;
1552
 
 
1553
 
          /* Home address */
1554
 
          proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
1555
 
          offset += 4;
1556
 
 
1557
 
          /* Care of Address */
1558
 
          proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
1559
 
          offset += 4;
1560
 
 
1561
 
          /* Identifier - assumed to be an NTP time here */
1562
 
          reftime = tvb_get_ptr(tvb, offset, 8);
1563
 
          proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
1564
 
                                            offset, 8,
1565
 
                                            reftime,
1566
 
                                            "%s",
1567
 
                                            ntp_fmt_ts(reftime));
1568
 
          offset += 8;
1569
 
 
1570
 
        } /* if tree */
1571
 
        break;
1572
 
  case SESSION_UPDATE: /* IOS4.3 */
1573
 
        if (check_col(pinfo->cinfo, COL_INFO))
1574
 
          col_add_fstr(pinfo->cinfo, COL_INFO,"Ses Update:  PDSN=%s",
1575
 
                                   ip_to_str(tvb_get_ptr(tvb,8,4)));
1576
 
        if (tree) {
1577
 
          /* Add Subtree */
1578
 
          ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
1579
 
          a11_tree = proto_item_add_subtree(ti, ett_a11);
1580
 
 
1581
 
          /* Type */
1582
 
          proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
1583
 
          offset++;
1584
 
 
1585
 
          /* Reserved */
1586
 
          offset+=3;
1587
 
 
1588
 
          /* Home address */
1589
 
          proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
1590
 
          offset += 4;
1591
 
 
1592
 
          /* Home Agent Address */
1593
 
          proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
1594
 
          offset += 4;
1595
 
 
1596
 
          /* Identifier - assumed to be an NTP time here */
1597
 
          reftime = tvb_get_ptr(tvb, offset, 8);
1598
 
          proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
1599
 
                                            offset, 8,
1600
 
                                            reftime,
1601
 
                                            "%s",
1602
 
                                            ntp_fmt_ts(reftime));
1603
 
          offset += 8;
1604
 
 
1605
 
        } /* if tree */
1606
 
        break;
1607
 
  case SESSION_ACK: /* IOS4.3 */
1608
 
        if (check_col(pinfo->cinfo, COL_INFO))
1609
 
          col_add_fstr(pinfo->cinfo, COL_INFO, "Ses Upd Ack: PCF=%s, Status=%u",
1610
 
                                   ip_to_str(tvb_get_ptr(tvb, 8, 4)),
1611
 
                                   tvb_get_guint8(tvb,3));
1612
 
        if (tree) {
1613
 
          /* Add Subtree */
1614
 
          ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
1615
 
          a11_tree = proto_item_add_subtree(ti, ett_a11);
1616
 
 
1617
 
          /* Type */
1618
 
          proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
1619
 
          offset++;
1620
 
 
1621
 
          /* Reserved */
1622
 
          offset+=2;
1623
 
 
1624
 
          /* Ack Status */
1625
 
          proto_tree_add_item(a11_tree, hf_a11_status, tvb, offset, 1, FALSE);
1626
 
          offset++;
1627
 
 
1628
 
          /* Home address */
1629
 
          proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
1630
 
          offset += 4;
1631
 
 
1632
 
          /* Care of Address */
1633
 
          proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
1634
 
          offset += 4;
1635
 
 
1636
 
          /* Identifier - assumed to be an NTP time here */
1637
 
          reftime = tvb_get_ptr(tvb, offset, 8);
1638
 
          proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
1639
 
                                            offset, 8,
1640
 
                                            reftime,
1641
 
                                            "%s",
1642
 
                                            ntp_fmt_ts(reftime));
1643
 
          offset += 8;
1644
 
 
1645
 
        } /* if tree */
1646
 
        break;
1647
 
  case CAPABILITIES_INFO: /* IOS5.1 */
1648
 
        if (check_col(pinfo->cinfo, COL_INFO))
1649
 
          col_add_fstr(pinfo->cinfo, COL_INFO, "Cap Info: PDSN=%s, PCF=%s",
1650
 
                                   ip_to_str(tvb_get_ptr(tvb, 8, 4)),
1651
 
                                   ip_to_str(tvb_get_ptr(tvb,12,4)));
1652
 
        if (tree) {
1653
 
          /* Add Subtree */
1654
 
          ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
1655
 
          a11_tree = proto_item_add_subtree(ti, ett_a11);
1656
 
 
1657
 
          /* Type */
1658
 
          proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
1659
 
          offset++;
1660
 
 
1661
 
          /* Reserved */
1662
 
          offset+=3;
1663
 
 
1664
 
          /* Home address */
1665
 
          proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
1666
 
          offset += 4;
1667
 
 
1668
 
          /* Home Agent Address */
1669
 
          proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
1670
 
          offset += 4;
1671
 
 
1672
 
          /* Care of Address */
1673
 
          proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
1674
 
          offset += 4;
1675
 
 
1676
 
          /* Identifier - assumed to be an NTP time here */
1677
 
          reftime = tvb_get_ptr(tvb, offset, 8);
1678
 
          proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
1679
 
                                            offset, 8,
1680
 
                                            reftime,
1681
 
                                            "%s",
1682
 
                                            ntp_fmt_ts(reftime));
1683
 
          offset += 8;
1684
 
 
1685
 
        } /* if tree */
1686
 
        break;
1687
 
  case CAPABILITIES_INFO_ACK: /* IOS5.1 */
1688
 
        if (check_col(pinfo->cinfo, COL_INFO))
1689
 
          col_add_fstr(pinfo->cinfo, COL_INFO, "Cap Info Ack: PCF=%s",
1690
 
                                   ip_to_str(tvb_get_ptr(tvb, 8, 4)));
1691
 
        if (tree) {
1692
 
          /* Add Subtree */
1693
 
          ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
1694
 
          a11_tree = proto_item_add_subtree(ti, ett_a11);
1695
 
 
1696
 
          /* Type */
1697
 
          proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
1698
 
          offset++;
1699
 
 
1700
 
          /* Reserved */
1701
 
          offset+=3;
1702
 
 
1703
 
          /* Home address */
1704
 
          proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
1705
 
          offset += 4;
1706
 
 
1707
 
          /* Care of Address */
1708
 
          proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
1709
 
          offset += 4;
1710
 
 
1711
 
          /* Identifier - assumed to be an NTP time here */
1712
 
          reftime = tvb_get_ptr(tvb, offset, 8);
1713
 
          proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
1714
 
                                            offset, 8,
1715
 
                                            reftime,
1716
 
                                            "%s",
1717
 
                                            ntp_fmt_ts(reftime));
1718
 
          offset += 8;
1719
 
 
1720
 
        } /* if tree */
1721
 
        break;
1722
 
  } /* End switch */
1723
 
 
1724
 
  if (tree) {
1725
 
        if (tvb_reported_length_remaining(tvb, offset) > 0)
1726
 
          dissect_a11_extensions(tvb, offset, a11_tree);
1727
 
  }
1728
 
  return tvb_length(tvb);
 
1378
    /* Set up structures we will need to add the protocol subtree and manage it */
 
1379
    proto_item   *ti;
 
1380
    proto_tree   *a11_tree;
 
1381
    proto_item   *tf;
 
1382
    proto_tree   *flags_tree;
 
1383
    guint8        type;
 
1384
    guint8        flags;
 
1385
    guint         offset=0;
 
1386
    const guint8 *reftime;
 
1387
 
 
1388
    if (!tvb_bytes_exist(tvb, offset, 1))
 
1389
        return 0;       /* not enough data to check message type */
 
1390
 
 
1391
    type = tvb_get_guint8(tvb, offset);
 
1392
    if (match_strval(type, a11_types) == NULL)
 
1393
        return 0;       /* not a known message type */
 
1394
 
 
1395
    /* Make entries in Protocol column and Info column on summary display */
 
1396
 
 
1397
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "3GPP2 A11");
 
1398
    col_clear(pinfo->cinfo, COL_INFO);
 
1399
 
 
1400
    switch (type) {
 
1401
    case REGISTRATION_REQUEST:
 
1402
        col_add_fstr(pinfo->cinfo, COL_INFO, "Reg Request: PDSN=%s PCF=%s",
 
1403
                     ip_to_str(tvb_get_ptr(tvb, 8, 4)),
 
1404
                     ip_to_str(tvb_get_ptr(tvb,12,4)));
 
1405
 
 
1406
        if (tree) {
 
1407
            ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
 
1408
            a11_tree = proto_item_add_subtree(ti, ett_a11);
 
1409
 
 
1410
            /* type */
 
1411
            proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
 
1412
            offset++;
 
1413
 
 
1414
            /* flags */
 
1415
            flags = tvb_get_guint8(tvb, offset);
 
1416
            tf = proto_tree_add_uint(a11_tree, hf_a11_flags, tvb,
 
1417
                                     offset, 1, flags);
 
1418
            flags_tree = proto_item_add_subtree(tf, ett_a11_flags);
 
1419
            proto_tree_add_boolean(flags_tree, hf_a11_s, tvb, offset, 1, flags);
 
1420
            proto_tree_add_boolean(flags_tree, hf_a11_b, tvb, offset, 1, flags);
 
1421
            proto_tree_add_boolean(flags_tree, hf_a11_d, tvb, offset, 1, flags);
 
1422
            proto_tree_add_boolean(flags_tree, hf_a11_m, tvb, offset, 1, flags);
 
1423
            proto_tree_add_boolean(flags_tree, hf_a11_g, tvb, offset, 1, flags);
 
1424
            proto_tree_add_boolean(flags_tree, hf_a11_v, tvb, offset, 1, flags);
 
1425
            proto_tree_add_boolean(flags_tree, hf_a11_t, tvb, offset, 1, flags);
 
1426
            offset++;
 
1427
 
 
1428
            /* lifetime */
 
1429
            proto_tree_add_item(a11_tree, hf_a11_life, tvb, offset, 2, FALSE);
 
1430
            offset +=2;
 
1431
 
 
1432
            /* home address */
 
1433
            proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
 
1434
            offset += 4;
 
1435
 
 
1436
            /* home agent address */
 
1437
            proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
 
1438
            offset += 4;
 
1439
 
 
1440
            /* Care of Address */
 
1441
            proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
 
1442
            offset += 4;
 
1443
 
 
1444
            /* Identifier - assumed to be an NTP time here */
 
1445
            reftime = tvb_get_ptr(tvb, offset, 8);
 
1446
            proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
 
1447
                                              offset, 8, reftime,
 
1448
                                              "%s",
 
1449
                                              ntp_fmt_ts(reftime));
 
1450
            offset += 8;
 
1451
 
 
1452
        } /* if tree */
 
1453
        break;
 
1454
    case REGISTRATION_REPLY:
 
1455
        col_add_fstr(pinfo->cinfo, COL_INFO, "Reg Reply:   PDSN=%s, Code=%u",
 
1456
                      ip_to_str(tvb_get_ptr(tvb,8,4)), tvb_get_guint8(tvb,1));
 
1457
 
 
1458
        if (tree) {
 
1459
            /* Add Subtree */
 
1460
            ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
 
1461
            a11_tree = proto_item_add_subtree(ti, ett_a11);
 
1462
 
 
1463
            /* Type */
 
1464
            proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
 
1465
            offset++;
 
1466
 
 
1467
            /* Reply Code */
 
1468
            proto_tree_add_item(a11_tree, hf_a11_code, tvb, offset, 1, FALSE);
 
1469
            offset++;
 
1470
 
 
1471
            /* Registration Lifetime */
 
1472
            proto_tree_add_item(a11_tree, hf_a11_life, tvb, offset, 2, FALSE);
 
1473
            offset += 2;
 
1474
 
 
1475
            /* Home address */
 
1476
            proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
 
1477
            offset += 4;
 
1478
 
 
1479
            /* Home Agent Address */
 
1480
            proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
 
1481
            offset += 4;
 
1482
 
 
1483
            /* Identifier - assumed to be an NTP time here */
 
1484
            reftime = tvb_get_ptr(tvb, offset, 8);
 
1485
            proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
 
1486
                                              offset, 8,
 
1487
                                              reftime,
 
1488
                                              "%s",
 
1489
                                              ntp_fmt_ts(reftime));
 
1490
            offset += 8;
 
1491
        } /* if tree */
 
1492
 
 
1493
        break;
 
1494
    case REGISTRATION_UPDATE:
 
1495
        col_add_fstr(pinfo->cinfo, COL_INFO,"Reg Update:  PDSN=%s",
 
1496
                     ip_to_str(tvb_get_ptr(tvb,8,4)));
 
1497
        if (tree) {
 
1498
            /* Add Subtree */
 
1499
            ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
 
1500
            a11_tree = proto_item_add_subtree(ti, ett_a11);
 
1501
 
 
1502
            /* Type */
 
1503
            proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
 
1504
            offset++;
 
1505
 
 
1506
            /* Reserved */
 
1507
            offset+=3;
 
1508
 
 
1509
            /* Home address */
 
1510
            proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
 
1511
            offset += 4;
 
1512
 
 
1513
            /* Home Agent Address */
 
1514
            proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
 
1515
            offset += 4;
 
1516
 
 
1517
            /* Identifier - assumed to be an NTP time here */
 
1518
            reftime = tvb_get_ptr(tvb, offset, 8);
 
1519
            proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
 
1520
                                              offset, 8,
 
1521
                                              reftime,
 
1522
                                              "%s",
 
1523
                                              ntp_fmt_ts(reftime));
 
1524
            offset += 8;
 
1525
 
 
1526
        } /* if tree */
 
1527
        break;
 
1528
    case REGISTRATION_ACK:
 
1529
        col_add_fstr(pinfo->cinfo, COL_INFO, "Reg Ack:     PCF=%s Status=%u",
 
1530
                     ip_to_str(tvb_get_ptr(tvb, 8, 4)),
 
1531
                     tvb_get_guint8(tvb,3));
 
1532
        if (tree) {
 
1533
            /* Add Subtree */
 
1534
            ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
 
1535
            a11_tree = proto_item_add_subtree(ti, ett_a11);
 
1536
 
 
1537
            /* Type */
 
1538
            proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
 
1539
            offset++;
 
1540
 
 
1541
            /* Reserved */
 
1542
            offset+=2;
 
1543
 
 
1544
            /* Ack Status */
 
1545
            proto_tree_add_item(a11_tree, hf_a11_status, tvb, offset, 1, FALSE);
 
1546
            offset++;
 
1547
 
 
1548
            /* Home address */
 
1549
            proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
 
1550
            offset += 4;
 
1551
 
 
1552
            /* Care of Address */
 
1553
            proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
 
1554
            offset += 4;
 
1555
 
 
1556
            /* Identifier - assumed to be an NTP time here */
 
1557
            reftime = tvb_get_ptr(tvb, offset, 8);
 
1558
            proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
 
1559
                                              offset, 8,
 
1560
                                              reftime,
 
1561
                                              "%s",
 
1562
                                              ntp_fmt_ts(reftime));
 
1563
            offset += 8;
 
1564
 
 
1565
        } /* if tree */
 
1566
        break;
 
1567
    case SESSION_UPDATE: /* IOS4.3 */
 
1568
        col_add_fstr(pinfo->cinfo, COL_INFO,"Ses Update:  PDSN=%s",
 
1569
                     ip_to_str(tvb_get_ptr(tvb,8,4)));
 
1570
        if (tree) {
 
1571
            /* Add Subtree */
 
1572
            ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
 
1573
            a11_tree = proto_item_add_subtree(ti, ett_a11);
 
1574
 
 
1575
            /* Type */
 
1576
            proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
 
1577
            offset++;
 
1578
 
 
1579
            /* Reserved */
 
1580
            offset+=3;
 
1581
 
 
1582
            /* Home address */
 
1583
            proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
 
1584
            offset += 4;
 
1585
 
 
1586
            /* Home Agent Address */
 
1587
            proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
 
1588
            offset += 4;
 
1589
 
 
1590
            /* Identifier - assumed to be an NTP time here */
 
1591
            reftime = tvb_get_ptr(tvb, offset, 8);
 
1592
            proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
 
1593
                                              offset, 8,
 
1594
                                              reftime,
 
1595
                                              "%s",
 
1596
                                              ntp_fmt_ts(reftime));
 
1597
            offset += 8;
 
1598
 
 
1599
        } /* if tree */
 
1600
        break;
 
1601
    case SESSION_ACK: /* IOS4.3 */
 
1602
        col_add_fstr(pinfo->cinfo, COL_INFO, "Ses Upd Ack: PCF=%s, Status=%u",
 
1603
                     ip_to_str(tvb_get_ptr(tvb, 8, 4)),
 
1604
                     tvb_get_guint8(tvb,3));
 
1605
        if (tree) {
 
1606
            /* Add Subtree */
 
1607
            ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
 
1608
            a11_tree = proto_item_add_subtree(ti, ett_a11);
 
1609
 
 
1610
            /* Type */
 
1611
            proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
 
1612
            offset++;
 
1613
 
 
1614
            /* Reserved */
 
1615
            offset+=2;
 
1616
 
 
1617
            /* Ack Status */
 
1618
            proto_tree_add_item(a11_tree, hf_a11_status, tvb, offset, 1, FALSE);
 
1619
            offset++;
 
1620
 
 
1621
            /* Home address */
 
1622
            proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
 
1623
            offset += 4;
 
1624
 
 
1625
            /* Care of Address */
 
1626
            proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
 
1627
            offset += 4;
 
1628
 
 
1629
            /* Identifier - assumed to be an NTP time here */
 
1630
            reftime = tvb_get_ptr(tvb, offset, 8);
 
1631
            proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
 
1632
                                              offset, 8,
 
1633
                                              reftime,
 
1634
                                              "%s",
 
1635
                                              ntp_fmt_ts(reftime));
 
1636
            offset += 8;
 
1637
 
 
1638
        } /* if tree */
 
1639
        break;
 
1640
    case CAPABILITIES_INFO: /* IOS5.1 */
 
1641
        col_add_fstr(pinfo->cinfo, COL_INFO, "Cap Info: PDSN=%s, PCF=%s",
 
1642
                     ip_to_str(tvb_get_ptr(tvb, 8, 4)),
 
1643
                     ip_to_str(tvb_get_ptr(tvb,12,4)));
 
1644
        if (tree) {
 
1645
            /* Add Subtree */
 
1646
            ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
 
1647
            a11_tree = proto_item_add_subtree(ti, ett_a11);
 
1648
 
 
1649
            /* Type */
 
1650
            proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
 
1651
            offset++;
 
1652
 
 
1653
            /* Reserved */
 
1654
            offset+=3;
 
1655
 
 
1656
            /* Home address */
 
1657
            proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
 
1658
            offset += 4;
 
1659
 
 
1660
            /* Home Agent Address */
 
1661
            proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE);
 
1662
            offset += 4;
 
1663
 
 
1664
            /* Care of Address */
 
1665
            proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
 
1666
            offset += 4;
 
1667
 
 
1668
            /* Identifier - assumed to be an NTP time here */
 
1669
            reftime = tvb_get_ptr(tvb, offset, 8);
 
1670
            proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
 
1671
                                              offset, 8,
 
1672
                                              reftime,
 
1673
                                              "%s",
 
1674
                                              ntp_fmt_ts(reftime));
 
1675
            offset += 8;
 
1676
 
 
1677
        } /* if tree */
 
1678
        break;
 
1679
    case CAPABILITIES_INFO_ACK: /* IOS5.1 */
 
1680
        col_add_fstr(pinfo->cinfo, COL_INFO, "Cap Info Ack: PCF=%s",
 
1681
                     ip_to_str(tvb_get_ptr(tvb, 8, 4)));
 
1682
        if (tree) {
 
1683
            /* Add Subtree */
 
1684
            ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE);
 
1685
            a11_tree = proto_item_add_subtree(ti, ett_a11);
 
1686
 
 
1687
            /* Type */
 
1688
            proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type);
 
1689
            offset++;
 
1690
 
 
1691
            /* Reserved */
 
1692
            offset+=3;
 
1693
 
 
1694
            /* Home address */
 
1695
            proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE);
 
1696
            offset += 4;
 
1697
 
 
1698
            /* Care of Address */
 
1699
            proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE);
 
1700
            offset += 4;
 
1701
 
 
1702
            /* Identifier - assumed to be an NTP time here */
 
1703
            reftime = tvb_get_ptr(tvb, offset, 8);
 
1704
            proto_tree_add_bytes_format_value(a11_tree, hf_a11_ident, tvb,
 
1705
                                              offset, 8,
 
1706
                                              reftime,
 
1707
                                              "%s",
 
1708
                                              ntp_fmt_ts(reftime));
 
1709
            offset += 8;
 
1710
 
 
1711
        } /* if tree */
 
1712
        break;
 
1713
    default:
 
1714
        DISSECTOR_ASSERT_NOT_REACHED();
 
1715
        break;
 
1716
    } /* End switch */
 
1717
 
 
1718
    if (tree) {
 
1719
        if (tvb_reported_length_remaining(tvb, offset) > 0)
 
1720
            dissect_a11_extensions(tvb, offset, a11_tree);
 
1721
    }
 
1722
    return tvb_length(tvb);
1729
1723
} /* dissect_a11 */
1730
1724
 
1731
1725
/* Register the protocol with Wireshark */
1734
1728
{
1735
1729
 
1736
1730
/* Setup list of header fields */
1737
 
        static hf_register_info hf[] = {
1738
 
          { &hf_a11_type,
1739
 
                 { "Message Type",           "a11.type",
1740
 
                        FT_UINT8, BASE_DEC, VALS(a11_types), 0,
1741
 
                        "A11 Message type.", HFILL }
1742
 
          },
1743
 
          { &hf_a11_flags,
1744
 
                {"Flags", "a11.flags",
1745
 
                 FT_UINT8, BASE_HEX, NULL, 0x0,
1746
 
                 "", HFILL}
1747
 
          },
1748
 
          { &hf_a11_s,
1749
 
                 {"Simultaneous Bindings",           "a11.s",
1750
 
 
1751
 
                   FT_BOOLEAN, 8, NULL, 128,
1752
 
                   "Simultaneous Bindings Allowed", HFILL }
1753
 
          },
1754
 
          { &hf_a11_b,
1755
 
                 {"Broadcast Datagrams",           "a11.b",
1756
 
                   FT_BOOLEAN, 8, NULL, 64,
1757
 
                   "Broadcast Datagrams requested", HFILL }
1758
 
          },
1759
 
          { &hf_a11_d,
1760
 
                 { "Co-located Care-of Address",           "a11.d",
1761
 
                   FT_BOOLEAN, 8, NULL, 32,
1762
 
                   "MN using Co-located Care-of address", HFILL }
1763
 
          },
1764
 
          { &hf_a11_m,
1765
 
                 {"Minimal Encapsulation",           "a11.m",
1766
 
                   FT_BOOLEAN, 8, NULL, 16,
1767
 
                   "MN wants Minimal encapsulation", HFILL }
1768
 
          },
1769
 
          { &hf_a11_g,
1770
 
                 {"GRE",           "a11.g",
1771
 
                   FT_BOOLEAN, 8, NULL, 8,
1772
 
                   "MN wants GRE encapsulation", HFILL }
1773
 
          },
1774
 
          { &hf_a11_v,
1775
 
                 { "Van Jacobson",           "a11.v",
1776
 
                   FT_BOOLEAN, 8, NULL, 4,
1777
 
                   "Van Jacobson", HFILL }
1778
 
          },
1779
 
          { &hf_a11_t,
1780
 
                 { "Reverse Tunneling",           "a11.t",
1781
 
                   FT_BOOLEAN, 8, NULL, 2,
1782
 
                   "Reverse tunneling requested", HFILL }
1783
 
          },
1784
 
          { &hf_a11_code,
1785
 
                 { "Reply Code",           "a11.code",
1786
 
                        FT_UINT8, BASE_DEC, VALS(a11_reply_codes), 0,
1787
 
                        "A11 Registration Reply code.", HFILL }
1788
 
          },
1789
 
          { &hf_a11_status,
1790
 
                 { "Reply Status",           "a11.ackstat",
1791
 
                        FT_UINT8, BASE_DEC, VALS(a11_ack_status), 0,
1792
 
                        "A11 Registration Ack Status.", HFILL }
1793
 
          },
1794
 
          { &hf_a11_life,
1795
 
                 { "Lifetime",           "a11.life",
1796
 
                        FT_UINT16, BASE_DEC, NULL, 0,
1797
 
                        "A11 Registration Lifetime.", HFILL }
1798
 
          },
1799
 
          { &hf_a11_homeaddr,
1800
 
                 { "Home Address",           "a11.homeaddr",
1801
 
                        FT_IPv4, BASE_NONE, NULL, 0,
1802
 
                        "Mobile Node's home address.", HFILL }
1803
 
          },
1804
 
 
1805
 
          { &hf_a11_haaddr,
1806
 
                 { "Home Agent",           "a11.haaddr",
1807
 
                        FT_IPv4, BASE_NONE, NULL, 0,
1808
 
                        "Home agent IP Address.", HFILL }
1809
 
          },
1810
 
          { &hf_a11_coa,
1811
 
                 { "Care of Address",           "a11.coa",
1812
 
                        FT_IPv4, BASE_NONE, NULL, 0,
1813
 
                        "Care of Address.", HFILL }
1814
 
          },
1815
 
          { &hf_a11_ident,
1816
 
                 { "Identification",           "a11.ident",
1817
 
                        FT_BYTES, BASE_NONE, NULL, 0,
1818
 
                        "MN Identification.", HFILL }
1819
 
          },
1820
 
          { &hf_a11_ext_type,
1821
 
                 { "Extension Type",           "a11.ext.type",
1822
 
                        FT_UINT8, BASE_DEC, VALS(a11_ext_types), 0,
1823
 
                        "Mobile IP Extension Type.", HFILL }
1824
 
          },
1825
 
          { &hf_a11_ext_stype,
1826
 
                 { "Gen Auth Ext SubType",           "a11.ext.auth.subtype",
1827
 
                        FT_UINT8, BASE_DEC, VALS(a11_ext_stypes), 0,
1828
 
                        "Mobile IP Auth Extension Sub Type.", HFILL }
1829
 
          },
1830
 
          { &hf_a11_ext_len,
1831
 
                 { "Extension Length",         "a11.ext.len",
1832
 
                        FT_UINT16, BASE_DEC, NULL, 0,
1833
 
                        "Mobile IP Extension Length.", HFILL }
1834
 
          },
1835
 
          { &hf_a11_ext,
1836
 
                 { "Extension",                      "a11.extension",
1837
 
                        FT_BYTES, BASE_HEX, NULL, 0,
1838
 
                        "Extension", HFILL }
1839
 
          },
1840
 
          { &hf_a11_aext_spi,
1841
 
                 { "SPI",                      "a11.auth.spi",
1842
 
                        FT_UINT32, BASE_HEX, NULL, 0,
1843
 
                        "Authentication Header Security Parameter Index.", HFILL }
1844
 
          },
1845
 
          { &hf_a11_aext_auth,
1846
 
                 { "Authenticator",            "a11.auth.auth",
1847
 
                        FT_BYTES, BASE_NONE, NULL, 0,
1848
 
                        "Authenticator.", HFILL }
1849
 
          },
1850
 
          { &hf_a11_next_nai,
1851
 
                 { "NAI",                      "a11.nai",
1852
 
                        FT_STRING, BASE_NONE, NULL, 0,
1853
 
                        "NAI", HFILL }
1854
 
          },
1855
 
          { &hf_a11_ses_key,
1856
 
                 { "Key",                      "a11.ext.key",
1857
 
                        FT_UINT32, BASE_HEX, NULL, 0,
1858
 
                        "Session Key.", HFILL }
1859
 
          },
1860
 
          { &hf_a11_ses_sidver,
1861
 
                { "Session ID Version",         "a11.ext.sidver",
1862
 
                        FT_UINT8, BASE_DEC, NULL, 3,
1863
 
                        "Session ID Version", HFILL}
1864
 
          },
1865
 
          { &hf_a11_ses_mnsrid,
1866
 
                 { "MNSR-ID",                      "a11.ext.mnsrid",
1867
 
                        FT_UINT16, BASE_HEX, NULL, 0,
1868
 
                        "MNSR-ID", HFILL }
1869
 
          },
1870
 
          { &hf_a11_ses_msid_type,
1871
 
                 { "MSID Type",                      "a11.ext.msid_type",
1872
 
                        FT_UINT16, BASE_DEC, NULL, 0,
1873
 
                        "MSID Type.", HFILL }
1874
 
          },
1875
 
          { &hf_a11_ses_msid_len,
1876
 
                 { "MSID Length",                      "a11.ext.msid_len",
1877
 
                        FT_UINT8, BASE_DEC, NULL, 0,
1878
 
                        "MSID Length.", HFILL }
1879
 
          },
1880
 
          { &hf_a11_ses_msid,
1881
 
                 { "MSID(BCD)",                      "a11.ext.msid",
1882
 
                        FT_STRING, BASE_NONE, NULL, 0,
1883
 
                        "MSID(BCD).", HFILL }
1884
 
          },
1885
 
          { &hf_a11_ses_ptype,
1886
 
                 { "Protocol Type",                      "a11.ext.ptype",
1887
 
                        FT_UINT16, BASE_HEX, VALS(a11_ses_ptype_vals), 0,
1888
 
                        "Protocol Type.", HFILL }
1889
 
          },
1890
 
          { &hf_a11_vse_vid,
1891
 
                 { "Vendor ID",                      "a11.ext.vid",
1892
 
                        FT_UINT32, BASE_HEX, VALS(sminmpec_values), 0,
1893
 
                        "Vendor ID.", HFILL }
1894
 
          },
1895
 
          { &hf_a11_vse_apptype,
1896
 
                 { "Application Type",                      "a11.ext.apptype",
1897
 
                        FT_UINT8, BASE_HEX, VALS(a11_ext_app), 0,
1898
 
                        "Application Type.", HFILL }
1899
 
          },
1900
 
          { &hf_a11_vse_ppaddr,
1901
 
                 { "Anchor P-P Address",           "a11.ext.ppaddr",
1902
 
                        FT_IPv4, BASE_NONE, NULL, 0,
1903
 
                        "Anchor P-P Address.", HFILL }
1904
 
          },
1905
 
          { &hf_a11_vse_dormant,
1906
 
                 { "All Dormant Indicator",           "a11.ext.dormant",
1907
 
                        FT_UINT16, BASE_HEX, VALS(a11_ext_dormant), 0,
1908
 
                        "All Dormant Indicator.", HFILL }
1909
 
          },
1910
 
          { &hf_a11_vse_code,
1911
 
                 { "Reply Code",           "a11.ext.code",
1912
 
                        FT_UINT8, BASE_DEC, VALS(a11_reply_codes), 0,
1913
 
                        "PDSN Code.", HFILL }
1914
 
          },
1915
 
          { &hf_a11_vse_pdit,
1916
 
                 { "PDSN Code",                      "a11.ext.code",
1917
 
                        FT_UINT8, BASE_HEX, VALS(a11_ext_nvose_pdsn_code), 0,
1918
 
                        "PDSN Code.", HFILL }
1919
 
          },
1920
 
          { &hf_a11_vse_srvopt,
1921
 
                 { "Service Option",                      "a11.ext.srvopt",
1922
 
                        FT_UINT16, BASE_HEX, VALS(a11_ext_nvose_srvopt), 0,
1923
 
                        "Service Option.", HFILL }
1924
 
          },
1925
 
          { &hf_a11_vse_panid,
1926
 
                 { "PANID",                      "a11.ext.panid",
1927
 
                        FT_BYTES, BASE_HEX, NULL, 0,
1928
 
                        "PANID", HFILL }
1929
 
          },
1930
 
          { &hf_a11_vse_canid,
1931
 
                 { "CANID",                      "a11.ext.canid",
1932
 
                        FT_BYTES, BASE_HEX, NULL, 0,
1933
 
                        "CANID", HFILL }
1934
 
          },
1935
 
          { &hf_a11_vse_qosmode,
1936
 
                 { "QoS Mode",       "a11.ext.qosmode",
1937
 
                        FT_UINT8, BASE_HEX, VALS(a11_ext_nvose_qosmode), 0,
1938
 
                        "QoS Mode.", HFILL }
1939
 
      },
1940
 
      { &hf_a11_ase_len_type,
1941
 
                 { "Entry Length",   "a11.ext.ase.len",
1942
 
                        FT_UINT8, BASE_DEC, NULL, 0,
1943
 
                        "Entry Length.", HFILL }
1944
 
      },
1945
 
      { &hf_a11_ase_srid_type,
1946
 
                 { "Service Reference ID (SRID)",   "a11.ext.ase.srid",
1947
 
                        FT_UINT8, BASE_DEC, NULL, 0,
1948
 
                        "Service Reference ID (SRID).", HFILL }
1949
 
      },
1950
 
      { &hf_a11_ase_servopt_type,
1951
 
                 { "Service Option", "a11.ext.ase.srvopt",
1952
 
                        FT_UINT16, BASE_HEX, VALS(a11_ext_nvose_srvopt), 0,
1953
 
                        "Service Option.", HFILL }
1954
 
      },
1955
 
          { &hf_a11_ase_gre_proto_type,
1956
 
                 { "GRE Protocol Type",   "a11.ext.ase.ptype",
1957
 
                        FT_UINT16, BASE_HEX, VALS(a11_ses_ptype_vals), 0,
1958
 
                        "GRE Protocol Type.", HFILL }
1959
 
          },
1960
 
          { &hf_a11_ase_gre_key,
1961
 
                 { "GRE Key",   "a11.ext.ase.key",
1962
 
                        FT_UINT32, BASE_HEX, NULL, 0,
1963
 
                        "GRE Key.", HFILL }
1964
 
          },
1965
 
          { &hf_a11_ase_pcf_addr_key,
1966
 
                 { "PCF IP Address",           "a11.ext.ase.pcfip",
1967
 
                        FT_IPv4, BASE_NONE, NULL, 0,
1968
 
                        "PCF IP Address.", HFILL }
1969
 
          },
1970
 
          { &hf_a11_fqi_length,
1971
 
                 { "Length",   "a11.ext.fqi.length",
1972
 
                        FT_UINT16, BASE_DEC, NULL, 0,
1973
 
                        NULL, HFILL }
1974
 
          },
1975
 
          { &hf_a11_fqi_srid,
1976
 
                 { "SRID",   "a11.ext.fqi.srid",
1977
 
                        FT_UINT8, BASE_DEC, NULL, 0,
1978
 
                        "Forward Flow Entry SRID.", HFILL }
1979
 
          },
1980
 
          { &hf_a11_fqi_flags,
1981
 
                 { "Flags",   "a11.ext.fqi.flags",
1982
 
                        FT_UINT8, BASE_HEX, NULL, 0,
1983
 
                        "Forward Flow Entry Flags.", HFILL }
1984
 
          },
1985
 
          { &hf_a11_fqi_flowcount,
1986
 
                 { "Forward Flow Count",   "a11.ext.fqi.flowcount",
1987
 
                        FT_UINT8, BASE_DEC, NULL, 0,
1988
 
                        "Forward Flow Count.", HFILL }
1989
 
          },
1990
 
          { &hf_a11_fqi_flowid,
1991
 
                 { "Forward Flow Id",   "a11.ext.fqi.flowid",
1992
 
                        FT_UINT8, BASE_DEC, NULL, 0,
1993
 
                        "Forward Flow Id.", HFILL }
1994
 
          },
1995
 
          { &hf_a11_fqi_entrylen,
1996
 
                 { "Entry Length",   "a11.ext.fqi.entrylen",
1997
 
                        FT_UINT8, BASE_DEC, NULL, 0,
1998
 
                        "Forward Entry Length.", HFILL }
1999
 
          },
2000
 
          { &hf_a11_fqi_dscp,
2001
 
                 { "Forward DSCP",   "a11.ext.fqi.dscp",
2002
 
                        FT_UINT8, BASE_HEX, NULL, 0,
2003
 
                        "Forward Flow DSCP.", HFILL }
2004
 
          },
2005
 
          { &hf_a11_fqi_flowstate,
2006
 
                 { "Forward Flow State",   "a11.ext.fqi.flowstate",
2007
 
                        FT_UINT8, BASE_HEX, NULL, 0,
2008
 
                        "Forward Flow State.", HFILL }
2009
 
          },
2010
 
          { &hf_a11_fqi_requested_qoslen,
2011
 
                 { "Requested QoS Length",   "a11.ext.fqi.reqqoslen",
2012
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2013
 
                        "Forward Requested QoS Length.", HFILL }
2014
 
          },
2015
 
          { &hf_a11_fqi_requested_qos,
2016
 
                 { "Requested QoS",   "a11.ext.fqi.reqqos",
2017
 
                        FT_BYTES, BASE_NONE, NULL, 0,
2018
 
                        "Forward Requested QoS.", HFILL }
2019
 
          },
2020
 
          { &hf_a11_fqi_granted_qoslen,
2021
 
                 { "Granted QoS Length",   "a11.ext.fqi.graqoslen",
2022
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2023
 
                        "Forward Granted QoS Length.", HFILL }
2024
 
          },
2025
 
          { &hf_a11_fqi_granted_qos,
2026
 
                 { "Granted QoS",   "a11.ext.fqi.graqos",
2027
 
                        FT_BYTES, BASE_NONE, NULL, 0,
2028
 
                        "Forward Granted QoS.", HFILL }
2029
 
          },
2030
 
          { &hf_a11_rqi_length,
2031
 
                 { "Length",   "a11.ext.rqi.length",
2032
 
                        FT_UINT16, BASE_DEC, NULL, 0,
2033
 
                        NULL, HFILL }
2034
 
          },
2035
 
          { &hf_a11_rqi_srid,
2036
 
                 { "SRID",   "a11.ext.rqi.srid",
2037
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2038
 
                        "Reverse Flow Entry SRID.", HFILL }
2039
 
          },
2040
 
          { &hf_a11_rqi_flowcount,
2041
 
                 { "Reverse Flow Count",   "a11.ext.rqi.flowcount",
2042
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2043
 
                        "Reverse Flow Count.", HFILL }
2044
 
          },
2045
 
          { &hf_a11_rqi_flowid,
2046
 
                 { "Reverse Flow Id",   "a11.ext.rqi.flowid",
2047
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2048
 
                        "Reverse Flow Id.", HFILL }
2049
 
          },
2050
 
          { &hf_a11_rqi_entrylen,
2051
 
                 { "Entry Length",   "a11.ext.rqi.entrylen",
2052
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2053
 
                        "Reverse Flow Entry Length.", HFILL }
2054
 
          },
2055
 
          { &hf_a11_rqi_flowstate,
2056
 
                 { "Flow State",   "a11.ext.rqi.flowstate",
2057
 
                        FT_UINT8, BASE_HEX, NULL, 0,
2058
 
                        "Reverse Flow State.", HFILL }
2059
 
          },
2060
 
          { &hf_a11_rqi_requested_qoslen,
2061
 
                 { "Requested QoS Length",   "a11.ext.rqi.reqqoslen",
2062
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2063
 
                        "Reverse Requested QoS Length.", HFILL }
2064
 
          },
2065
 
          { &hf_a11_rqi_requested_qos,
2066
 
                 { "Requested QoS",   "a11.ext.rqi.reqqos",
2067
 
                        FT_BYTES, BASE_NONE, NULL, 0,
2068
 
                        "Reverse Requested QoS.", HFILL }
2069
 
          },
2070
 
          { &hf_a11_rqi_granted_qoslen,
2071
 
                 { "Granted QoS Length",   "a11.ext.rqi.graqoslen",
2072
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2073
 
                        "Reverse Granted QoS Length.", HFILL }
2074
 
          },
2075
 
          { &hf_a11_rqi_granted_qos,
2076
 
                 { "Granted QoS",   "a11.ext.rqi.graqos",
2077
 
                        FT_BYTES, BASE_NONE, NULL, 0,
2078
 
                        "Reverse Granted QoS.", HFILL }
2079
 
          },
2080
 
          { &hf_a11_fqui_flowcount,
2081
 
                 { "Forward QoS Update Flow Count",   "a11.ext.fqui.flowcount",
2082
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2083
 
                        "Forward QoS Update Flow Count.", HFILL }
2084
 
          },
2085
 
          { &hf_a11_rqui_flowcount,
2086
 
                 { "Reverse QoS Update Flow Count",   "a11.ext.rqui.flowcount",
2087
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2088
 
                        "Reverse QoS Update Flow Count.", HFILL }
2089
 
          },
2090
 
          { &hf_a11_fqui_updated_qoslen,
2091
 
                 { "Forward Updated QoS Sub-Blob Length",   "a11.ext.fqui.updatedqoslen",
2092
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2093
 
                        "Forward Updated QoS Sub-Blob Length.", HFILL }
2094
 
          },
2095
 
          { &hf_a11_fqui_updated_qos,
2096
 
                 { "Forward Updated QoS Sub-Blob",   "a11.ext.fqui.updatedqos",
2097
 
                        FT_BYTES, BASE_NONE, NULL, 0,
2098
 
                        "Forward Updated QoS Sub-Blob.", HFILL }
2099
 
          },
2100
 
          { &hf_a11_rqui_updated_qoslen,
2101
 
                 { "Reverse Updated QoS Sub-Blob Length",   "a11.ext.rqui.updatedqoslen",
2102
 
                        FT_UINT8, BASE_DEC, NULL, 0,
2103
 
                        "Reverse Updated QoS Sub-Blob Length.", HFILL }
2104
 
          },
2105
 
          { &hf_a11_rqui_updated_qos,
2106
 
                 { "Reverse Updated QoS Sub-Blob",   "a11.ext.rqui.updatedqos",
2107
 
                        FT_BYTES, BASE_NONE, NULL, 0,
2108
 
                        "Reverse Updated QoS Sub-Blob.", HFILL }
2109
 
          },
2110
 
          { & hf_a11_subsciber_profile_len,
2111
 
                 { "Subscriber QoS Profile Length",   "a11.ext.sqp.profilelen",
2112
 
                        FT_BYTES, BASE_NONE, NULL, 0,
2113
 
                        "Subscriber QoS Profile Length.", HFILL }
2114
 
          },
2115
 
          { & hf_a11_subsciber_profile,
2116
 
                 { "Subscriber QoS Profile",   "a11.ext.sqp.profile",
2117
 
                        FT_BYTES, BASE_NONE, NULL, 0,
2118
 
                        "Subscriber QoS Profile.", HFILL }
2119
 
          },
2120
 
        };
2121
 
 
2122
 
        /* Setup protocol subtree array */
2123
 
        static gint *ett[] = {
2124
 
                &ett_a11,
2125
 
                &ett_a11_flags,
2126
 
                &ett_a11_ext,
2127
 
                &ett_a11_exts,
2128
 
                &ett_a11_radius,
2129
 
                &ett_a11_radiuses,
2130
 
                &ett_a11_ase,
2131
 
                &ett_a11_fqi_flowentry,
2132
 
                &ett_a11_rqi_flowentry,
2133
 
                &ett_a11_fqi_flags,
2134
 
                &ett_a11_fqi_entry_flags,
2135
 
                &ett_a11_rqi_entry_flags,
2136
 
                &ett_a11_fqui_flowentry,
2137
 
                &ett_a11_rqui_flowentry,
2138
 
                &ett_a11_subscriber_profile,
2139
 
        };
2140
 
 
2141
 
        /* Register the protocol name and description */
2142
 
        proto_a11 = proto_register_protocol("3GPP2 A11", "3GPP2 A11", "a11");
2143
 
 
2144
 
        /* Register the dissector by name */
2145
 
        new_register_dissector("a11", dissect_a11, proto_a11);
2146
 
 
2147
 
        /* Required function calls to register the header fields and subtrees used */
2148
 
        proto_register_field_array(proto_a11, hf, array_length(hf));
2149
 
        proto_register_subtree_array(ett, array_length(ett));
 
1731
    static hf_register_info hf[] = {
 
1732
        { &hf_a11_type,
 
1733
          { "Message Type",           "a11.type",
 
1734
            FT_UINT8, BASE_DEC, VALS(a11_types), 0,
 
1735
            "A11 Message type.", HFILL }
 
1736
        },
 
1737
        { &hf_a11_flags,
 
1738
          {"Flags", "a11.flags",
 
1739
           FT_UINT8, BASE_HEX, NULL, 0x0,
 
1740
           NULL, HFILL}
 
1741
        },
 
1742
        { &hf_a11_s,
 
1743
          {"Simultaneous Bindings",           "a11.s",
 
1744
           FT_BOOLEAN, 8, NULL, 128,
 
1745
           "Simultaneous Bindings Allowed", HFILL }
 
1746
        },
 
1747
        { &hf_a11_b,
 
1748
          {"Broadcast Datagrams",           "a11.b",
 
1749
           FT_BOOLEAN, 8, NULL, 64,
 
1750
           "Broadcast Datagrams requested", HFILL }
 
1751
        },
 
1752
        { &hf_a11_d,
 
1753
          { "Co-located Care-of Address",           "a11.d",
 
1754
            FT_BOOLEAN, 8, NULL, 32,
 
1755
            "MN using Co-located Care-of address", HFILL }
 
1756
        },
 
1757
        { &hf_a11_m,
 
1758
          {"Minimal Encapsulation",           "a11.m",
 
1759
           FT_BOOLEAN, 8, NULL, 16,
 
1760
           "MN wants Minimal encapsulation", HFILL }
 
1761
        },
 
1762
        { &hf_a11_g,
 
1763
          {"GRE",           "a11.g",
 
1764
           FT_BOOLEAN, 8, NULL, 8,
 
1765
           "MN wants GRE encapsulation", HFILL }
 
1766
        },
 
1767
        { &hf_a11_v,
 
1768
          { "Van Jacobson",           "a11.v",
 
1769
            FT_BOOLEAN, 8, NULL, 4,
 
1770
            NULL, HFILL }
 
1771
        },
 
1772
        { &hf_a11_t,
 
1773
          { "Reverse Tunneling",           "a11.t",
 
1774
            FT_BOOLEAN, 8, NULL, 2,
 
1775
            "Reverse tunneling requested", HFILL }
 
1776
        },
 
1777
        { &hf_a11_code,
 
1778
          { "Reply Code",           "a11.code",
 
1779
            FT_UINT8, BASE_DEC, VALS(a11_reply_codes), 0,
 
1780
            "A11 Registration Reply code.", HFILL }
 
1781
        },
 
1782
        { &hf_a11_status,
 
1783
          { "Reply Status",           "a11.ackstat",
 
1784
            FT_UINT8, BASE_DEC, VALS(a11_ack_status), 0,
 
1785
            "A11 Registration Ack Status.", HFILL }
 
1786
        },
 
1787
        { &hf_a11_life,
 
1788
          { "Lifetime",           "a11.life",
 
1789
            FT_UINT16, BASE_DEC, NULL, 0,
 
1790
            "A11 Registration Lifetime.", HFILL }
 
1791
        },
 
1792
        { &hf_a11_homeaddr,
 
1793
          { "Home Address",           "a11.homeaddr",
 
1794
            FT_IPv4, BASE_NONE, NULL, 0,
 
1795
            "Mobile Node's home address.", HFILL }
 
1796
        },
 
1797
 
 
1798
        { &hf_a11_haaddr,
 
1799
          { "Home Agent",           "a11.haaddr",
 
1800
            FT_IPv4, BASE_NONE, NULL, 0,
 
1801
            "Home agent IP Address.", HFILL }
 
1802
        },
 
1803
        { &hf_a11_coa,
 
1804
          { "Care of Address",           "a11.coa",
 
1805
            FT_IPv4, BASE_NONE, NULL, 0,
 
1806
            "Care of Address.", HFILL }
 
1807
        },
 
1808
        { &hf_a11_ident,
 
1809
          { "Identification",           "a11.ident",
 
1810
            FT_BYTES, BASE_NONE, NULL, 0,
 
1811
            "MN Identification.", HFILL }
 
1812
        },
 
1813
        { &hf_a11_ext_type,
 
1814
          { "Extension Type",           "a11.ext.type",
 
1815
            FT_UINT8, BASE_DEC, VALS(a11_ext_types), 0,
 
1816
            "Mobile IP Extension Type.", HFILL }
 
1817
        },
 
1818
        { &hf_a11_ext_stype,
 
1819
          { "Gen Auth Ext SubType",           "a11.ext.auth.subtype",
 
1820
            FT_UINT8, BASE_DEC, VALS(a11_ext_stypes), 0,
 
1821
            "Mobile IP Auth Extension Sub Type.", HFILL }
 
1822
        },
 
1823
        { &hf_a11_ext_len,
 
1824
          { "Extension Length",         "a11.ext.len",
 
1825
            FT_UINT16, BASE_DEC, NULL, 0,
 
1826
            "Mobile IP Extension Length.", HFILL }
 
1827
        },
 
1828
        { &hf_a11_ext,
 
1829
          { "Extension",                      "a11.extension",
 
1830
            FT_BYTES, BASE_NONE, NULL, 0,
 
1831
            NULL, HFILL }
 
1832
        },
 
1833
        { &hf_a11_aext_spi,
 
1834
          { "SPI",                      "a11.auth.spi",
 
1835
            FT_UINT32, BASE_HEX, NULL, 0,
 
1836
            "Authentication Header Security Parameter Index.", HFILL }
 
1837
        },
 
1838
        { &hf_a11_aext_auth,
 
1839
          { "Authenticator",            "a11.auth.auth",
 
1840
            FT_BYTES, BASE_NONE, NULL, 0,
 
1841
            "Authenticator.", HFILL }
 
1842
        },
 
1843
        { &hf_a11_next_nai,
 
1844
          { "NAI",                      "a11.nai",
 
1845
            FT_STRING, BASE_NONE, NULL, 0,
 
1846
            NULL, HFILL }
 
1847
        },
 
1848
        { &hf_a11_ses_key,
 
1849
          { "Key",                      "a11.ext.key",
 
1850
            FT_UINT32, BASE_HEX, NULL, 0,
 
1851
            "Session Key.", HFILL }
 
1852
        },
 
1853
        { &hf_a11_ses_sidver,
 
1854
          { "Session ID Version",         "a11.ext.sidver",
 
1855
            FT_UINT8, BASE_DEC, NULL, 3,
 
1856
            NULL, HFILL}
 
1857
        },
 
1858
        { &hf_a11_ses_mnsrid,
 
1859
          { "MNSR-ID",                      "a11.ext.mnsrid",
 
1860
            FT_UINT16, BASE_HEX, NULL, 0,
 
1861
            NULL, HFILL }
 
1862
        },
 
1863
        { &hf_a11_ses_msid_type,
 
1864
          { "MSID Type",                      "a11.ext.msid_type",
 
1865
            FT_UINT16, BASE_DEC, NULL, 0,
 
1866
            "MSID Type.", HFILL }
 
1867
        },
 
1868
        { &hf_a11_ses_msid_len,
 
1869
          { "MSID Length",                      "a11.ext.msid_len",
 
1870
            FT_UINT8, BASE_DEC, NULL, 0,
 
1871
            "MSID Length.", HFILL }
 
1872
        },
 
1873
        { &hf_a11_ses_msid,
 
1874
          { "MSID(BCD)",                      "a11.ext.msid",
 
1875
            FT_STRING, BASE_NONE, NULL, 0,
 
1876
            "MSID(BCD).", HFILL }
 
1877
        },
 
1878
        { &hf_a11_ses_ptype,
 
1879
          { "Protocol Type",                      "a11.ext.ptype",
 
1880
            FT_UINT16, BASE_HEX, VALS(a11_ses_ptype_vals), 0,
 
1881
            "Protocol Type.", HFILL }
 
1882
        },
 
1883
        { &hf_a11_vse_vid,
 
1884
          { "Vendor ID",                      "a11.ext.vid",
 
1885
            FT_UINT32, BASE_HEX, VALS(sminmpec_values), 0,
 
1886
            "Vendor ID.", HFILL }
 
1887
        },
 
1888
        { &hf_a11_vse_apptype,
 
1889
          { "Application Type",                      "a11.ext.apptype",
 
1890
            FT_UINT8, BASE_HEX, VALS(a11_ext_app), 0,
 
1891
            "Application Type.", HFILL }
 
1892
        },
 
1893
        { &hf_a11_vse_ppaddr,
 
1894
          { "Anchor P-P Address",           "a11.ext.ppaddr",
 
1895
            FT_IPv4, BASE_NONE, NULL, 0,
 
1896
            "Anchor P-P Address.", HFILL }
 
1897
        },
 
1898
        { &hf_a11_vse_dormant,
 
1899
          { "All Dormant Indicator",           "a11.ext.dormant",
 
1900
            FT_UINT16, BASE_HEX, VALS(a11_ext_dormant), 0,
 
1901
            "All Dormant Indicator.", HFILL }
 
1902
        },
 
1903
        { &hf_a11_vse_code,
 
1904
          { "Reply Code",           "a11.ext.code",
 
1905
            FT_UINT8, BASE_DEC, VALS(a11_reply_codes), 0,
 
1906
            "PDSN Code.", HFILL }
 
1907
        },
 
1908
        { &hf_a11_vse_pdit,
 
1909
          { "PDSN Code",                      "a11.ext.code",
 
1910
            FT_UINT8, BASE_HEX, VALS(a11_ext_nvose_pdsn_code), 0,
 
1911
            "PDSN Code.", HFILL }
 
1912
        },
 
1913
        { &hf_a11_vse_srvopt,
 
1914
          { "Service Option",                      "a11.ext.srvopt",
 
1915
            FT_UINT16, BASE_HEX, VALS(a11_ext_nvose_srvopt), 0,
 
1916
            "Service Option.", HFILL }
 
1917
        },
 
1918
        { &hf_a11_vse_panid,
 
1919
          { "PANID",                      "a11.ext.panid",
 
1920
            FT_BYTES, BASE_NONE, NULL, 0,
 
1921
            NULL, HFILL }
 
1922
        },
 
1923
        { &hf_a11_vse_canid,
 
1924
          { "CANID",                      "a11.ext.canid",
 
1925
            FT_BYTES, BASE_NONE, NULL, 0,
 
1926
            NULL, HFILL }
 
1927
        },
 
1928
        { &hf_a11_vse_qosmode,
 
1929
          { "QoS Mode",       "a11.ext.qosmode",
 
1930
            FT_UINT8, BASE_HEX, VALS(a11_ext_nvose_qosmode), 0,
 
1931
            "QoS Mode.", HFILL }
 
1932
        },
 
1933
        { &hf_a11_ase_len_type,
 
1934
          { "Entry Length",   "a11.ext.ase.len",
 
1935
            FT_UINT8, BASE_DEC, NULL, 0,
 
1936
            "Entry Length.", HFILL }
 
1937
        },
 
1938
        { &hf_a11_ase_srid_type,
 
1939
          { "Service Reference ID (SRID)",   "a11.ext.ase.srid",
 
1940
            FT_UINT8, BASE_DEC, NULL, 0,
 
1941
            "Service Reference ID (SRID).", HFILL }
 
1942
        },
 
1943
        { &hf_a11_ase_servopt_type,
 
1944
          { "Service Option", "a11.ext.ase.srvopt",
 
1945
            FT_UINT16, BASE_HEX, VALS(a11_ext_nvose_srvopt), 0,
 
1946
            "Service Option.", HFILL }
 
1947
        },
 
1948
        { &hf_a11_ase_gre_proto_type,
 
1949
          { "GRE Protocol Type",   "a11.ext.ase.ptype",
 
1950
            FT_UINT16, BASE_HEX, VALS(a11_ses_ptype_vals), 0,
 
1951
            "GRE Protocol Type.", HFILL }
 
1952
        },
 
1953
        { &hf_a11_ase_gre_key,
 
1954
          { "GRE Key",   "a11.ext.ase.key",
 
1955
            FT_UINT32, BASE_HEX, NULL, 0,
 
1956
            "GRE Key.", HFILL }
 
1957
        },
 
1958
        { &hf_a11_ase_pcf_addr_key,
 
1959
          { "PCF IP Address",           "a11.ext.ase.pcfip",
 
1960
            FT_IPv4, BASE_NONE, NULL, 0,
 
1961
            "PCF IP Address.", HFILL }
 
1962
        },
 
1963
        { &hf_a11_fqi_length,
 
1964
          { "Length",   "a11.ext.fqi.length",
 
1965
            FT_UINT16, BASE_DEC, NULL, 0,
 
1966
            NULL, HFILL }
 
1967
        },
 
1968
        { &hf_a11_fqi_srid,
 
1969
          { "SRID",   "a11.ext.fqi.srid",
 
1970
            FT_UINT8, BASE_DEC, NULL, 0,
 
1971
            "Forward Flow Entry SRID.", HFILL }
 
1972
        },
 
1973
        { &hf_a11_fqi_flags,
 
1974
          { "Flags",   "a11.ext.fqi.flags",
 
1975
            FT_UINT8, BASE_HEX, NULL, 0,
 
1976
            "Forward Flow Entry Flags.", HFILL }
 
1977
        },
 
1978
        { &hf_a11_fqi_flowcount,
 
1979
          { "Forward Flow Count",   "a11.ext.fqi.flowcount",
 
1980
            FT_UINT8, BASE_DEC, NULL, 0,
 
1981
            "Forward Flow Count.", HFILL }
 
1982
        },
 
1983
        { &hf_a11_fqi_flowid,
 
1984
          { "Forward Flow Id",   "a11.ext.fqi.flowid",
 
1985
            FT_UINT8, BASE_DEC, NULL, 0,
 
1986
            "Forward Flow Id.", HFILL }
 
1987
        },
 
1988
        { &hf_a11_fqi_entrylen,
 
1989
          { "Entry Length",   "a11.ext.fqi.entrylen",
 
1990
            FT_UINT8, BASE_DEC, NULL, 0,
 
1991
            "Forward Entry Length.", HFILL }
 
1992
        },
 
1993
        { &hf_a11_fqi_dscp,
 
1994
          { "Forward DSCP",   "a11.ext.fqi.dscp",
 
1995
            FT_UINT8, BASE_HEX, NULL, 0,
 
1996
            "Forward Flow DSCP.", HFILL }
 
1997
        },
 
1998
        { &hf_a11_fqi_flowstate,
 
1999
          { "Forward Flow State",   "a11.ext.fqi.flowstate",
 
2000
            FT_UINT8, BASE_HEX, NULL, 0,
 
2001
            "Forward Flow State.", HFILL }
 
2002
        },
 
2003
        { &hf_a11_fqi_requested_qoslen,
 
2004
          { "Requested QoS Length",   "a11.ext.fqi.reqqoslen",
 
2005
            FT_UINT8, BASE_DEC, NULL, 0,
 
2006
            "Forward Requested QoS Length.", HFILL }
 
2007
        },
 
2008
        { &hf_a11_fqi_requested_qos,
 
2009
          { "Requested QoS",   "a11.ext.fqi.reqqos",
 
2010
            FT_BYTES, BASE_NONE, NULL, 0,
 
2011
            "Forward Requested QoS.", HFILL }
 
2012
        },
 
2013
        { &hf_a11_fqi_granted_qoslen,
 
2014
          { "Granted QoS Length",   "a11.ext.fqi.graqoslen",
 
2015
            FT_UINT8, BASE_DEC, NULL, 0,
 
2016
            "Forward Granted QoS Length.", HFILL }
 
2017
        },
 
2018
        { &hf_a11_fqi_granted_qos,
 
2019
          { "Granted QoS",   "a11.ext.fqi.graqos",
 
2020
            FT_BYTES, BASE_NONE, NULL, 0,
 
2021
            "Forward Granted QoS.", HFILL }
 
2022
        },
 
2023
        { &hf_a11_rqi_length,
 
2024
          { "Length",   "a11.ext.rqi.length",
 
2025
            FT_UINT16, BASE_DEC, NULL, 0,
 
2026
            NULL, HFILL }
 
2027
        },
 
2028
        { &hf_a11_rqi_srid,
 
2029
          { "SRID",   "a11.ext.rqi.srid",
 
2030
            FT_UINT8, BASE_DEC, NULL, 0,
 
2031
            "Reverse Flow Entry SRID.", HFILL }
 
2032
        },
 
2033
        { &hf_a11_rqi_flowcount,
 
2034
          { "Reverse Flow Count",   "a11.ext.rqi.flowcount",
 
2035
            FT_UINT8, BASE_DEC, NULL, 0,
 
2036
            "Reverse Flow Count.", HFILL }
 
2037
        },
 
2038
        { &hf_a11_rqi_flowid,
 
2039
          { "Reverse Flow Id",   "a11.ext.rqi.flowid",
 
2040
            FT_UINT8, BASE_DEC, NULL, 0,
 
2041
            "Reverse Flow Id.", HFILL }
 
2042
        },
 
2043
        { &hf_a11_rqi_entrylen,
 
2044
          { "Entry Length",   "a11.ext.rqi.entrylen",
 
2045
            FT_UINT8, BASE_DEC, NULL, 0,
 
2046
            "Reverse Flow Entry Length.", HFILL }
 
2047
        },
 
2048
        { &hf_a11_rqi_flowstate,
 
2049
          { "Flow State",   "a11.ext.rqi.flowstate",
 
2050
            FT_UINT8, BASE_HEX, NULL, 0,
 
2051
            "Reverse Flow State.", HFILL }
 
2052
        },
 
2053
        { &hf_a11_rqi_requested_qoslen,
 
2054
          { "Requested QoS Length",   "a11.ext.rqi.reqqoslen",
 
2055
            FT_UINT8, BASE_DEC, NULL, 0,
 
2056
            "Reverse Requested QoS Length.", HFILL }
 
2057
        },
 
2058
        { &hf_a11_rqi_requested_qos,
 
2059
          { "Requested QoS",   "a11.ext.rqi.reqqos",
 
2060
            FT_BYTES, BASE_NONE, NULL, 0,
 
2061
            "Reverse Requested QoS.", HFILL }
 
2062
        },
 
2063
        { &hf_a11_rqi_granted_qoslen,
 
2064
          { "Granted QoS Length",   "a11.ext.rqi.graqoslen",
 
2065
            FT_UINT8, BASE_DEC, NULL, 0,
 
2066
            "Reverse Granted QoS Length.", HFILL }
 
2067
        },
 
2068
        { &hf_a11_rqi_granted_qos,
 
2069
          { "Granted QoS",   "a11.ext.rqi.graqos",
 
2070
            FT_BYTES, BASE_NONE, NULL, 0,
 
2071
            "Reverse Granted QoS.", HFILL }
 
2072
        },
 
2073
        { &hf_a11_fqui_flowcount,
 
2074
          { "Forward QoS Update Flow Count",   "a11.ext.fqui.flowcount",
 
2075
            FT_UINT8, BASE_DEC, NULL, 0,
 
2076
            "Forward QoS Update Flow Count.", HFILL }
 
2077
        },
 
2078
        { &hf_a11_rqui_flowcount,
 
2079
          { "Reverse QoS Update Flow Count",   "a11.ext.rqui.flowcount",
 
2080
            FT_UINT8, BASE_DEC, NULL, 0,
 
2081
            "Reverse QoS Update Flow Count.", HFILL }
 
2082
        },
 
2083
        { &hf_a11_fqui_updated_qoslen,
 
2084
          { "Forward Updated QoS Sub-Blob Length",   "a11.ext.fqui.updatedqoslen",
 
2085
            FT_UINT8, BASE_DEC, NULL, 0,
 
2086
            "Forward Updated QoS Sub-Blob Length.", HFILL }
 
2087
        },
 
2088
        { &hf_a11_fqui_updated_qos,
 
2089
          { "Forward Updated QoS Sub-Blob",   "a11.ext.fqui.updatedqos",
 
2090
            FT_BYTES, BASE_NONE, NULL, 0,
 
2091
            "Forward Updated QoS Sub-Blob.", HFILL }
 
2092
        },
 
2093
        { &hf_a11_rqui_updated_qoslen,
 
2094
          { "Reverse Updated QoS Sub-Blob Length",   "a11.ext.rqui.updatedqoslen",
 
2095
            FT_UINT8, BASE_DEC, NULL, 0,
 
2096
            "Reverse Updated QoS Sub-Blob Length.", HFILL }
 
2097
        },
 
2098
        { &hf_a11_rqui_updated_qos,
 
2099
          { "Reverse Updated QoS Sub-Blob",   "a11.ext.rqui.updatedqos",
 
2100
            FT_BYTES, BASE_NONE, NULL, 0,
 
2101
            "Reverse Updated QoS Sub-Blob.", HFILL }
 
2102
        },
 
2103
        { & hf_a11_subsciber_profile_len,
 
2104
          { "Subscriber QoS Profile Length",   "a11.ext.sqp.profilelen",
 
2105
            FT_BYTES, BASE_NONE, NULL, 0,
 
2106
            "Subscriber QoS Profile Length.", HFILL }
 
2107
        },
 
2108
        { & hf_a11_subsciber_profile,
 
2109
          { "Subscriber QoS Profile",   "a11.ext.sqp.profile",
 
2110
            FT_BYTES, BASE_NONE, NULL, 0,
 
2111
            "Subscriber QoS Profile.", HFILL }
 
2112
        },
 
2113
    };
 
2114
 
 
2115
    /* Setup protocol subtree array */
 
2116
    static gint *ett[] = {
 
2117
        &ett_a11,
 
2118
        &ett_a11_flags,
 
2119
        &ett_a11_ext,
 
2120
        &ett_a11_exts,
 
2121
        &ett_a11_radius,
 
2122
        &ett_a11_radiuses,
 
2123
        &ett_a11_ase,
 
2124
        &ett_a11_fqi_flowentry,
 
2125
        &ett_a11_rqi_flowentry,
 
2126
        &ett_a11_fqi_flags,
 
2127
        &ett_a11_fqi_entry_flags,
 
2128
        &ett_a11_rqi_entry_flags,
 
2129
        &ett_a11_fqui_flowentry,
 
2130
        &ett_a11_rqui_flowentry,
 
2131
        &ett_a11_subscriber_profile,
 
2132
    };
 
2133
 
 
2134
    /* Register the protocol name and description */
 
2135
    proto_a11 = proto_register_protocol("3GPP2 A11", "3GPP2 A11", "a11");
 
2136
 
 
2137
    /* Register the dissector by name */
 
2138
    new_register_dissector("a11", dissect_a11, proto_a11);
 
2139
 
 
2140
    /* Required function calls to register the header fields and subtrees used */
 
2141
    proto_register_field_array(proto_a11, hf, array_length(hf));
 
2142
    proto_register_subtree_array(ett, array_length(ett));
2150
2143
}
2151
2144
 
2152
2145
void
2153
2146
proto_reg_handoff_a11(void)
2154
2147
{
2155
 
        dissector_handle_t a11_handle;
 
2148
    dissector_handle_t a11_handle;
2156
2149
 
2157
 
        a11_handle = find_dissector("a11");
2158
 
        dissector_add("udp.port", UDP_PORT_3GA11, a11_handle);
 
2150
    a11_handle = find_dissector("a11");
 
2151
    dissector_add("udp.port", UDP_PORT_3GA11, a11_handle);
2159
2152
}