D:/Storage/CVS_Head/h323plus/include/h235plugin.h

00001 /*
00002  * h235pugin.h
00003  *
00004  * h235 Implementation for the h323plus library.
00005  *
00006  * Copyright (c) 2006 ISVO (Asia) Pte Ltd. All Rights Reserved.
00007  *
00008  * The contents of this file are subject to the Mozilla Public License
00009  * Version 1.1 (the "License"); you may not use this file except in
00010  * compliance with the License. You may obtain a copy of the License at
00011  * http://www.mozilla.org/MPL/
00012  *
00013  * Alternatively, the contents of this file may be used under the terms
00014  * of the General Public License (the  "GNU License"), in which case the
00015  * provisions of GNU License are applicable instead of those
00016  * above. If you wish to allow use of your version of this file only
00017  * under the terms of the GNU License and not to allow others to use
00018  * your version of this file under the MPL, indicate your decision by
00019  * deleting the provisions above and replace them with the notice and
00020  * other provisions required by the GNU License. If you do not delete
00021  * the provisions above, a recipient may use your version of this file
00022  * under either the MPL or the GNU License."
00023  *
00024  * Software distributed under the License is distributed on an "AS IS"
00025  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00026  * the License for the specific language governing rights and limitations
00027  * under the License.
00028  *
00029  *
00030  * Contributor(s): ______________________________________.
00031  *
00032  * $Log: h235plugin.h,v $
00033  * Revision 1.1  2007/08/06 20:50:49  shorne
00034  * First commit of h323plus
00035  *
00036  *
00037  *
00038  *
00039  */
00040 
00041 #ifndef __h235PLUGIN_H
00042 #define __h235PLUGIN_H
00043 
00044 #include <time.h>
00045 
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050 
00052 //
00053 // h235 Plugins
00054 
00055 #define PWLIB_PLUGIN_API_VERSION     0
00056 #define PLUGIN_H235_VERSION          1  
00057 
00058 
00059 // Function calls
00060 static const char H235_BuildClear[]       = "Build_Clear";
00061 static const char H235_BuildCrypto[]      = "Build_Crypto";
00062 static const char H235_FinaliseCrypto[]   = "Finalise_Crypto";
00063 static const char H235_ValidateClear[]    = "Validate_Clear";
00064 static const char H235_ValidateCrypto[]   = "Validate_Crypto";
00065 
00066 // Settings direction
00067 static const char GET_PLUGINH235_SETTINGS[]    = "get_h235_settings";
00068 static const char SET_PLUGINH235_SETTINGS[]    = "set_h235_settings";
00069 
00070 // Validation Constants
00071 #define Pluginh235_Val_OK            0     
00072 #define Pluginh235_Val_Absent        1     
00073 #define Pluginh235_Val_Error         2     
00074 #define Pluginh235_Val_InvalidTime   3     
00075 #define Pluginh235_Val_BadPassword   4     
00076 #define Pluginh235_Val_ReplyAttack   5     
00077 #define Pluginh235_Val_Disabled      6     
00078 
00079 
00080 // Application Constants
00081 #define Pluginh235_App_GKAdmission       0     
00082 #define Pluginh235_App_EPAuthentication  1     
00083 #define Pluginh235_App_LRQOnly           2     
00084 #define Pluginh235_App_AnyApplication    3     
00085 
00086 
00087 // Settings constants
00088 static const char Pluginh235_Set_Application[]             ="Application";
00089 static const char Pluginh235_Set_UseGkAndEpIdentifiers[]   ="UseGkAndEpIdentifiers";
00090 static const char Pluginh235_Set_IsSecuredPDU[]            ="IsSecuredPDU";
00091 static const char Pluginh235_Set_IsSecuredSignalPDU[]      ="IsSecuredSignalPDU";
00092 static const char Pluginh235_Set_IsActive[]                ="IsActive";
00093 static const char Pluginh235_Set_RemoteId[]                ="RemoteId";       
00094 static const char Pluginh235_Set_LocalId[]                 ="LocalId";   
00095 static const char Pluginh235_Set_Password[]                ="Password";
00096 static const char Pluginh235_Set_TimestampGracePeriod[]    ="TimestampGracePeriod";
00097 
00098 // Ras Message constants
00099 #define Pluginh235_msg_gatekeeperRequest           0
00100 #define Pluginh235_msg_gatekeeperConfirm               1
00101 #define Pluginh235_msg_gatekeeperReject            2
00102 #define Pluginh235_msg_registrationRequest         3
00103 #define Pluginh235_msg_registrationConfirm         4
00104 #define Pluginh235_msg_registrationReject          5
00105 #define Pluginh235_msg_unregistrationRequest       6
00106 #define Pluginh235_msg_unregistrationConfirm       7
00107 #define Pluginh235_msg_unregistrationReject        8
00108 #define Pluginh235_msg_admissionRequest            9
00109 #define Pluginh235_msg_admissionConfirm            10
00110 #define Pluginh235_msg_admissionReject             11
00111 #define Pluginh235_msg_bandwidthRequest            12
00112 #define Pluginh235_msg_bandwidthConfirm            13
00113 #define Pluginh235_msg_bandwidthReject             14
00114 #define Pluginh235_msg_disengageRequest            15
00115 #define Pluginh235_msg_disengageConfirm            16
00116 #define Pluginh235_msg_disengageReject             17
00117 #define Pluginh235_msg_locationRequest             18
00118 #define Pluginh235_msg_locationConfirm             19
00119 #define Pluginh235_msg_locationReject              20
00120 #define Pluginh235_msg_infoRequest                 21
00121 #define Pluginh235_msg_infoRequestResponse         22
00122 
00123 // Signal message constants
00124 #define Pluginh235_msg_setup                       0
00125 #define Pluginh235_msg_callProceeding              1
00126 #define Pluginh235_msg_connect                     2
00127 #define Pluginh235_msg_alerting                    3
00128 #define Pluginh235_msg_information                 4
00129 #define Pluginh235_msg_releaseComplete             5
00130 #define Pluginh235_msg_facility                    6
00131 #define Pluginh235_msg_progress                    7
00132 #define Pluginh235_msg_empty                       8
00133 #define Pluginh235_msg_status                      9
00134 #define Pluginh235_msg_statusInquiry              10
00135 #define Pluginh235_msg_setupAcknowledge           11
00136 #define Pluginh235_msg_notify                     12
00137 
00138 
00140 
00141 enum Pluginh235_Flags {
00142  // Token type
00143   Pluginh235_TokenTypeMask           = 0x000f,
00144   Pluginh235_TokenTypeclear          = 0x0000,
00145   Pluginh235_TokenTypecrypto         = 0x0001,
00146   Pluginh235_TokenTypeBoth           = 0x0002,
00147 
00148  // CryptoToken Style
00149   Pluginh235_TokenStyleMask          = 0x0010,
00150   Pluginh235_TokenStyleHash          = 0x0010,
00151   Pluginh235_TokenStyleSigned        = 0x0011,
00152   Pluginh235_TokenStyleEncrypted     = 0x0012
00153 };
00154 
00155 struct Pluginh235_Definition;
00156 
00157 struct Pluginh235_ControlDefn {
00158   const char * name;
00159   int (*control)(const struct Pluginh235_Definition * def, void * context, 
00160                  const char * parm, const char * value);
00161 };
00162 
00164 
00165 struct Pluginh235_information {
00166   // start of version 1 fields
00167   time_t timestamp;                     // codec creation time and date - obtain with command: date -u "+%c = %s"
00168 
00169   const char * sourceAuthor;            // source code author
00170   const char * sourceVersion;           // source code version
00171   const char * sourceEmail;             // source code email contact information
00172   const char * sourceURL;               // source code web site
00173   const char * sourceCopyright;         // source code copyright
00174   const char * sourceLicense;           // source code license
00175   unsigned char sourceLicenseCode;      // source code license
00176 
00177   const char * h235Description;          // h235 description
00178   const char * h235Manufacturer;         // h235 Manufacturer
00179   const char * h235Model;                // h235 Model
00180   const char * h235Email;                        // h235 email contact information
00181   const char * h235URL;                  // h235 Manufacturer web site
00182   // end of version 1 fields
00183 };
00184 
00185 struct Pluginh235_Definition {
00186   unsigned int version;                                // codec structure version
00187 
00188   // start of version 1 fields
00189   struct Pluginh235_information * info;                // license information
00190 
00191   unsigned int flags;                                  // Pluginh235_Flags,        
00192   const char * desc;                                           // text decription
00193   const char * identifier;                             // OID Identifier
00194   const void * userData;                               // user data value
00195 
00196   void *(*createh235)(const struct Pluginh235_Definition * def);                       // create h235 
00197   void (*destroyh235)(const struct Pluginh235_Definition * def);                   // destroy h235
00198   int (*h235function)(const struct Pluginh235_Definition * def,  void * context,   // do H235 function
00199                           const char * function,const void * data, unsigned * dataLen,
00200                                           const void * raw, unsigned * rawLen);
00201 
00202   struct Pluginh235_ControlDefn * h235Controls;                                     // do control function
00203 
00204   // end of version 1 fields
00205 };
00206 
00207 typedef struct Pluginh235_Definition * (* Pluginh235_Geth235Function)(unsigned int *, unsigned int);
00208 typedef unsigned (* Pluginh235_GetAPIVersionFunction)();
00209 
00210 
00212 //
00213 // Plugin Definition
00214 //
00215 
00216 // API version
00217 #define PLUGIN_H235_API_VER_FN       PWLibPlugin_GetAPIVersion
00218 #define PLUGIN_H235_API_VER_FN_STR   "PWLibPlugin_GetAPIVersion"
00219 
00220 // Harware Input Device
00221 #define PLUGIN_H235_GET_DEVICE_FN       Opalh235Plugin_GetDevice
00222 #define PLUGIN_H235_GET_DEVICE_FN_STR "Opalh235Plugin_GetDevice"
00223 
00224 
00225 #  define PLUGIN_H235_IMPLEMENT(name) \
00226 PLUGIN_CODEC_DLL_API unsigned int PLUGIN_H235_API_VER_FN() \
00227 { return PWLIB_PLUGIN_API_VERSION; } \
00228 
00229 
00230 #ifdef __cplusplus
00231 };
00232 #endif
00233 
00234 #endif // __h235PLUGIN_H

Generated on Thu Oct 25 13:42:10 2007 for h323plus by  doxygen 1.5.2