Main Page | Class Hierarchy | Class List | File List | Class Members

diameter_nasreq_parser.hxx

00001 /* BEGIN_COPYRIGHT                                                        */
00002 /*                                                                        */
00003 /* Open Diameter: Open-source software for the Diameter and               */
00004 /*                Diameter related protocols                              */
00005 /*                                                                        */
00006 /* Copyright (C) 2002-2004 Open Diameter Project                          */
00007 /*                                                                        */
00008 /* This library is free software; you can redistribute it and/or modify   */
00009 /* it under the terms of the GNU Lesser General Public License as         */
00010 /* published by the Free Software Foundation; either version 2.1 of the   */
00011 /* License, or (at your option) any later version.                        */
00012 /*                                                                        */
00013 /* This library is distributed in the hope that it will be useful,        */
00014 /* but WITHOUT ANY WARRANTY; without even the implied warranty of         */
00015 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      */
00016 /* Lesser General Public License for more details.                        */
00017 /*                                                                        */
00018 /* You should have received a copy of the GNU Lesser General Public       */
00019 /* License along with this library; if not, write to the Free Software    */
00020 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307    */
00021 /* USA.                                                                   */
00022 /*                                                                        */
00023 /* In addition, when you copy and redistribute some or the entire part of */
00024 /* the source code of this software with or without modification, you     */
00025 /* MUST include this copyright notice in each copy.                       */
00026 /*                                                                        */
00027 /* If you make any changes that are appeared to be useful, please send    */
00028 /* sources that include the changed part to                               */
00029 /* diameter-developers@lists.sourceforge.net so that we can reflect your  */
00030 /* changes to one unified version of this software.                       */
00031 /*                                                                        */
00032 /* END_COPYRIGHT                                                          */
00033 
00034 /* $Id: diameter_nasreq_parser.hxx,v 1.4 2004/06/17 21:13:34 yohba Exp $ */
00035 /* 
00036    diameter_nasreq_parser.hxx
00037    Parser Data Structure in Diameter NASREQ Application 
00038    Written by Yoshihiro Ohba
00039    Created April 8, 2004.
00040 */
00041 
00042 #ifndef __DIAMETER_NASREQ_PARSER_H__
00043 #define __DIAMETER_NASREQ_PARSER_H__
00044 
00045 #include <vector>
00046 #include "diameter_parser_api.h"
00047 
00048 const diameter_unsigned32_t NasreqApplicationId = 1;
00049 const AAACommandCode AA_CommandCode = 265;
00050 
00052 class tunneling_t
00053 {
00054  public:
00055 
00056   void CopyTo(AAAAvpContainerList &cl)
00057   {
00058     AAAAvpContainerManager cm;
00059     AAAAvpContainer *c;
00060     if (TunnelType.IsSet())
00061       {
00062         c = cm.acquire("Tunnel-Type");
00063         TunnelType.CopyTo(*c, AAA_AVP_ENUM_TYPE);
00064         cl.add(c);
00065       }
00066     if (TunnelMediumType.IsSet())
00067       {
00068         c = cm.acquire("Tunnel-Medium-Type");
00069         TunnelMediumType.CopyTo(*c, AAA_AVP_ENUM_TYPE);
00070         cl.add(c);
00071       }
00072     if (TunnelClientEndpoint.IsSet())
00073       {
00074         c = cm.acquire("Tunnel-Client-Endpoint");
00075         TunnelClientEndpoint.CopyTo(*c, AAA_AVP_UTF8_STRING_TYPE);
00076         cl.add(c);
00077       }
00078     if (TunnelServerEndpoint.IsSet())
00079       {
00080         c = cm.acquire("Tunnel-Server-Endpoint");
00081         TunnelServerEndpoint.CopyTo(*c, AAA_AVP_UTF8_STRING_TYPE);
00082         cl.add(c);
00083       }
00084     if (TunnelPreference.IsSet())
00085       {
00086         c = cm.acquire("Tunnel-Preference");
00087         TunnelPreference.CopyTo(*c, AAA_AVP_UINTEGER32_TYPE);
00088         cl.add(c);
00089       }
00090     if (TunnelClientAuthId.IsSet())
00091       {
00092         c = cm.acquire("Tunnel-Client-Auth-Id");
00093         TunnelClientAuthId.CopyTo(*c, AAA_AVP_UINTEGER32_TYPE);
00094         cl.add(c);
00095       }
00096     if (TunnelServerAuthId.IsSet())
00097       {
00098         c = cm.acquire("Tunnel-Server-Auth-Id");
00099         TunnelServerAuthId.CopyTo(*c, AAA_AVP_UINTEGER32_TYPE);
00100         cl.add(c);
00101       }
00102     if (TunnelPassword.IsSet())
00103       {
00104         c = cm.acquire("Tunnel-Password");
00105         TunnelPassword.CopyTo(*c, AAA_AVP_STRING_TYPE);
00106         cl.add(c);
00107       }
00108     if (TunnelPrivateGroupId.IsSet())
00109       {
00110         c = cm.acquire("Tunnel-Private-Group-Id");
00111         TunnelPrivateGroupId.CopyTo(*c, AAA_AVP_UTF8_STRING_TYPE);
00112         cl.add(c);
00113       }
00114   }
00115   void CopyFrom(AAAAvpContainerList &cl)
00116   {
00117     AAAAvpContainer *c;
00118           
00119     if ((c = cl.search("Tunnel-Type")))
00120       {
00121         TunnelType.CopyFrom(*c);
00122       }
00123     if ((c = cl.search("Tunnel-Medium-Type")))
00124       {
00125         TunnelMediumType.CopyFrom(*c);
00126       }
00127     if ((c = cl.search("Tunnel-Client-Endpoint")))
00128       {
00129         TunnelClientEndpoint.CopyFrom(*c);
00130       }
00131     if ((c = cl.search("Tunnel-Server-Endpoint")))
00132       {
00133         TunnelServerEndpoint.CopyFrom(*c);
00134       }
00135     if ((c = cl.search("Tunnel-Preference")))
00136       {
00137         TunnelPreference.CopyFrom(*c);
00138       }
00139     if ((c = cl.search("Tunnel-Client-Auth-Id")))
00140       {
00141         TunnelClientAuthId.CopyFrom(*c);
00142       }
00143     if ((c = cl.search("Tunnel-Server-Auth-Id")))
00144       {
00145         TunnelServerAuthId.CopyFrom(*c);
00146       }
00147     if ((c = cl.search("Tunnel-Password")))
00148       {
00149         TunnelPassword.CopyFrom(*c);
00150       }
00151     if ((c = cl.search("Tunnel-Private-Group-Id")))
00152       {
00153         TunnelPrivateGroupId.CopyFrom(*c);
00154       }
00155   }
00156   // Required AVPs
00157   AAA_ScholarAttribute<diameter_enumerated_t> TunnelType;
00158   AAA_ScholarAttribute<diameter_enumerated_t> TunnelMediumType;
00159   AAA_ScholarAttribute<diameter_utf8string_t> TunnelClientEndpoint;
00160   AAA_ScholarAttribute<diameter_utf8string_t> TunnelServerEndpoint;
00161   // Optional AVPs
00162   AAA_ScholarAttribute<diameter_unsigned32_t> TunnelPreference;
00163   AAA_ScholarAttribute<diameter_unsigned32_t> TunnelClientAuthId;
00164   AAA_ScholarAttribute<diameter_unsigned32_t> TunnelServerAuthId;
00165   AAA_ScholarAttribute<diameter_octetstring_t> TunnelPassword;
00166   AAA_ScholarAttribute<diameter_utf8string_t> TunnelPrivateGroupId;
00167 };
00168 
00170 class proxyinfo_t
00171 {
00172  public:
00173   void CopyTo(AAAAvpContainerList &cl)
00174   {
00175     AAAAvpContainerManager cm;
00176     AAAAvpContainer *c;
00177     if (ProxyHost.IsSet())
00178       {
00179         c = cm.acquire("Proxy-Host");
00180         ProxyHost.CopyTo(*c, AAA_AVP_DIAMID_TYPE);
00181         cl.add(c);
00182       }
00183     if (ProxyState.IsSet())
00184       {
00185         c = cm.acquire("Proxy-State");
00186         ProxyState.CopyTo(*c, AAA_AVP_STRING_TYPE);
00187         cl.add(c);
00188       }
00189     if (Avp.IsSet())
00190       {
00191         c = cm.acquire("AVP");
00192         Avp.CopyTo(*c, AAA_AVP_CUSTOM_TYPE);
00193         cl.add(c);
00194       }
00195   }
00196   void CopyFrom(AAAAvpContainerList &cl)
00197   {
00198     AAAAvpContainer *c;
00199     if ((c = cl.search("Proxy-Host")))
00200       {
00201         ProxyHost.CopyFrom(*c);
00202       }
00203     if ((c = cl.search("Proxy-State")))
00204       {
00205         ProxyState.CopyFrom(*c);
00206       }
00207     if ((c = cl.search("AVP")))
00208       {
00209         Avp.CopyFrom(*c);
00210       }
00211   }       
00212   // Required AVPs
00213   AAA_ScholarAttribute<diameter_identity_t> ProxyHost;
00214   AAA_ScholarAttribute<diameter_octetstring_t> ProxyState;
00215   // Optional AVPs
00216   AAA_VectorAttribute<avp_t> Avp;
00217 };
00218 
00221 class chap_auth_t
00222 {
00223  public:
00224   void CopyTo(AAAAvpContainerList &cl)
00225   {
00226     AAAAvpContainerManager cm;
00227     AAAAvpContainer *c;
00228     if (ChapAlgorithm.IsSet())
00229       {
00230         c = cm.acquire("CHAP-Algorithm");
00231         ChapAlgorithm.CopyTo(*c, AAA_AVP_ENUM_TYPE);
00232         cl.add(c);
00233       }
00234     if (ChapIdent.IsSet())
00235       {
00236         c = cm.acquire("CHAP-Ident");
00237         ChapIdent.CopyTo(*c, AAA_AVP_STRING_TYPE);
00238         cl.add(c);
00239       }
00240     if (ChapResponse.IsSet())
00241       {
00242         c = cm.acquire("CHAP-Response");
00243         ChapResponse.CopyTo(*c, AAA_AVP_STRING_TYPE);
00244         cl.add(c);
00245       }
00246     if (Avp.IsSet())
00247       {
00248         c = cm.acquire("AVP");
00249         Avp.CopyTo(*c, AAA_AVP_CUSTOM_TYPE);
00250         cl.add(c);
00251       }
00252   }
00253   void CopyFrom(AAAAvpContainerList &cl)
00254   {
00255     AAAAvpContainer *c;
00256     if ((c = cl.search("CHAP-Algorithm")))
00257       {
00258         ChapAlgorithm.CopyFrom(*c);
00259       }
00260     if ((c = cl.search("CHAP-Ident")))
00261       {
00262         ChapIdent.CopyFrom(*c);
00263       }
00264     if ((c = cl.search("CHAP-Response")))
00265       {
00266         ChapResponse.CopyFrom(*c);
00267       }
00268     if ((c = cl.search("AVP")))
00269       {
00270         Avp.CopyFrom(*c);
00271       }
00272   }       
00273   // Required AVPs
00274   AAA_ScholarAttribute<diameter_enumerated_t> ChapAlgorithm;
00275 
00276 #define CHAP_ALGORITHM_MD5 5
00277 
00278   AAA_ScholarAttribute<diameter_octetstring_t> ChapIdent;
00279   // Optional AVPs
00280   AAA_ScholarAttribute<diameter_octetstring_t> ChapResponse;
00281   AAA_VectorAttribute<avp_t> Avp;
00282 };
00283 
00285 class AA_RequestData
00286 {
00287  public:
00289   AA_RequestData() {}
00290 
00292   AA_RequestData* Self() { return this; }
00293 
00295   void Clear()
00296   {
00297     SessionId.Clear();
00298     AuthApplicationId.Clear();
00299     OriginHost.Clear();
00300     OriginRealm.Clear();
00301     DestinationRealm.Clear();
00302     AuthRequestType.Clear();
00303     DestinationHost.Clear();
00304     NasIdentifier.Clear();
00305     NasIpAddress.Clear();
00306     NasIpv6Address.Clear();
00307     NasPort.Clear();
00308     NasPortId.Clear();
00309     NasPortType.Clear();
00310     OriginStateId.Clear();
00311     PortLimit.Clear();
00312     UserName.Clear();
00313     UserPassword.Clear();
00314     ServiceType.Clear();
00315     State.Clear();
00316     AuthorizationLifetime.Clear();
00317     AuthGracePeriod.Clear();
00318     AuthSessionState.Clear();
00319     CallbackNumber.Clear();
00320     CalledStationId.Clear();
00321     CallingStationId.Clear();
00322     OriginatingLineInfo.Clear();
00323     ConnectInfo.Clear();
00324     ChapAuth.Clear();
00325     ChapChallenge.Clear();
00326     FramedCompression.Clear();
00327     FramedInterfaceId.Clear();
00328     FramedIpAddress.Clear();
00329     FramedIpv6Prefix.Clear();
00330     FramedIpNetmask.Clear();
00331     FramedMtu.Clear();
00332     FramedProtocol.Clear();
00333     ArapPassword.Clear();
00334     ArapChallengeResponse.Clear();
00335     ArapSecurity.Clear();
00336     ArapSecurityData.Clear();
00337     LoginIpHost.Clear();
00338     LoginIpv6Host.Clear();
00339     LoginLatGroup.Clear();
00340     LoginLatNode.Clear();
00341     LoginLatPort.Clear();
00342     LoginLatService.Clear();
00343     Tunneling.Clear();
00344     ProxyInfo.Clear();
00345     RouteRecord.Clear();
00346     Avp.Clear();
00347   }
00348 
00350   AAA_ScholarAttribute<diameter_utf8string_t> SessionId;
00351   AAA_ScholarAttribute<diameter_unsigned32_t> AuthApplicationId;
00352   AAA_ScholarAttribute<diameter_identity_t>  OriginHost;
00353   AAA_ScholarAttribute<diameter_identity_t>  OriginRealm;
00354   AAA_ScholarAttribute<diameter_identity_t>  DestinationRealm;
00355   /* In RFC3588:
00356 
00357    "8.7.  Auth-Request-Type AVP
00358                                                                                 
00359    The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is
00360    included in application-specific auth requests to inform the peers
00361    whether a user is to be authenticated only, authorized only or both.
00362    Note any value other than both MAY cause RADIUS interoperability
00363    issues.  The following values are defined:
00364                                                                                 
00365    AUTHENTICATE_ONLY          1
00366       The request being sent is for authentication only, and MUST
00367       contain the relevant application specific authentication AVPs that
00368       are needed by the Diameter server to authenticate the user.
00369 
00370    AUTHORIZE_ONLY             2
00371       The request being sent is for authorization only, and MUST contain
00372       the application specific authorization AVPs that are necessary to
00373       identify the service being requested/offered.
00374 
00375    AUTHORIZE_AUTHENTICATE     3
00376       The request contains a request for both authentication and
00377       authorization.  The request MUST include both the relevant
00378       application specific authentication information, and authorization
00379       information necessary to identify the service being
00380       requested/offered."
00381 
00382   */
00383   AAA_ScholarAttribute<diameter_enumerated_t> AuthRequestType;
00384   AAA_ScholarAttribute<diameter_identity_t>  DestinationHost;
00385   AAA_ScholarAttribute<diameter_utf8string_t> NasIdentifier;
00386   AAA_ScholarAttribute<diameter_octetstring_t> NasIpAddress;
00387   AAA_ScholarAttribute<diameter_octetstring_t> NasIpv6Address;
00388   AAA_ScholarAttribute<diameter_unsigned32_t> NasPort;
00389   AAA_ScholarAttribute<diameter_utf8string_t> NasPortId;
00390   AAA_ScholarAttribute<diameter_enumerated_t> NasPortType;
00391   AAA_ScholarAttribute<diameter_unsigned32_t> OriginStateId;
00392   /* In draft-ietf-aaa-diameter-nasreq-14.txt:
00393 
00394    "6.5.  Port-Limit AVP
00395                                                                                 
00396    The Port-Limit AVP (AVP Code 62) is of type Unsigned32 and sets the
00397    maximum number of ports to be provided to the user by the NAS.  It
00398    MAY be used in an authentication and/or authorization request as a
00399    hint to the server that multilink PPP [PPPMP] service is desired, but
00400    the server is not required to honor the hint in the corresponding
00401    response."
00402 
00403   */
00404   AAA_ScholarAttribute<diameter_unsigned32_t> PortLimit;
00405   AAA_ScholarAttribute<diameter_utf8string_t> UserName;
00406   AAA_ScholarAttribute<diameter_utf8string_t> UserPassword;
00407   /* In RFC2865:
00408 
00409    "5.6.  Service-Type
00410                                                                                 
00411    Description
00412                                                                                 
00413       This Attribute indicates the type of service the user has
00414       requested, or the type of service to be provided.  It MAY be used
00415       in both Access-Request and Access-Accept packets.  A NAS is not
00416       required to implement all of these service types, and MUST treat
00417       unknown or unsupported Service-Types as though an Access-Reject
00418       had been received instead."
00419 
00420    Value
00421 
00422       The Value field is four octets.
00423                                                                                 
00424        1      Login
00425        2      Framed
00426        3      Callback Login
00427        4      Callback Framed
00428        5      Outbound
00429        6      Administrative
00430        7      NAS Prompt
00431        8      Authenticate Only
00432        9      Callback NAS Prompt
00433       10      Call Check
00434       11      Callback Administrative
00435 
00436   */
00437   AAA_ScholarAttribute<diameter_enumerated_t> ServiceType;
00438   /* In Section 5.24 of RFC 2865:
00439 
00440    "5.24.  State
00441                                                                                 
00442    Description
00443                                                                                 
00444       This Attribute is available to be sent by the server to the client
00445       in an Access-Challenge and MUST be sent unmodified from the client
00446       to the server in the new Access-Request reply to that challenge,
00447       if any.
00448                                                                                 
00449       This Attribute is available to be sent by the server to the client
00450       in an Access-Accept that also includes a Termination-Action
00451       Attribute with the value of RADIUS-Request.  If the NAS performs
00452       the Termination-Action by sending a new Access-Request upon
00453       termination of the current session, it MUST include the State
00454       attribute unchanged in that Access-Request.
00455                                                                                 
00456       In either usage, the client MUST NOT interpret the attribute
00457       locally.  A packet must have only zero or one State Attribute.
00458       Usage of the State Attribute is implementation dependent."
00459 
00460   */
00461   AAA_ScholarAttribute<diameter_octetstring_t> State;
00462   AAA_ScholarAttribute<diameter_unsigned32_t> AuthorizationLifetime;
00463   AAA_ScholarAttribute<diameter_unsigned32_t> AuthGracePeriod;
00464   /* In Section 8 of RFC3588:
00465 
00466   "An access device that does not expect to send a re-authorization or
00467   a session termination request to the server MAY include the Auth-
00468   Session-State AVP with the value set to NO_STATE_MAINTAINED as a
00469   hint to the server.  If the server accepts the hint, it agrees that
00470   since no session termination message will be received once service
00471   to the user is terminated, it cannot maintain state for the session.
00472   If the answer message from the server contains a different value in
00473   the Auth-Session-State AVP (or the default value if the AVP is
00474   absent), the access device MUST follow the server's directives.
00475   Note that the value NO_STATE_MAINTAINED MUST NOT be set in
00476   subsequent re- authorization requests and answers."
00477 
00478   In Section 8.1 of RFC3588:
00479 
00480   "There are four different authorization session state machines
00481   supported in the Diameter base protocol.  The first two describe a
00482   session in which the server is maintaining session state, indicated
00483   by the value of the Auth-Session-State AVP (or its absence).  One
00484   describes the session from a client perspective, the other from a
00485   server perspective.  The second two state machines are used when the
00486   server does not maintain session state.  Here again, one describes
00487   the session from a client perspective, the other from a server
00488   perspective."
00489 
00490   In Section 8.11 of RFC3588:
00491 
00492   "8.11.  Auth-Session-State AVP
00493                                                                                 
00494   The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and
00495   specifies whether state is maintained for a particular session.  The
00496   client MAY include this AVP in requests as a hint to the server, but
00497   the value in the server's answer message is binding.  The following
00498   values are supported:
00499                                                                                 
00500   STATE_MAINTAINED              0
00501       This value is used to specify that session state is being
00502       maintained, and the access device MUST issue a session termination
00503       message when service to the user is terminated.  This is the
00504       default value.
00505                                                                                 
00506   NO_STATE_MAINTAINED           1
00507       This value is used to specify that no session termination messages
00508       will be sent by the access device upon expiration of the
00509       Authorization-Lifetime."
00510 
00511     */
00512   AAA_ScholarAttribute<diameter_enumerated_t> AuthSessionState;
00513   /* In draft-ietf-aaa-diameter-nasreq-14.txt:
00514 
00515    "6.2.  Callback-Number AVP
00516                                                                                 
00517    The Callback-Number AVP (AVP Code 19) is of type UTF8String, and
00518    contains a dialing string to be used for callback.  It MAY be used in
00519    an authentication and/or authorization request as a hint to the
00520    server that a Callback service is desired, but the server is not
00521    required to honor the hint in the corresponding response.
00522                                                                                 
00523    The codification of the range of allowed usage of this field is
00524    outside the scope of this specification."
00525                                                                                 
00526   */
00527   AAA_ScholarAttribute<diameter_utf8string_t> CallbackNumber;
00528   AAA_ScholarAttribute<diameter_utf8string_t> CalledStationId;
00529   AAA_ScholarAttribute<diameter_utf8string_t> CallingStationId;
00530   AAA_ScholarAttribute<diameter_octetstring_t> OriginatingLineInfo;
00531   AAA_ScholarAttribute<diameter_utf8string_t> ConnectInfo;
00532   AAA_GroupedScholarAttribute<chap_auth_t> ChapAuth;
00533   AAA_ScholarAttribute<diameter_octetstring_t> ChapChallenge;
00534   AAA_VectorAttribute<diameter_enumerated_t> FramedCompression;
00535   AAA_ScholarAttribute<diameter_unsigned64_t> FramedInterfaceId;
00536   AAA_ScholarAttribute<diameter_octetstring_t> FramedIpAddress;
00537   AAA_VectorAttribute<diameter_octetstring_t> FramedIpv6Prefix;
00538   AAA_ScholarAttribute<diameter_octetstring_t> FramedIpNetmask;
00539   /* In draft-ietf-aaa-diameter-nasreq-14.txt:
00540 
00541    "6.9.3.  Framed-MTU AVP
00542                                                                                 
00543    The Framed-MTU AVP (AVP Code 12) is of type Unsigned32 and contains
00544    the Maximum Transmission Unit to be configured for the user, when it
00545    is not negotiated by some other means (such as PPP). This AVP SHOULD
00546    only be present in authorization responses. The MTU value MUST be in
00547    the range of 64 and 65535."
00548 
00549   */
00550   AAA_ScholarAttribute<diameter_unsigned32_t> FramedMtu;
00551   /* In draft-ietf-aaa-diameter-nasreq-14.txt:
00552 
00553    "6.9.1.  Framed-Protocol AVP
00554                                                                                 
00555    The Framed-Protocol AVP (AVP Code 7) is of type Enumerated and
00556    contains the framing to be used for framed access. This AVP MAY be
00557    present in both requests and responses. The supported values are
00558    listed in [RADIUSTypes].  The following list is informational:
00559 
00560        1  PPP
00561        2  SLIP
00562        3  AppleTalk Remote Access Protocol (ARAP)
00563        4  Gandalf proprietary SingleLink/MultiLink protocol
00564        5  Xylogics proprietary IPX/SLIP
00565        6  X.75 Synchronous"
00566 
00567   */
00568   AAA_ScholarAttribute<diameter_enumerated_t> FramedProtocol;
00569   AAA_ScholarAttribute<diameter_octetstring_t> ArapPassword;
00570   AAA_ScholarAttribute<diameter_octetstring_t> ArapChallengeResponse;
00571   AAA_ScholarAttribute<diameter_unsigned32_t> ArapSecurity;
00572   AAA_VectorAttribute<diameter_octetstring_t> ArapSecurityData;
00573   AAA_VectorAttribute<diameter_octetstring_t> LoginIpHost;
00574   AAA_VectorAttribute<diameter_octetstring_t> LoginIpv6Host;
00575   AAA_ScholarAttribute<diameter_octetstring_t> LoginLatGroup;
00576   AAA_ScholarAttribute<diameter_octetstring_t> LoginLatNode;
00577   AAA_ScholarAttribute<diameter_octetstring_t> LoginLatPort;
00578   AAA_ScholarAttribute<diameter_octetstring_t> LoginLatService;
00579   AAA_GroupedVectorAttribute<tunneling_t> Tunneling;
00580   AAA_GroupedVectorAttribute<proxyinfo_t> ProxyInfo;
00581   AAA_VectorAttribute<diameter_identity_t> RouteRecord;
00582   AAA_VectorAttribute<avp_t> Avp;
00583 };
00584 
00586 class AA_AnswerData
00587 {
00588  public:
00590   AA_AnswerData() {}
00591 
00593   AA_AnswerData* Self() { return this; }
00594 
00596   void Clear()
00597   {
00598     SessionId.Clear();
00599     AuthApplicationId.Clear();
00600     AuthRequestType.Clear();
00601     ResultCode.Clear();
00602     OriginHost.Clear();
00603     OriginRealm.Clear();
00604     UserName.Clear();
00605     ServiceType.Clear();
00606     Class.Clear();
00607     ConfigurationToken.Clear();
00608     AcctInterimInterval.Clear();
00609     ErrorMessage.Clear();
00610     ErrorReportingHost.Clear();
00611     IdleTimeout.Clear();
00612     AuthorizationLifetime.Clear();
00613     AuthGracePeriod.Clear();
00614     AuthSessionState.Clear();
00615     ReAuthRequestType.Clear();
00616     SessionTimeout.Clear();
00617     State.Clear();
00618     ReplyMessage.Clear();
00619     OriginStateId.Clear();
00620     FilterId.Clear();
00621     PasswordRetry.Clear();
00622     PortLimit.Clear();
00623     Prompt.Clear();
00624     ArapChallengeResponse.Clear();
00625     ArapFeatures.Clear();
00626     ArapSecurity.Clear();
00627     ArapSecurityData.Clear();
00628     ArapZoneAccess.Clear();
00629     CallbackId.Clear();
00630     CallbackNumber.Clear();
00631     FramedAppletalkLink.Clear();
00632     FramedAppletalkNetwork.Clear();
00633     FramedAppletalkZone.Clear();
00634     FramedCompression.Clear();
00635     FramedInterfaceId.Clear();
00636     FramedIpAddress.Clear();
00637     FramedIpv6Prefix.Clear();
00638     FramedIpv6Pool.Clear();
00639     FramedIpv6Route.Clear();
00640     FramedIpNetmask.Clear();
00641     FramedRoute.Clear();
00642     FramedMtu.Clear();
00643     FramedRoute.Clear();
00644     FramedPool.Clear();
00645     FramedIpxNetwork.Clear();
00646     FramedMtu.Clear();
00647     FramedProtocol.Clear();
00648     FramedRouting.Clear();
00649     LoginLatGroup.Clear();
00650     LoginLatNode.Clear();
00651     LoginLatPort.Clear();
00652     LoginLatService.Clear();
00653     LoginService.Clear();
00654     LoginTcpPort.Clear();
00655     NasFilterRule.Clear();
00656     Tunneling.Clear();
00657     RedirectHost.Clear();
00658     RedirectHostUsage.Clear();
00659     RedirectMaxCacheTime.Clear();
00660     ProxyInfo.Clear();
00661     Avp.Clear();
00662   }
00663 
00665   AAA_ScholarAttribute<diameter_utf8string_t> SessionId;
00666   AAA_ScholarAttribute<diameter_unsigned32_t> AuthApplicationId;
00667   AAA_ScholarAttribute<diameter_enumerated_t> AuthRequestType;
00668   AAA_ScholarAttribute<diameter_unsigned32_t> ResultCode;
00669   AAA_ScholarAttribute<diameter_identity_t>  OriginHost;
00670   AAA_ScholarAttribute<diameter_identity_t>  OriginRealm;
00671   AAA_ScholarAttribute<diameter_utf8string_t> UserName;
00672   AAA_ScholarAttribute<diameter_enumerated_t> ServiceType;
00673   AAA_VectorAttribute<diameter_octetstring_t> Class;
00674   /* RFC2869
00675 
00676    5.12.  Configuration-Token
00677                                                                                 
00678    Description
00679                                                                                 
00680       This attribute is for use in large distributed authentication
00681       networks based on proxy.  It is sent from a RADIUS Proxy Server to
00682       a RADIUS Proxy Client in an Access-Accept to indicate a type of
00683       user profile to be used.  It should not be sent to a NAS.
00684 
00685   */
00686   AAA_VectorAttribute<diameter_octetstring_t> ConfigurationToken;
00687   AAA_ScholarAttribute<diameter_unsigned32_t> AcctInterimInterval;
00688   AAA_ScholarAttribute<diameter_utf8string_t> ErrorMessage;
00689   AAA_ScholarAttribute<diameter_identity_t>  ErrorReportingHost;
00690   AAA_ScholarAttribute<diameter_unsigned32_t> IdleTimeout;
00691   AAA_ScholarAttribute<diameter_unsigned32_t> AuthorizationLifetime;
00692   AAA_ScholarAttribute<diameter_unsigned32_t> AuthGracePeriod;
00693   AAA_ScholarAttribute<diameter_enumerated_t> AuthSessionState;
00694   AAA_ScholarAttribute<diameter_enumerated_t> ReAuthRequestType;
00695   AAA_ScholarAttribute<diameter_unsigned32_t> SessionTimeout;
00696   AAA_ScholarAttribute<diameter_octetstring_t> State;
00697   /* In draft-ietf-aaa-diameter-nasreq-14.txt:
00698 
00699    "4.9.  Reply-Message AVP
00700                                                                                 
00701    The Reply-Message AVP (AVP Code 18) is of type UTF8String, and
00702    contains text which MAY be displayed to the user.  When used in an
00703    AA-Answer message with a successful Result-Code AVP it indicates a
00704    success message. When found in the same message with a Result-Code
00705    other than DIAMETER_SUCCESS it contains a failure message.
00706                                                                                 
00707    The Reply-Message AVP MAY indicate a dialog message to prompt the
00708    user before another AA-Request attempt. When used in an AA-Answer, it
00709    MAY indicate a dialog message to prompt the user for a response.
00710                                                                                 
00711    Multiple Reply-Message's MAY be included and if any are displayed,
00712    they MUST be displayed in the same order as they appear in the
00713    message."
00714 
00715   */
00716                                                                                 
00717   AAA_VectorAttribute<diameter_utf8string_t> ReplyMessage;
00718   AAA_ScholarAttribute<diameter_unsigned32_t> OriginStateId;
00719   /* In draft-ietf-aaa-diameter-nasreq-14.txt:
00720 
00721    "6.7.  Filter-Id AVP
00722                                                                                 
00723    The Filter-Id AVP (AVP Code 11) is of type UTF8String, and contains
00724    the name of the filter list for this user. Zero or more Filter-Id
00725    AVPs MAY be sent in an authorization answer.
00726                                                                                 
00727    Identifying a filter list by name allows the filter to be used on
00728    different NASes without regard to filter-list implementation details.
00729    However, this AVP is not roaming friendly since filter naming differs
00730    from one service provider to another.
00731                                                                                 
00732    In non-RADIUS environments, it is RECOMMENDED that the NAS-Filter-
00733    Rule AVP be used instead."
00734 
00735   */
00736 
00737   AAA_VectorAttribute<diameter_utf8string_t> FilterId;
00738   AAA_ScholarAttribute<diameter_unsigned32_t> PasswordRetry;
00739   AAA_ScholarAttribute<diameter_unsigned32_t> PortLimit;
00740   AAA_ScholarAttribute<diameter_enumerated_t> Prompt;
00741   AAA_ScholarAttribute<diameter_octetstring_t> ArapChallengeResponse;
00742   AAA_VectorAttribute<diameter_octetstring_t> ArapFeatures;
00743   AAA_ScholarAttribute<diameter_unsigned32_t> ArapSecurity;
00744   AAA_VectorAttribute<diameter_octetstring_t> ArapSecurityData;
00745   AAA_ScholarAttribute<diameter_enumerated_t> ArapZoneAccess;
00746   /* In draft-ietf-aaa-diameter-nasreq-14.txt:
00747 
00748    "6.3.  Callback-Id AVP
00749                                                                                 
00750    The Callback-Id AVP (AVP Code 20) is of type UTF8String, and contains
00751    the name of a place to be called, to be interpreted by the NAS. This
00752    AVP MAY be present in an authentication and/or authorization
00753    response.
00754                                                                                 
00755    This AVP is not roaming-friendly since it assumes that the Callback-
00756    Id is configured on the NAS. It is therefore preferable to use the
00757    Callback-Number AVP instead."
00758 
00759   */
00760                                                                                 
00761   AAA_ScholarAttribute<diameter_utf8string_t> CallbackId;
00762   AAA_ScholarAttribute<diameter_utf8string_t> CallbackNumber;
00763   AAA_ScholarAttribute<diameter_unsigned32_t> FramedAppletalkLink;
00764   AAA_VectorAttribute<diameter_unsigned32_t> FramedAppletalkNetwork;
00765   AAA_ScholarAttribute<diameter_octetstring_t> FramedAppletalkZone;
00766   AAA_VectorAttribute<diameter_enumerated_t> FramedCompression;
00767   AAA_ScholarAttribute<diameter_unsigned64_t> FramedInterfaceId;
00768   AAA_ScholarAttribute<diameter_octetstring_t> FramedIpAddress;
00769   AAA_VectorAttribute<diameter_octetstring_t> FramedIpv6Prefix;
00770   AAA_ScholarAttribute<diameter_octetstring_t> FramedIpv6Pool;
00771   AAA_VectorAttribute<diameter_utf8string_t> FramedIpv6Route;
00772   AAA_ScholarAttribute<diameter_octetstring_t> FramedIpNetmask;
00773   AAA_VectorAttribute<diameter_utf8string_t> FramedRoute;
00774   AAA_ScholarAttribute<diameter_octetstring_t> FramedPool;
00775   AAA_ScholarAttribute<diameter_utf8string_t> FramedIpxNetwork;
00776   AAA_ScholarAttribute<diameter_unsigned32_t> FramedMtu;
00777   AAA_ScholarAttribute<diameter_enumerated_t> FramedProtocol;
00778   /* In draft-ietf-aaa-diameter-nasreq-14.txt:
00779 
00780    "6.9.2.  Framed-Routing AVP
00781                                                                                 
00782    The Framed-Routing AVP (AVP Code 10) is of type Enumerated and
00783    contains the routing method for the user, when the user is a router
00784    to a network.  This AVP SHOULD only be present in authorization
00785    responses. The supported values are listed in [RADIUSTypes].      The
00786    following list is informational:
00787                                                                                 
00788       0  None
00789       1  Send routing packets
00790       2  Listen for routing packets
00791       3  Send and Listen" 
00792 
00793   */
00794 
00795   AAA_ScholarAttribute<diameter_enumerated_t> FramedRouting;
00796   AAA_VectorAttribute<diameter_ipfilter_rule_t> NasFilterRule;
00797   AAA_VectorAttribute<diameter_octetstring_t> LoginIpHost;
00798   AAA_VectorAttribute<diameter_octetstring_t> LoginIpv6Host;
00799   AAA_ScholarAttribute<diameter_octetstring_t> LoginLatGroup;
00800   AAA_ScholarAttribute<diameter_octetstring_t> LoginLatNode;
00801   AAA_ScholarAttribute<diameter_octetstring_t> LoginLatPort;
00802   AAA_ScholarAttribute<diameter_octetstring_t> LoginLatService;
00803   AAA_ScholarAttribute<diameter_enumerated_t> LoginService;
00804   AAA_ScholarAttribute<diameter_unsigned32_t> LoginTcpPort;
00805   AAA_GroupedVectorAttribute<tunneling_t> Tunneling;
00806   AAA_VectorAttribute<diameter_identity_t>  RedirectHost;
00807   AAA_ScholarAttribute<diameter_enumerated_t>  RedirectHostUsage;
00808   AAA_ScholarAttribute<diameter_unsigned32_t>  RedirectMaxCacheTime;
00809   AAA_GroupedVectorAttribute<proxyinfo_t> ProxyInfo;
00810   AAA_VectorAttribute<avp_t> Avp;
00811 };
00812 
00813 typedef AAAParser<AAAMessage*, AA_RequestData*> AA_RequestParser;
00814 typedef AAAParser<AAAMessage*, AA_AnswerData*> AA_AnswerParser;
00815 
00816 void AA_RequestParser::parseRawToApp();
00817 void AA_RequestParser::parseAppToRaw();
00818 
00819 void AA_AnswerParser::parseRawToApp();
00820 void AA_AnswerParser::parseAppToRaw();
00821 
00822 #endif //__EAP_NASREQ_PARSER_H__

Generated on Fri Jun 25 19:15:15 2004 for Diameter NASREQ Application by doxygen 1.3.5