00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef __DIAMETER_EAP_PARSER_H__
00043 #define __DIAMETER_EAP_PARSER_H__
00044
00045 #include <vector>
00046 #include "diameter_parser_api.h"
00047 #include "diameter_nasreq_parser.hxx"
00048
00049 const diameter_unsigned32_t EapApplicationId = 2000;
00050 const AAACommandCode EapCommandCode = 268;
00051
00052 #if 0
00053
00054 class tunneling_t
00055 {
00056 public:
00057
00058 void CopyTo(AAAAvpContainerList &cl)
00059 {
00060 AAAAvpContainerManager cm;
00061 AAAAvpContainer *c;
00062 if (TunnelType.IsSet())
00063 {
00064 c = cm.acquire("Tunnel-Type");
00065 TunnelType.CopyTo(*c, AAA_AVP_ENUM_TYPE);
00066 cl.add(c);
00067 }
00068 if (TunnelMediumType.IsSet())
00069 {
00070 c = cm.acquire("Tunnel-Medium-Type");
00071 TunnelMediumType.CopyTo(*c, AAA_AVP_ENUM_TYPE);
00072 cl.add(c);
00073 }
00074 if (TunnelClientEndpoint.IsSet())
00075 {
00076 c = cm.acquire("Tunnel-Client-Endpoint");
00077 TunnelClientEndpoint.CopyTo(*c, AAA_AVP_UTF8_STRING_TYPE);
00078 cl.add(c);
00079 }
00080 if (TunnelServerEndpoint.IsSet())
00081 {
00082 c = cm.acquire("Tunnel-Server-Endpoint");
00083 TunnelServerEndpoint.CopyTo(*c, AAA_AVP_UTF8_STRING_TYPE);
00084 cl.add(c);
00085 }
00086 if (TunnelPreference.IsSet())
00087 {
00088 c = cm.acquire("Tunnel-Preference");
00089 TunnelPreference.CopyTo(*c, AAA_AVP_UINTEGER32_TYPE);
00090 cl.add(c);
00091 }
00092 if (TunnelClientAuthId.IsSet())
00093 {
00094 c = cm.acquire("Tunnel-Client-Auth-Id");
00095 TunnelClientAuthId.CopyTo(*c, AAA_AVP_UINTEGER32_TYPE);
00096 cl.add(c);
00097 }
00098 if (TunnelServerAuthId.IsSet())
00099 {
00100 c = cm.acquire("Tunnel-Server-Auth-Id");
00101 TunnelServerAuthId.CopyTo(*c, AAA_AVP_UINTEGER32_TYPE);
00102 cl.add(c);
00103 }
00104 if (TunnelPassword.IsSet())
00105 {
00106 c = cm.acquire("Tunnel-Password");
00107 TunnelPassword.CopyTo(*c, AAA_AVP_STRING_TYPE);
00108 cl.add(c);
00109 }
00110 if (TunnelPrivateGroupId.IsSet())
00111 {
00112 c = cm.acquire("Tunnel-Private-Group-Id");
00113 TunnelPrivateGroupId.CopyTo(*c, AAA_AVP_UTF8_STRING_TYPE);
00114 cl.add(c);
00115 }
00116 }
00117 void CopyFrom(AAAAvpContainerList &cl)
00118 {
00119 AAAAvpContainer *c;
00120
00121 if ((c = cl.search("Tunnel-Type")))
00122 {
00123 TunnelType.CopyFrom(*c);
00124 }
00125 if ((c = cl.search("Tunnel-Medium-Type")))
00126 {
00127 TunnelMediumType.CopyFrom(*c);
00128 }
00129 if ((c = cl.search("Tunnel-Client-Endpoint")))
00130 {
00131 TunnelClientEndpoint.CopyFrom(*c);
00132 }
00133 if ((c = cl.search("Tunnel-Server-Endpoint")))
00134 {
00135 TunnelServerEndpoint.CopyFrom(*c);
00136 }
00137 if ((c = cl.search("Tunnel-Preference")))
00138 {
00139 TunnelPreference.CopyFrom(*c);
00140 }
00141 if ((c = cl.search("Tunnel-Client-Auth-Id")))
00142 {
00143 TunnelClientAuthId.CopyFrom(*c);
00144 }
00145 if ((c = cl.search("Tunnel-Server-Auth-Id")))
00146 {
00147 TunnelServerAuthId.CopyFrom(*c);
00148 }
00149 if ((c = cl.search("Tunnel-Password")))
00150 {
00151 TunnelPassword.CopyFrom(*c);
00152 }
00153 if ((c = cl.search("Tunnel-Private-Group-Id")))
00154 {
00155 TunnelPrivateGroupId.CopyFrom(*c);
00156 }
00157 }
00158
00159 AAA_ScholarAttribute<diameter_enumerated_t> TunnelType;
00160 AAA_ScholarAttribute<diameter_enumerated_t> TunnelMediumType;
00161 AAA_ScholarAttribute<diameter_utf8string_t> TunnelClientEndpoint;
00162 AAA_ScholarAttribute<diameter_utf8string_t> TunnelServerEndpoint;
00163
00164 AAA_ScholarAttribute<diameter_unsigned32_t> TunnelPreference;
00165 AAA_ScholarAttribute<diameter_unsigned32_t> TunnelClientAuthId;
00166 AAA_ScholarAttribute<diameter_unsigned32_t> TunnelServerAuthId;
00167 AAA_ScholarAttribute<diameter_octetstring_t> TunnelPassword;
00168 AAA_ScholarAttribute<diameter_utf8string_t> TunnelPrivateGroupId;
00169 };
00170
00172 class proxyinfo_t
00173 {
00174 public:
00175 void CopyTo(AAAAvpContainerList &cl)
00176 {
00177 AAAAvpContainerManager cm;
00178 AAAAvpContainer *c;
00179 if (ProxyHost.IsSet())
00180 {
00181 c = cm.acquire("Proxy-Host");
00182 ProxyHost.CopyTo(*c, AAA_AVP_DIAMID_TYPE);
00183 cl.add(c);
00184 }
00185 if (ProxyState.IsSet())
00186 {
00187 c = cm.acquire("Proxy-State");
00188 ProxyState.CopyTo(*c, AAA_AVP_STRING_TYPE);
00189 cl.add(c);
00190 }
00191 if (Avp.IsSet())
00192 {
00193 c = cm.acquire("AVP");
00194 Avp.CopyTo(*c, AAA_AVP_CUSTOM_TYPE);
00195 cl.add(c);
00196 }
00197 }
00198 void CopyFrom(AAAAvpContainerList &cl)
00199 {
00200 AAAAvpContainer *c;
00201 if ((c = cl.search("Proxy-Host")))
00202 {
00203 ProxyHost.CopyFrom(*c);
00204 }
00205 if ((c = cl.search("Proxy-State")))
00206 {
00207 ProxyState.CopyFrom(*c);
00208 }
00209 if ((c = cl.search("AVP")))
00210 {
00211 Avp.CopyFrom(*c);
00212 }
00213 }
00214
00215 AAA_ScholarAttribute<diameter_identity_t> ProxyHost;
00216 AAA_ScholarAttribute<diameter_octetstring_t> ProxyState;
00217
00218 AAA_VectorAttribute<avp_t> Avp;
00219 };
00220 #endif
00221
00223 class DER_Data
00224 {
00225 public:
00226 DER_Data()
00227 {
00228 EapPayload.Set(std::string());
00229 }
00230
00231 void Clear()
00232 {
00233 SessionId.Clear();
00234 AuthApplicationId.Clear();
00235 OriginHost.Clear();
00236 OriginRealm.Clear();
00237 DestinationRealm.Clear();
00238 AuthRequestType.Clear();
00239 NasPort.Clear();
00240 NasPortId.Clear();
00241 OriginStateId.Clear();
00242 DestinationHost.Clear();
00243 NasIdentifier.Clear();
00244 NasIpAddress.Clear();
00245 NasIpv6Address.Clear();
00246 NasPortType.Clear();
00247 PortLimit.Clear();
00248 UserName.Clear();
00249 EapPayload.Clear();
00250 ServiceType.Clear();
00251 IdleTimeout.Clear();
00252 State.Clear();
00253 AuthorizationLifetime.Clear();
00254 AuthGracePeriod.Clear();
00255 AuthSessionState.Clear();
00256 SessionTimeout.Clear();
00257 CallbackNumber.Clear();
00258 CalledStationId.Clear();
00259 CallingStationId.Clear();
00260 Class.Clear();
00261 OriginatingLineInfo.Clear();
00262 ConnectInfo.Clear();
00263 FramedCompression.Clear();
00264 FramedInterfaceId.Clear();
00265 FramedIpAddress.Clear();
00266 FramedIpv6Prefix.Clear();
00267 FramedIpNetmask.Clear();
00268 FramedMtu.Clear();
00269 FramedProtocol.Clear();
00270 Tunneling.Clear();
00271 ProxyInfo.Clear();
00272 RouteRecord.Clear();
00273 Avp.Clear();
00274 }
00275
00277 AAA_ScholarAttribute<diameter_utf8string_t> SessionId;
00278 AAA_ScholarAttribute<diameter_unsigned32_t> AuthApplicationId;
00279 AAA_ScholarAttribute<diameter_identity_t> OriginHost;
00280 AAA_ScholarAttribute<diameter_identity_t> OriginRealm;
00281 AAA_ScholarAttribute<diameter_identity_t> DestinationRealm;
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310 AAA_ScholarAttribute<diameter_enumerated_t> AuthRequestType;
00311 AAA_ScholarAttribute<diameter_unsigned32_t> NasPort;
00312 AAA_ScholarAttribute<diameter_utf8string_t> NasPortId;
00313 AAA_ScholarAttribute<diameter_unsigned32_t> OriginStateId;
00314 AAA_ScholarAttribute<diameter_identity_t> DestinationHost;
00315 AAA_ScholarAttribute<diameter_utf8string_t> NasIdentifier;
00316 AAA_ScholarAttribute<diameter_octetstring_t> NasIpAddress;
00317 AAA_ScholarAttribute<diameter_octetstring_t> NasIpv6Address;
00318 AAA_ScholarAttribute<diameter_enumerated_t> NasPortType;
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331 AAA_ScholarAttribute<diameter_unsigned32_t> PortLimit;
00332 AAA_ScholarAttribute<diameter_utf8string_t> UserName;
00333 AAA_ScholarAttribute<diameter_octetstring_t> EapPayload;
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364 AAA_ScholarAttribute<diameter_enumerated_t> ServiceType;
00365 AAA_ScholarAttribute<diameter_unsigned32_t> IdleTimeout;
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389 AAA_ScholarAttribute<diameter_octetstring_t> State;
00390 AAA_ScholarAttribute<diameter_unsigned32_t> AuthorizationLifetime;
00391 AAA_ScholarAttribute<diameter_unsigned32_t> AuthGracePeriod;
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440 AAA_ScholarAttribute<diameter_enumerated_t> AuthSessionState;
00441 AAA_ScholarAttribute<diameter_unsigned32_t> SessionTimeout;
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456 AAA_ScholarAttribute<diameter_utf8string_t> CallbackNumber;
00457 AAA_ScholarAttribute<diameter_utf8string_t> CalledStationId;
00458 AAA_ScholarAttribute<diameter_utf8string_t> CallingStationId;
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476 AAA_VectorAttribute<diameter_octetstring_t> Class;
00477 AAA_ScholarAttribute<diameter_octetstring_t> OriginatingLineInfo;
00478 AAA_ScholarAttribute<diameter_utf8string_t> ConnectInfo;
00479 AAA_VectorAttribute<diameter_enumerated_t> FramedCompression;
00480 AAA_ScholarAttribute<diameter_unsigned64_t> FramedInterfaceId;
00481 AAA_ScholarAttribute<diameter_octetstring_t> FramedIpAddress;
00482 AAA_VectorAttribute<diameter_octetstring_t> FramedIpv6Prefix;
00483 AAA_ScholarAttribute<diameter_octetstring_t> FramedIpNetmask;
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495 AAA_ScholarAttribute<diameter_unsigned32_t> FramedMtu;
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513 AAA_ScholarAttribute<diameter_enumerated_t> FramedProtocol;
00514 AAA_GroupedVectorAttribute<tunneling_t> Tunneling;
00515 AAA_GroupedVectorAttribute<proxyinfo_t> ProxyInfo;
00516 AAA_VectorAttribute<diameter_identity_t> RouteRecord;
00517 AAA_VectorAttribute<avp_t> Avp;
00518 };
00519
00521 class DEA_Data
00522 {
00523 public:
00524 DEA_Data() {}
00525
00526 void Clear()
00527 {
00528 UserName.Clear();
00529 EapPayload.Clear();
00530 EapReissuedPayload.Clear();
00531 EapMasterSessionKey.Clear();
00532 MultiRoundTimeOut.Clear();
00533 AccountingEapAuthMethod.Clear();
00534 OriginStateId.Clear();
00535 PortLimit.Clear();
00536 ServiceType.Clear();
00537 IdleTimeout.Clear();
00538 State.Clear();
00539 Class.Clear();
00540 AuthorizationLifetime.Clear();
00541 AuthGracePeriod.Clear();
00542 AuthSessionState.Clear();
00543 SessionTimeout.Clear();
00544 CallbackNumber.Clear();
00545 FramedAppletalkLink.Clear();
00546 FramedAppletalkNetwork.Clear();
00547 FramedAppletalkZone.Clear();
00548 FramedCompression.Clear();
00549 FramedInterfaceId.Clear();
00550 FramedIpAddress.Clear();
00551 FramedIpv6Prefix.Clear();
00552 FramedIpv6Pool.Clear();
00553 FramedIpv6Route.Clear();
00554 FramedIpNetmask.Clear();
00555 FramedRoute.Clear();
00556 FramedPool.Clear();
00557 FramedIpxNetwork.Clear();
00558 FramedMtu.Clear();
00559 FramedProtocol.Clear();
00560 FramedRouting.Clear();
00561 NasFilterRule.Clear();
00562 Tunneling.Clear();
00563 RedirectHost.Clear();
00564 RedirectHostUsage.Clear();
00565 RedirectMaxCacheTime.Clear();
00566 ProxyInfo.Clear();
00567 Avp.Clear();
00568 }
00569
00571 AAA_ScholarAttribute<diameter_utf8string_t> SessionId;
00572 AAA_ScholarAttribute<diameter_unsigned32_t> AuthApplicationId;
00573 AAA_ScholarAttribute<diameter_enumerated_t> AuthRequestType;
00574 AAA_ScholarAttribute<diameter_identity_t> OriginHost;
00575 AAA_ScholarAttribute<diameter_identity_t> OriginRealm;
00576 AAA_ScholarAttribute<diameter_utf8string_t> UserName;
00577 AAA_ScholarAttribute<diameter_octetstring_t> EapPayload;
00578 AAA_ScholarAttribute<diameter_octetstring_t> EapReissuedPayload;
00579 AAA_ScholarAttribute<diameter_octetstring_t> EapMasterSessionKey;
00580 AAA_VectorAttribute<diameter_unsigned64_t> AccountingEapAuthMethod;
00581 AAA_ScholarAttribute<diameter_unsigned32_t> OriginStateId;
00582 AAA_ScholarAttribute<diameter_unsigned32_t> PortLimit;
00583 AAA_ScholarAttribute<diameter_enumerated_t> ServiceType;
00584 AAA_ScholarAttribute<diameter_unsigned32_t> IdleTimeout;
00585 AAA_ScholarAttribute<diameter_octetstring_t> State;
00586 AAA_VectorAttribute<diameter_octetstring_t> Class;
00587 AAA_ScholarAttribute<diameter_unsigned32_t> AuthorizationLifetime;
00588 AAA_ScholarAttribute<diameter_unsigned32_t> AuthGracePeriod;
00589 AAA_ScholarAttribute<diameter_enumerated_t> AuthSessionState;
00590 AAA_ScholarAttribute<diameter_unsigned32_t> SessionTimeout;
00591 AAA_ScholarAttribute<diameter_utf8string_t> CallbackNumber;
00592 AAA_VectorAttribute<diameter_enumerated_t> FramedCompression;
00593 AAA_ScholarAttribute<diameter_unsigned64_t> FramedInterfaceId;
00594 AAA_ScholarAttribute<diameter_octetstring_t> FramedIpAddress;
00595 AAA_VectorAttribute<diameter_octetstring_t> FramedIpv6Prefix;
00596 AAA_ScholarAttribute<diameter_octetstring_t> FramedIpNetmask;
00597 AAA_ScholarAttribute<diameter_unsigned32_t> FramedMtu;
00598 AAA_ScholarAttribute<diameter_enumerated_t> FramedProtocol;
00599 AAA_VectorAttribute<diameter_ipfilter_rule_t> NasFilterRule;
00600 AAA_GroupedVectorAttribute<tunneling_t> Tunneling;
00601 AAA_GroupedVectorAttribute<proxyinfo_t> ProxyInfo;
00602 AAA_VectorAttribute<avp_t> Avp;
00603 AAA_ScholarAttribute<diameter_unsigned32_t> ResultCode;
00604
00605
00606
00607
00608
00609
00610
00611
00612 AAA_ScholarAttribute<diameter_unsigned32_t> MultiRoundTimeOut;
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626 AAA_VectorAttribute<diameter_octetstring_t> ConfigurationToken;
00627
00628
00629 AAA_ScholarAttribute<diameter_unsigned32_t> AcctInterimInterval;
00630 AAA_ScholarAttribute<diameter_utf8string_t> ErrorMessage;
00631 AAA_ScholarAttribute<diameter_identity_t> ErrorReportingHost;
00632 AAA_ScholarAttribute<diameter_enumerated_t> ReAuthRequestType;
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654 AAA_VectorAttribute<diameter_utf8string_t> ReplyMessage;
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674 AAA_VectorAttribute<diameter_utf8string_t> FilterId;
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691 AAA_ScholarAttribute<diameter_utf8string_t> CallbackId;
00692 AAA_ScholarAttribute<diameter_unsigned32_t> FramedAppletalkLink;
00693 AAA_VectorAttribute<diameter_unsigned32_t> FramedAppletalkNetwork;
00694 AAA_ScholarAttribute<diameter_octetstring_t> FramedAppletalkZone;
00695 AAA_VectorAttribute<diameter_utf8string_t> FramedIpv6Route;
00696 AAA_ScholarAttribute<diameter_octetstring_t> FramedIpv6Pool;
00697 AAA_ScholarAttribute<diameter_octetstring_t> FramedPool;
00698 AAA_ScholarAttribute<diameter_utf8string_t> FramedIpxNetwork;
00699 AAA_VectorAttribute<diameter_utf8string_t> FramedRoute;
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719 AAA_ScholarAttribute<diameter_enumerated_t> FramedRouting;
00720 AAA_VectorAttribute<diameter_identity_t> RedirectHost;
00721 AAA_ScholarAttribute<diameter_enumerated_t> RedirectHostUsage;
00722 AAA_ScholarAttribute<diameter_unsigned32_t> RedirectMaxCacheTime;
00723
00724
00725
00726
00727
00728 };
00729
00730 typedef AAAParser<AAAMessage*, DER_Data*> DER_Parser;
00731 typedef AAAParser<AAAMessage*, DEA_Data*> DEA_Parser;
00732
00733 void DER_Parser::parseRawToApp();
00734 void DER_Parser::parseAppToRaw();
00735
00736 void DEA_Parser::parseRawToApp();
00737 void DEA_Parser::parseAppToRaw();
00738
00739 #endif //__EAP_CLIENT_DATA_H__