140 likes | 291 Vues
The PANA API draft-hiko-pana-api-02.txt. Yoshihiko Kainuma Fumio Teraoka Graduate School of Science and Technology Keio University. Assumed Usage of PANA Library. (out of scope of this i-d). PaC main part. PAA / AAAc main part. AAArelay main part. pana. diameter. pana lib. pana lib.
E N D
The PANA APIdraft-hiko-pana-api-02.txt Yoshihiko Kainuma Fumio Teraoka Graduate School of Science and Technology Keio University
Assumed Usage of PANA Library (out of scope of this i-d) PaC main part PAA / AAAc main part AAArelay main part pana diameter pana lib pana lib diameterlib diameterlib AAA relay process PaC process on mobile node PAA / AAAc process on server or router diameter snmp router/bridge AAAh main part EP diameterlib AAA home process
PANA API Overview • Based on draft-ietf-pana-pana-12.txt • Multi-Thread Main thread Listener thread Message callback thread listen to messages from peer. execute message callbacks. Session thread Timeout callback thread manage timers. execute timer callbacks. Retransmission thread retransmit messages.
37 functions are defined. Initialization and Configuration (3) PANAOpen() PANAClose() PANAGetDefaultConfigFileName() Callback registration (4) PANARegisterMessageCallback() PANADeregisterMessageCallback() PANARegisterTimerCallback() PANADeregisterTimerCallback() Session management (8) PANANewSession() PANAFreeSession() PANARegisterSession() PANASetSessionAttribute() PANAGetSessionAttribute() PANASessionValidityCheck() PANADeriveAuthKey() PANADeriveMasterKey() API List (1/2)
PANA operation (9) PANAClientInitiation() PANAStart() PANAAuth() PANABind() PANAPing() PANATerimnation() PANAError() PANAReauth() PANAUpdate() EP control (2) PANASetEP() PANASetMasterKey() Dictionary lookup (6) PANADictionaryEntryFromAVPCode() PANADictionaryEntryFromName() PANAValueFromName() PANAValueFromAVPCode() PANALookupValueNameUsingValue() PANAGetMessageCode() Message management (5) PANACreateAVP() PANAFreeAVP() PANACreateAndAddAVPToList() PANARemoveAVPFromList() PANAComputeAuthAVP() API List (2/2)
Callback Registration • PANARegisterMessageCallback (PANAMessageCode code, PANAMessageFlag flg, PANAVendorID vid, char *messageName, PANACallback *callback, PANACallbackPosition *position) important parameters • code: Code of the message (e.g. PANA-Start: 2). • flg: Flag of the message (e.g. REQUEST: 0x8000). • callback: Callback to be registered.
Message Creation and Transmission • PANAAuth (PANASessionID *id, PANAMessageFlag flg, PANA_AVP_LIST *avp_list) important parameters • id: Identifier of the session to be handled. • flg: Flag of the message (e.g. REQUEST: 0x8000). • avp_list: AVP list to be attached to the message. *other PANA functions have the similar syntax.
Example Implementation (PaC) PaC PAA Diameter server PCI PSR PSA PAR PAN Diameter-EAP Request Diameter-EAP Answer ・・・ Diameter-EAP Request Diameter-EAP Answer PBR PBA
Example Implementation (PaC) PANAReturnCode HandleStartRequest(void *ptr) { PANAMessage *msg = (PANAMessage *)ptr; PANA_AVP_LIST *avpList; ・ ・ ・ PANAReturnCode res = PANAStart(msg->sender, 0, avpList); return res; } int main() { ・ ・ ・ PANARegisterMessageCallback(PANA_START, REQUEST, 0, NULL, HandleStartRequest, PANA_APP_INSTALL_ANYWHERE); ・ ・ ・ } Create message and send it to PAA Register callback function
Example Implementation (PAA to AAAc) PaC PAA / Diameter client Diameter server PCI PSR PSA PAR PAN Diameter-EAP Request Diameter-EAP Answer ・・・ Diameter-EAP Request Diameter-EAP Answer PBR PBA
Example Implementation (PAA to AAAc) PANAReturnCode HandleAuthAnswer(void *ptr) { PANAMessage *msg_pana = (PANAMessage *)ptr; AAAMessage *msg_aaa; PANA_AVP_LIST *avpList; ・ ・ ・ AAAReturnCode res = AAASendMessage(msg_aaa); return res; } int main() { ・ ・ ・ PANARegisterMessageCallback(PANA_AUTH, REQUEST, 0, NULL, HandleAuthAnswer, PANA_APP_INSTALL_ANYWHERE); ・ ・ ・ } Create message and send it to Diameter Register callback function
Example Implementation (AAAc to PAA) PaC PAA Diameter server PCI PSR PSA PAR PAN Diameter-EAP Request Diameter-EAP Answer ・・・ Diameter-EAP Request Diameter-EAP Answer PBR PBA
Example Implementation (AAAc to PAA) PANAReturnCode HandleEAPAnswer(void *ptr) { AAAMessage *msg_aaa = (AAAMessage *)ptr; PANAMessage *msg_pana; PANASessionID *id PANA_AVP_LIST *avpList; ・ ・ ・ PANAReturnCode res = PANABind(id, REQUEST, avpList); return res; } int main() { ・ ・ ・ AAARegisterCommandCallback(EAP_APPLICATION, AAA_NO_VENDOR_ID, NULL, 0, HandleEAPAnswer, AAA_APP_INSTALL_FIRST); ・ ・ ・ } Create message and send it to PaC Registering callback function
Current Status • PANA API implementation • based on draft-ietf-pana-pana-12.txt • developed on FreeBSD • running on *BSD and Linux • will be released with BSD license. • Diameter API implementation • based on draft-ietf-dime-diameter-api-00.txt (expired) • developed on FreeBSD • running on *BSD and Linux • will be released with BSD license. • Adapt this draft as WG document?