├── AC.c ├── ACAppsProtocol.h ├── ACBinding.c ├── ACBinding.h ├── ACConfigFile.c ├── ACConfigureState.c ├── ACDataCheckState.c ├── ACDiscoveryState.c ├── ACIEEEConfigurationState.c ├── ACInterface.c ├── ACInterface.h ├── ACJoinState.c ├── ACMainLoop.c ├── ACMultiHomedSocket.c ├── ACMultiHomedSocket.h ├── ACProtocol.c ├── ACProtocol.h ├── ACProtocol_User.c ├── ACRetransmission.c ├── ACRunState.c ├── ACSettingsFile.c ├── CW80211InformationElements.c ├── CW80211ManagementFrame.c ├── CWAC.h ├── CWAVL.c ├── CWAVL.h ├── CWBinding.c ├── CWBinding.h ├── CWCommon.c ├── CWCommon.h ├── CWConfigFile.c ├── CWConfigFile.h ├── CWErrorHandling.c ├── CWErrorHandling.h ├── CWFreqPayloads.h ├── CWList.c ├── CWList.h ├── CWLog.c ├── CWLog.h ├── CWNetwork.c ├── CWNetwork.h ├── CWOpenSSLBio.c ├── CWProtocol.c ├── CWProtocol.h ├── CWRandom.c ├── CWRandom.h ├── CWSafeList.c ├── CWSafeList.h ├── CWSecurity.c ├── CWSecurity.h ├── CWStevens.c ├── CWStevens.h ├── CWThread.c ├── CWThread.h ├── CWTimer.h ├── CWTunnel.c ├── CWTunnel.h ├── CWVendorPayloads.h ├── CWVendorPayloadsAC.c ├── CWVendorPayloadsWTP.c ├── CWWTP.h ├── Doxyfile ├── HostapdHeaders ├── common │ ├── defs.h │ ├── eapol_common.h │ ├── gas.h │ ├── ieee802_11_common.h │ ├── ieee802_11_defs.h │ ├── ieee802_1x_defs.h │ ├── privsep_commands.h │ ├── qca-vendor-attr.h │ ├── qca-vendor.h │ ├── sae.h │ ├── tnc.h │ ├── version.h │ ├── wpa_common.h │ ├── wpa_ctrl.h │ └── wpa_helpers.h └── utils │ ├── .gitignore │ ├── base64.h │ ├── bitfield.h │ ├── browser.h │ ├── build_config.h │ ├── common.h │ ├── edit.h │ ├── eloop.c │ ├── eloop.h │ ├── ext_password.h │ ├── ext_password_i.h │ ├── http-utils.h │ ├── includes.h │ ├── ip_addr.h │ ├── list.h │ ├── os.h │ ├── os_unix.c │ ├── pcsc_funcs.h │ ├── platform.h │ ├── radiotap.h │ ├── radiotap_iter.h │ ├── state_machine.h │ ├── trace.h │ ├── uuid.h │ ├── wpa_debug.h │ ├── wpabuf.h │ └── xml-utils.h ├── IEEEBinding.h ├── INSTALL ├── Makefile ├── README.md ├── WTP.c ├── WTPBinding.c ├── WTPBinding.h ├── WTPConfigFile.c ├── WTPConfigureState.c ├── WTPDataCheckState.c ├── WTPDiscoveryState.c ├── WTPDriverInteraction.c ├── WTPFrameReceive.c ├── WTPFrameReceive.h ├── WTPFreqStatsReceive.c ├── WTPFreqStatsReceive.h ├── WTPIEEEConfigurationState.c ├── WTPJoinState.c ├── WTPNL80211Driver.c ├── WTPNL80211DriverCallback.c ├── WTPNL80211Netlink.c ├── WTPProtocol.c ├── WTPProtocol.h ├── WTPProtocol_User.c ├── WTPRadio.c ├── WTPRetransmission.c ├── WTPRunState.c ├── WTPRunStateCheck.c ├── WTPSettingsFile.c ├── WTPStatsReceive.c ├── WTPStatsReceive.h ├── WTPSulkingState.c ├── WTPipcHostapd.c ├── WTPipcHostapd.h ├── WUA.c ├── WUM.h ├── capwap_bugfix_0.01 ├── changelog-1.0 ├── client.pem ├── common.h ├── config.ac ├── config.h ├── config.wtp ├── docs ├── OpenCapwap.pdf └── WTPUpdateSystem.pdf ├── ieee80211.h ├── ieee802_11_defs.h ├── include └── openssl │ ├── aes.h │ ├── asn1.h │ ├── asn1_mac.h │ ├── asn1t.h │ ├── bio.h │ ├── blowfish.h │ ├── bn.h │ ├── buffer.h │ ├── camellia.h │ ├── cast.h │ ├── cms.h │ ├── comp.h │ ├── conf.h │ ├── conf_api.h │ ├── crypto.h │ ├── des.h │ ├── des_old.h │ ├── dh.h │ ├── dsa.h │ ├── dso.h │ ├── dtls1.h │ ├── e_os2.h │ ├── ebcdic.h │ ├── engine.h │ ├── err.h │ ├── evp.h │ ├── fips.h │ ├── fips_rand.h │ ├── hmac.h │ ├── krb5_asn.h │ ├── kssl.h │ ├── lhash.h │ ├── md2.h │ ├── md4.h │ ├── md5.h │ ├── obj_mac.h │ ├── objects.h │ ├── ocsp.h │ ├── opensslconf-i386.h │ ├── opensslconf.h │ ├── opensslv.h │ ├── ossl_typ.h │ ├── pem.h │ ├── pem2.h │ ├── pkcs12.h │ ├── pkcs7.h │ ├── pq_compat.h │ ├── pqueue.h │ ├── rand.h │ ├── rc2.h │ ├── rc4.h │ ├── ripemd.h │ ├── rsa.h │ ├── safestack.h │ ├── seed.h │ ├── sha.h │ ├── ssl.h │ ├── ssl2.h │ ├── ssl23.h │ ├── ssl3.h │ ├── stack.h │ ├── store.h │ ├── symhacks.h │ ├── tls1.h │ ├── tmdiff.h │ ├── txt_db.h │ ├── ui.h │ ├── ui_compat.h │ ├── x509.h │ ├── x509_vfy.h │ └── x509v3.h ├── modifiche_uci_frequency_2009.txt ├── nl80211.h ├── os.h ├── root.pem ├── server.pem ├── settings.ac.txt ├── settings.wtp.txt ├── smac_code.h ├── tap.c ├── tap.h ├── timerlib.c ├── timerlib.h ├── wireless_copy.h └── wum ├── Makefile ├── README ├── wum.c ├── wumLib.c └── wumLib.h /ACAppsProtocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * appsToAcProtocol.h 3 | * 4 | * 5 | * Created by Antonio Davoli on 03/03/09. 6 | * Copyright 2009 La Sapienza. All rights reserved. 7 | * 8 | */ 9 | 10 | /* Macro Definition */ 11 | 12 | /* AC Request Message */ 13 | 14 | /**************************************** 15 | * For LIST, QUIT (without argument) * 16 | * * 17 | * 0 7 * 18 | * +-+-+-+-+-+-+-+-+ * 19 | * | Cmd_msg | * 20 | * +-+-+-+-+-+-+-+-+ * 21 | * * 22 | ****************************************/ 23 | 24 | /* CMD_MSG Types */ 25 | 26 | #define FULL_CLIENT_CONNECTED -1 27 | #define CONNECTION_OK 1 28 | #define QUIT_MSG 0 29 | #define LIST_MSG 1 30 | #define CONF_UPDATE_MSG 2 31 | 32 | /******************************************************************************************************************************** 33 | * List Response Message: * 34 | * * 35 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 36 | * | Active# | WTP_ID 1 | NameLength 1 | WTP Name 1 | ... | WTP ID N | NameLength N | WTP Name N | * 37 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 38 | * * 39 | * where N is equal to Active# (Number of Active WTPs) * 40 | ********************************************************************************************************************************/ 41 | 42 | 43 | /******************************************************************************************************** 44 | * For CONF_UPDATE_MSG type: * 45 | * * 46 | * 0 7 15 23 X * 47 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 48 | * | cmd_msg | msg_elem | WPT Index | Message Specific Payload | * 49 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 50 | * * 51 | ********************************************************************************************************/ 52 | 53 | #define PAYLOAD_START ((sizeof(unsigned char)*2) + sizeof(int)) 54 | #define ALL_ACTIVE_WTPS -1 55 | 56 | #define MSG_ELEMENT_TYPE_OFDM 1 57 | #define MSG_ELEMENT_TYPE_VENDOR_UCI 2 58 | #define MSG_ELEMENT_TYPE_VENDOR_WUM 3 59 | //Elena Agostini - 09/2014: IEEE Binding 60 | #define MSG_ELEMENT_TYPE_ADD_WLAN 4 61 | #define MSG_ELEMENT_TYPE_DEL_WLAN 5 62 | 63 | /**************************************************************************************** 64 | * Message Specific Payload for MSG_ELEMENT_TYPE_OFDM TYPE (802.11 Binding Version) * 65 | * * 66 | * 0 1 2 3 * 67 | * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 68 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 69 | * | Radio ID | Reserved | Current Chan | Band Support | * 70 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 71 | * | TI Threshold | * 72 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 73 | * * 74 | ****************************************************************************************/ 75 | 76 | /* Radio ID is filled in the creation message funcion (inside the AC) */ 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /ACBinding.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************ 2 | * Copyright (c) 2006-2009 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * * 28 | * -------------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Authors : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | * Antonio Davoli (antonio.davoli@gmail.com) * 37 | ************************************************************************************************/ 38 | 39 | 40 | #ifndef __CAPWAP_ACBinding_HEADER__ 41 | #define __CAPWAP_ACBinding_HEADER__ 42 | 43 | CWBool CWACInitBinding(int i); 44 | CWBool CWBindingAssembleConfigureResponse(CWProtocolMessage **msgElems, int *msgElemCountPtr); 45 | /**************************************************** 46 | * 2009 Update: * 47 | * The field BindingMsgElement has been added for * 48 | * the multiple type of Message Element. * 49 | ****************************************************/ 50 | CWBool CWBindingAssembleConfigurationUpdateRequest(CWProtocolMessage **msgElems, int *msgElemCountPtr, int BindingMsgElement); 51 | CWBool CWBindingSaveConfigurationUpdateResponse(CWProtocolResultCode resultCode, int WTPIndex); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /ACInterface.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-2009 Laboratorio di Sistemi di Elaborazione e Bioingegneria * 3 | * Informatica Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Authors : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | * Daniele De Sanctis (danieledesanctis@gmail.com) * 37 | * Antonio Davoli (antonio.davoli@gmail.com) * 38 | * Donato Capitella (d.capitella@gmail.com) * 39 | *******************************************************************************************/ 40 | 41 | #ifndef __CAPWAP_ACInterface_HEADER__ 42 | #define __CAPWAP_ACInterface_HEADER__ 43 | 44 | //No Interface Command 45 | #define NO_CMD 0 46 | //Manual setting for QoS values 47 | #define QOS_CMD 1 48 | #define CLEAR_CONFIG_MSG_CMD 2 49 | /* 2009 Update: Manual setting for OFDM values*/ 50 | #define OFDM_CONTROL_CMD 3 51 | /*Update 2009: 52 | Manage UCI configuration command*/ 53 | #define UCI_CONTROL_CMD 4 54 | /* Manage WTP Update Command */ 55 | #define WTP_UPDATE_CMD 5 56 | //Elena Agostini - 09/2014: IEEE WLAN configuration command 57 | #define IEEE_WLAN_CONFIGURATION_CMD 6 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /CWAVL.h: -------------------------------------------------------------------------------- 1 | typedef struct nodeAVL 2 | { 3 | //WTP: index == BSS index 4 | //AC: index == WTP index 5 | int index; 6 | int radioID; 7 | unsigned char staAddr[ETH_ALEN]; 8 | unsigned char BSSID[ETH_ALEN]; 9 | //per AC: serve anche radioID? 10 | struct nodeAVL* left; 11 | struct nodeAVL* right; 12 | int height; 13 | } nodeAVL; 14 | 15 | extern nodeAVL * avlTree; 16 | extern CWThreadMutex mutexAvlTree; 17 | 18 | void AVLdispose(nodeAVL* t); 19 | nodeAVL* AVLfind( unsigned char * staAddr, nodeAVL *t ); 20 | nodeAVL* AVLfind_min( nodeAVL *t ); 21 | nodeAVL* AVLfind_max( nodeAVL *t ); 22 | nodeAVL* AVLinsert( int index, unsigned char * staAddr, unsigned char * BSSID, int radioID, nodeAVL *t ); 23 | struct nodeAVL* AVLdeleteNode(struct nodeAVL* root, unsigned char * staAddr, int radioID); 24 | void AVLdisplay_avl(nodeAVL* t); 25 | int AVLget( nodeAVL* n ); 26 | int AVLgetBalance(struct nodeAVL *N); 27 | nodeAVL* AVLfindWTPNode(nodeAVL* t, int index); 28 | struct nodeAVL* AVLdeleteNodeWithoutRadioID(struct nodeAVL* root, struct nodeAVL* nodeToDelete); 29 | 30 | nodeAVL* AVLsingle_rotate_with_left( nodeAVL* k2 ); 31 | nodeAVL* AVLsingle_rotate_with_right( nodeAVL* k2 ); 32 | nodeAVL* AVLdouble_rotate_with_left( nodeAVL* k3 ); 33 | nodeAVL* AVLdouble_rotate_with_right( nodeAVL* k3 ); 34 | 35 | int compareEthAddr(unsigned char * staAddr, unsigned char * AVLaddr); 36 | -------------------------------------------------------------------------------- /CWConfigFile.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | *******************************************************************************************/ 37 | 38 | 39 | #ifndef __CAPWAP_CWConfigFile_HEADER__ 40 | #define __CAPWAP_CWConfigFile_HEADER__ 41 | 42 | typedef char **CWStringArray; 43 | 44 | typedef struct { 45 | enum { 46 | CW_INTEGER, 47 | CW_STRING, 48 | CW_STRING_ARRAY 49 | } type; 50 | 51 | union { 52 | int int_value; 53 | char *str_value; 54 | char **str_array_value; 55 | } value; 56 | 57 | char *code; 58 | char *endCode; 59 | 60 | int count; 61 | } CWConfigValue; 62 | 63 | extern CWConfigValue *gConfigValues; 64 | extern int gConfigValuesCount; 65 | 66 | 67 | CWBool CWParseConfigFile(); 68 | char * CWGetCommand(FILE *configFile); 69 | CWBool CWConfigFileInitLib(void); 70 | CWBool CWConfigFileDestroyLib(void); 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /CWErrorHandling.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | *******************************************************************************************/ 37 | 38 | 39 | #ifndef __CAPWAP_CWErrorHandling_HEADER__ 40 | #define __CAPWAP_CWErrorHandling_HEADER__ 41 | 42 | typedef enum { 43 | CW_ERROR_SUCCESS = 1, 44 | CW_ERROR_OUT_OF_MEMORY, 45 | CW_ERROR_WRONG_ARG, 46 | CW_ERROR_INTERRUPTED, 47 | CW_ERROR_NEED_RESOURCE, 48 | CW_ERROR_COMUNICATING, 49 | CW_ERROR_CREATING, 50 | CW_ERROR_GENERAL, 51 | CW_ERROR_OPERATION_ABORTED, 52 | CW_ERROR_SENDING, 53 | CW_ERROR_RECEIVING, 54 | CW_ERROR_INVALID_FORMAT, 55 | CW_ERROR_TIME_EXPIRED, 56 | CW_ERROR_NONE 57 | } CWErrorCode; 58 | 59 | 60 | typedef struct { 61 | CWErrorCode code; 62 | char message[256]; 63 | int line; 64 | char fileName[64]; 65 | } CWErrorHandlingInfo; 66 | 67 | #define CWErrorRaiseSystemError(error) { \ 68 | char buf[256]; \ 69 | strerror_r(errno, buf, 256); \ 70 | CWErrorRaise(error, buf); \ 71 | return CW_FALSE; \ 72 | } 73 | 74 | #define CWErrorRaise(code, msg) _CWErrorRaise(code, msg, __FILE__, __LINE__) 75 | #define CWErr(arg) ((arg) || _CWErrorHandleLast(__FILE__, __LINE__)) 76 | #define CWErrorHandleLast() _CWErrorHandleLast(__FILE__, __LINE__) 77 | 78 | CWBool _CWErrorRaise(CWErrorCode code, const char *msg, const char *fileName, int line); 79 | void CWErrorPrint(CWErrorHandlingInfo *infoPtr, const char *desc, const char *fileName, int line); 80 | CWErrorCode CWErrorGetLastErrorCode(void); 81 | CWBool _CWErrorHandleLast(const char *fileName, int line); 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /CWFreqPayloads.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************ 2 | * Copyright (c) 2006-2009 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * -------------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Authors : Antonio Davoli (antonio.davoli@gmail.com) * 32 | ************************************************************************************************/ 33 | 34 | 35 | #ifndef __CAPWAP_Freq_Payloads__ 36 | #define __CAPWAP_Freq_Payloads__ 37 | 38 | #define CW_FREQ_CELL_INFO_PAYLOAD_SIZE 65 39 | #define CW_FREQ_ACK_SIZE 8 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /CWList.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | *******************************************************************************************/ 37 | 38 | 39 | #ifndef __CAPWAP_CWList_HEADER__ 40 | #define __CAPWAP_CWList_HEADER__ 41 | 42 | #define CW_LIST_INIT NULL 43 | 44 | typedef struct _s { 45 | void *data; 46 | struct _s *next; 47 | } CWListElement; 48 | 49 | typedef enum { 50 | CW_LIST_ITERATE_RESET, 51 | CW_LIST_ITERATE 52 | } CWListIterateMode; 53 | 54 | typedef CWListElement *CWList; 55 | 56 | CWBool CWAddElementToList(CWList *list, void *element); 57 | CWBool CWAddElementToListTail(CWList *list, void *element); 58 | CWList CWListGetFirstElem(CWList *list); 59 | void *CWListGetNext(CWList list, CWListIterateMode mode); 60 | void *CWSearchInList(CWList list, void *baseElement, CWBool (*compareFunc)(void *, void *)); 61 | void *CWDeleteInList(CWList *list, void *baseElement, CWBool (*compareFunc)(void *, void *)); 62 | void CWDeleteList(CWList *list, void (*deleteFunc)(void *)); 63 | int CWCountElementInList(CWList list); 64 | //CWList * FindLastElementInList (CWList list); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /CWLog.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | *******************************************************************************************/ 37 | 38 | 39 | #ifndef __CAPWAP_CWLog_HEADER__ 40 | #define __CAPWAP_CWLog_HEADER__ 41 | 42 | extern char gLogFileName[]; 43 | 44 | __inline__ void CWVLog(const char *format, va_list args); 45 | __inline__ void CWLog(const char *format, ...); 46 | __inline__ void CWDebugLog(const char *format, ...); 47 | void CWLogInitFile(char *fileName); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /CWRandom.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | *******************************************************************************************/ 37 | 38 | 39 | 40 | #include "CWCommon.h" 41 | 42 | #ifdef DMALLOC 43 | #include "../dmalloc-5.5.0/dmalloc.h" 44 | #endif 45 | 46 | __inline__ void CWRandomInitLib() { 47 | // set seed 48 | srand( (unsigned)time( NULL ) ); 49 | } 50 | 51 | __inline__ int CWRandomIntInRange(int min, int max) { 52 | return min + (rand() % (max-min)); 53 | } 54 | -------------------------------------------------------------------------------- /CWRandom.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | *******************************************************************************************/ 37 | 38 | 39 | 40 | #ifndef __CAPWAP_CWRandom_HEADER__ 41 | #define __CAPWAP_CWRandom_HEADER__ 42 | 43 | void CWRandomInitLib(); 44 | int CWRandomIntInRange(int min, int max); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /CWSecurity.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | *******************************************************************************************/ 37 | 38 | 39 | #ifndef __CAPWAP_CWSecurity_HEADER__ 40 | #define __CAPWAP_CWSecurity_HEADER__ 41 | 42 | #include 43 | #include 44 | #include 45 | 46 | typedef SSL_CTX *CWSecurityContext; 47 | typedef SSL *CWSecuritySession; 48 | 49 | #define CWSecuritySetPeerForSession(session, addrPtr) BIO_ctrl((session)->rbio, BIO_CTRL_DGRAM_SET_PEER, 1, (addrPtr)) 50 | 51 | CWBool CWSecurityInitLib(void); 52 | CWBool CWSecurityInitSessionClient(CWSocket sock, 53 | CWNetworkLev4Address *addrPtr, 54 | CWSafeList packetReceiveList, 55 | CWSecurityContext ctx, 56 | CWSecuritySession *sessionPtr, 57 | int *PMTUPtr); 58 | 59 | CWBool CWSecuritySend(CWSecuritySession session, const char *buf, int len); 60 | CWBool CWSecurityReceive(CWSecuritySession session, 61 | char *buf, 62 | int len, 63 | int *readBytesPtr); 64 | 65 | CWBool CWSecurityInitContext(CWSecurityContext *ctxPtr, 66 | const char *caList, 67 | const char *keyfile, 68 | const char *passw, 69 | CWBool isClient, 70 | int (*hackPtr)(void *)); 71 | 72 | void CWSecurityDestroyContext(CWSecurityContext ctx); 73 | void CWSecurityDestroySession(CWSecuritySession s); 74 | 75 | BIO* BIO_new_memory(CWSocket sock, 76 | CWNetworkLev4Address* pSendAddress, 77 | CWSafeList* pRecvAddress); 78 | 79 | void CWSslCleanUp(); 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /CWStevens.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | *******************************************************************************************/ 37 | 38 | 39 | #ifndef __CAPWAP_CWStevens_HEADER__ 40 | #define __CAPWAP_CWStevens_HEADER__ 41 | 42 | #include 43 | #include 44 | 45 | #define IFI_NAME 16 /* same as IFNAMSIZ in */ 46 | #define IFI_HADDR 8 /* allow for 64-bit EUI-64 in future */ 47 | 48 | struct ifi_info { 49 | char ifi_name[IFI_NAME]; /* interface name, null-terminated */ 50 | short ifi_index; /* interface index */ 51 | short ifi_flags; /* IFF_xxx constants from */ 52 | struct sockaddr *ifi_addr; /* primary address */ 53 | struct sockaddr *ifi_brdaddr;/* broadcast address */ 54 | struct ifi_info *ifi_next; /* next of these structures */ 55 | }; 56 | 57 | struct ifi_info* get_ifi_info(int, int); 58 | void free_ifi_info(struct ifi_info *); 59 | char *sock_ntop_r(const struct sockaddr *sa, char *str); 60 | int sock_cpy_addr_port(struct sockaddr *sa1, const struct sockaddr *sa2); 61 | void sock_set_port_cw(struct sockaddr *sa, int port); 62 | int sock_cmp_port(const struct sockaddr *sa1, const struct sockaddr *sa2, socklen_t salen); 63 | int sock_cmp_addr(const struct sockaddr *sa1, const struct sockaddr *sa2, socklen_t salen); 64 | int mcast_join(int sockfd, const struct sockaddr *grp, socklen_t grplen, const char *ifname, u_int ifindex); 65 | int Writen(int fd, void *ptr, size_t nbytes); 66 | 67 | #endif /* __CAPWAP_CWStevens_HEADER__ */ 68 | -------------------------------------------------------------------------------- /CWTunnel.h: -------------------------------------------------------------------------------- 1 | #include "ieee802_11_defs.h" 2 | 3 | /* ++++++++++ RADIOTAP ++++++++++++++++++ */ 4 | struct ieee80211_radiotap_header { 5 | u_int8_t it_version; // set to 0 6 | u_int8_t it_pad; 7 | u_int16_t it_len; // entire length 8 | u_int32_t it_present; // fields present 9 | } __attribute__((__packed__)); 10 | 11 | #define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received 12 | * with WEP encryption 13 | */ 14 | #define IEEE80211_RADIOTAP_F_FRAG 0x08 //sent/received with fragmentation 15 | #define IEEE80211_RADIOTAP_F_FCS 0x10 // frame includes FCS 16 | #define IEEE80211_RADIOTAP_F_DATAPAD 0x20 // frame has padding between 802.11 header and payload (to 32-bit boundary) 17 | #define IEEE80211_RADIOTAP_F_TX_NOACK 0x0008 // don't expect an ACK 18 | /* ++++++++++++++++++++++++++++++++++++++ */ 19 | 20 | /* ++++++++++ UTILITY ++++++++++++++++++ */ 21 | #define HLEN_80211 24 22 | #define ENCAPS_HDR_LEN 8 23 | 24 | #define TYPE_LEN 2 25 | #define ETH_ALEN 6 26 | #define ETH_HLEN 14 27 | 28 | #define IEEE80211_FCTL_TODS 0x0100 29 | #define IEEE80211_FCTL_FROMDS 0x0200 30 | 31 | #define SETBIT(ADDRESS,BIT) (ADDRESS |= (1< 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAPOL_COMMON_H 10 | #define EAPOL_COMMON_H 11 | 12 | /* IEEE Std 802.1X-2004 */ 13 | 14 | #ifdef _MSC_VER 15 | #pragma pack(push, 1) 16 | #endif /* _MSC_VER */ 17 | 18 | struct ieee802_1x_hdr { 19 | u8 version; 20 | u8 type; 21 | be16 length; 22 | /* followed by length octets of data */ 23 | } STRUCT_PACKED; 24 | 25 | struct ieee8023_hdr { 26 | u8 dest[ETH_ALEN]; 27 | u8 src[ETH_ALEN]; 28 | u16 ethertype; 29 | } STRUCT_PACKED; 30 | 31 | #ifdef _MSC_VER 32 | #pragma pack(pop) 33 | #endif /* _MSC_VER */ 34 | 35 | #ifdef CONFIG_MACSEC 36 | #define EAPOL_VERSION 3 37 | #else /* CONFIG_MACSEC */ 38 | #define EAPOL_VERSION 2 39 | #endif /* CONFIG_MACSEC */ 40 | 41 | enum { IEEE802_1X_TYPE_EAP_PACKET = 0, 42 | IEEE802_1X_TYPE_EAPOL_START = 1, 43 | IEEE802_1X_TYPE_EAPOL_LOGOFF = 2, 44 | IEEE802_1X_TYPE_EAPOL_KEY = 3, 45 | IEEE802_1X_TYPE_EAPOL_ENCAPSULATED_ASF_ALERT = 4, 46 | IEEE802_1X_TYPE_EAPOL_MKA = 5, 47 | }; 48 | 49 | enum { EAPOL_KEY_TYPE_RC4 = 1, EAPOL_KEY_TYPE_RSN = 2, 50 | EAPOL_KEY_TYPE_WPA = 254 }; 51 | 52 | 53 | #define IEEE8021X_REPLAY_COUNTER_LEN 8 54 | #define IEEE8021X_KEY_SIGN_LEN 16 55 | #define IEEE8021X_KEY_IV_LEN 16 56 | 57 | #define IEEE8021X_KEY_INDEX_FLAG 0x80 58 | #define IEEE8021X_KEY_INDEX_MASK 0x03 59 | 60 | #ifdef _MSC_VER 61 | #pragma pack(push, 1) 62 | #endif /* _MSC_VER */ 63 | 64 | struct ieee802_1x_eapol_key { 65 | u8 type; 66 | /* Note: key_length is unaligned */ 67 | u8 key_length[2]; 68 | /* does not repeat within the life of the keying material used to 69 | * encrypt the Key field; 64-bit NTP timestamp MAY be used here */ 70 | u8 replay_counter[IEEE8021X_REPLAY_COUNTER_LEN]; 71 | u8 key_iv[IEEE8021X_KEY_IV_LEN]; /* cryptographically random number */ 72 | u8 key_index; /* key flag in the most significant bit: 73 | * 0 = broadcast (default key), 74 | * 1 = unicast (key mapping key); key index is in the 75 | * 7 least significant bits */ 76 | /* HMAC-MD5 message integrity check computed with MS-MPPE-Send-Key as 77 | * the key */ 78 | u8 key_signature[IEEE8021X_KEY_SIGN_LEN]; 79 | 80 | /* followed by key: if packet body length = 44 + key length, then the 81 | * key field (of key_length bytes) contains the key in encrypted form; 82 | * if packet body length = 44, key field is absent and key_length 83 | * represents the number of least significant octets from 84 | * MS-MPPE-Send-Key attribute to be used as the keying material; 85 | * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */ 86 | } STRUCT_PACKED; 87 | 88 | #ifdef _MSC_VER 89 | #pragma pack(pop) 90 | #endif /* _MSC_VER */ 91 | 92 | #endif /* EAPOL_COMMON_H */ 93 | -------------------------------------------------------------------------------- /HostapdHeaders/common/gas.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generic advertisement service (GAS) (IEEE 802.11u) 3 | * Copyright (c) 2009, Atheros Communications 4 | * Copyright (c) 2011-2012, Qualcomm Atheros 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef GAS_H 11 | #define GAS_H 12 | 13 | struct wpabuf * gas_build_initial_req(u8 dialog_token, size_t size); 14 | struct wpabuf * gas_build_comeback_req(u8 dialog_token); 15 | struct wpabuf * gas_build_initial_resp(u8 dialog_token, u16 status_code, 16 | u16 comeback_delay, size_t size); 17 | struct wpabuf * gas_anqp_build_initial_req(u8 dialog_token, size_t size); 18 | struct wpabuf * gas_anqp_build_initial_resp(u8 dialog_token, u16 status_code, 19 | u16 comeback_delay, size_t size); 20 | struct wpabuf * gas_anqp_build_initial_resp_buf(u8 dialog_token, 21 | u16 status_code, 22 | u16 comeback_delay, 23 | struct wpabuf *payload); 24 | struct wpabuf * gas_anqp_build_comeback_resp(u8 dialog_token, u16 status_code, 25 | u8 frag_id, u8 more, 26 | u16 comeback_delay, size_t size); 27 | struct wpabuf * gas_anqp_build_comeback_resp_buf(u8 dialog_token, 28 | u16 status_code, 29 | u8 frag_id, u8 more, 30 | u16 comeback_delay, 31 | struct wpabuf *payload); 32 | void gas_anqp_set_len(struct wpabuf *buf); 33 | 34 | u8 * gas_anqp_add_element(struct wpabuf *buf, u16 info_id); 35 | void gas_anqp_set_element_len(struct wpabuf *buf, u8 *len_pos); 36 | 37 | #endif /* GAS_H */ 38 | -------------------------------------------------------------------------------- /HostapdHeaders/common/ieee802_11_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IEEE 802.11 Common routines 3 | * Copyright (c) 2002-2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IEEE802_11_COMMON_H 10 | #define IEEE802_11_COMMON_H 11 | 12 | /* Parsed Information Elements */ 13 | struct ieee802_11_elems { 14 | const u8 *ssid; 15 | const u8 *supp_rates; 16 | const u8 *ds_params; 17 | const u8 *challenge; 18 | const u8 *erp_info; 19 | const u8 *ext_supp_rates; 20 | const u8 *wpa_ie; 21 | const u8 *rsn_ie; 22 | const u8 *wmm; /* WMM Information or Parameter Element */ 23 | const u8 *wmm_tspec; 24 | const u8 *wps_ie; 25 | const u8 *supp_channels; 26 | const u8 *mdie; 27 | const u8 *ftie; 28 | const u8 *timeout_int; 29 | const u8 *ht_capabilities; 30 | const u8 *ht_operation; 31 | const u8 *vht_capabilities; 32 | const u8 *vht_operation; 33 | const u8 *vht_opmode_notif; 34 | const u8 *vendor_ht_cap; 35 | const u8 *p2p; 36 | const u8 *wfd; 37 | const u8 *link_id; 38 | const u8 *interworking; 39 | const u8 *qos_map_set; 40 | const u8 *hs20; 41 | const u8 *ext_capab; 42 | const u8 *bss_max_idle_period; 43 | const u8 *ssid_list; 44 | const u8 *osen; 45 | 46 | u8 ssid_len; 47 | u8 supp_rates_len; 48 | u8 ds_params_len; 49 | u8 challenge_len; 50 | u8 erp_info_len; 51 | u8 ext_supp_rates_len; 52 | u8 wpa_ie_len; 53 | u8 rsn_ie_len; 54 | u8 wmm_len; /* 7 = WMM Information; 24 = WMM Parameter */ 55 | u8 wmm_tspec_len; 56 | u8 wps_ie_len; 57 | u8 supp_channels_len; 58 | u8 mdie_len; 59 | u8 ftie_len; 60 | u8 timeout_int_len; 61 | u8 ht_capabilities_len; 62 | u8 ht_operation_len; 63 | u8 vht_capabilities_len; 64 | u8 vht_operation_len; 65 | u8 vendor_ht_cap_len; 66 | u8 p2p_len; 67 | u8 wfd_len; 68 | u8 interworking_len; 69 | u8 qos_map_set_len; 70 | u8 hs20_len; 71 | u8 ext_capab_len; 72 | u8 ssid_list_len; 73 | u8 osen_len; 74 | }; 75 | 76 | typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes; 77 | 78 | ParseRes ieee802_11_parse_elems(const u8 *start, size_t len, 79 | struct ieee802_11_elems *elems, 80 | int show_errors); 81 | int ieee802_11_ie_count(const u8 *ies, size_t ies_len); 82 | struct wpabuf * ieee802_11_vendor_ie_concat(const u8 *ies, size_t ies_len, 83 | u32 oui_type); 84 | struct ieee80211_hdr; 85 | const u8 * get_hdr_bssid(const struct ieee80211_hdr *hdr, size_t len); 86 | 87 | struct hostapd_wmm_ac_params { 88 | int cwmin; 89 | int cwmax; 90 | int aifs; 91 | int txop_limit; /* in units of 32us */ 92 | int admission_control_mandatory; 93 | }; 94 | 95 | int hostapd_config_wmm_ac(struct hostapd_wmm_ac_params wmm_ac_params[], 96 | const char *name, const char *val); 97 | enum hostapd_hw_mode ieee80211_freq_to_chan(int freq, u8 *channel); 98 | 99 | int supp_rates_11b_only(struct ieee802_11_elems *elems); 100 | 101 | const char * fc2str(u16 fc); 102 | #endif /* IEEE802_11_COMMON_H */ 103 | -------------------------------------------------------------------------------- /HostapdHeaders/common/ieee802_1x_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IEEE Std 802.1X-2010 definitions 3 | * Copyright (c) 2013-2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IEEE802_1X_DEFS_H 10 | #define IEEE802_1X_DEFS_H 11 | 12 | #define CS_ID_LEN 8 13 | #define CS_ID_GCM_AES_128 {0x00, 0x80, 0x02, 0x00, 0x01, 0x00, 0x00, 0x01} 14 | #define CS_NAME_GCM_AES_128 "GCM-AES-128" 15 | 16 | enum macsec_policy { 17 | /** 18 | * Should secure sessions. 19 | * This accepts key server's advice to determine whether to secure the 20 | * session or not. 21 | */ 22 | SHOULD_SECURE, 23 | 24 | /** 25 | * Disabled MACsec - do not secure sessions. 26 | */ 27 | DO_NOT_SECURE, 28 | }; 29 | 30 | 31 | /* IEEE Std 802.1X-2010 - Table 11-6 - MACsec Capability */ 32 | enum macsec_cap { 33 | /** 34 | * MACsec is not implemented 35 | */ 36 | MACSEC_CAP_NOT_IMPLEMENTED, 37 | 38 | /** 39 | * 'Integrity without confidentiality' 40 | */ 41 | MACSEC_CAP_INTEGRITY, 42 | 43 | /** 44 | * 'Integrity without confidentiality' and 45 | * 'Integrity and confidentiality' with a confidentiality offset of 0 46 | */ 47 | MACSEC_CAP_INTEG_AND_CONF, 48 | 49 | /** 50 | * 'Integrity without confidentiality' and 51 | * 'Integrity and confidentiality' with a confidentiality offset of 0, 52 | * 30, 50 53 | */ 54 | MACSEC_CAP_INTEG_AND_CONF_0_30_50, 55 | }; 56 | 57 | enum validate_frames { 58 | Disabled, 59 | Checked, 60 | Strict, 61 | }; 62 | 63 | /* IEEE Std 802.1X-2010 - Table 11-6 - Confidentiality Offset */ 64 | enum confidentiality_offset { 65 | CONFIDENTIALITY_NONE = 0, 66 | CONFIDENTIALITY_OFFSET_0 = 1, 67 | CONFIDENTIALITY_OFFSET_30 = 2, 68 | CONFIDENTIALITY_OFFSET_50 = 3, 69 | }; 70 | 71 | /* IEEE Std 802.1X-2010 - Table 9-2 */ 72 | #define DEFAULT_PRIO_INFRA_PORT 0x10 73 | #define DEFAULT_PRIO_PRIMRAY_AP 0x30 74 | #define DEFAULT_PRIO_SECONDARY_AP 0x50 75 | #define DEFAULT_PRIO_GROUP_CA_MEMBER 0x70 76 | #define DEFAULT_PRIO_NOT_KEY_SERVER 0xFF 77 | 78 | #endif /* IEEE802_1X_DEFS_H */ 79 | -------------------------------------------------------------------------------- /HostapdHeaders/common/privsep_commands.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WPA Supplicant - privilege separation commands 3 | * Copyright (c) 2007-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef PRIVSEP_COMMANDS_H 10 | #define PRIVSEP_COMMANDS_H 11 | 12 | enum privsep_cmd { 13 | PRIVSEP_CMD_REGISTER, 14 | PRIVSEP_CMD_UNREGISTER, 15 | PRIVSEP_CMD_SCAN, 16 | PRIVSEP_CMD_GET_SCAN_RESULTS, 17 | PRIVSEP_CMD_ASSOCIATE, 18 | PRIVSEP_CMD_GET_BSSID, 19 | PRIVSEP_CMD_GET_SSID, 20 | PRIVSEP_CMD_SET_KEY, 21 | PRIVSEP_CMD_GET_CAPA, 22 | PRIVSEP_CMD_L2_REGISTER, 23 | PRIVSEP_CMD_L2_UNREGISTER, 24 | PRIVSEP_CMD_L2_NOTIFY_AUTH_START, 25 | PRIVSEP_CMD_L2_SEND, 26 | PRIVSEP_CMD_SET_COUNTRY, 27 | }; 28 | 29 | struct privsep_cmd_associate 30 | { 31 | u8 bssid[ETH_ALEN]; 32 | u8 ssid[32]; 33 | size_t ssid_len; 34 | int freq; 35 | int pairwise_suite; 36 | int group_suite; 37 | int key_mgmt_suite; 38 | int auth_alg; 39 | int mode; 40 | size_t wpa_ie_len; 41 | /* followed by wpa_ie_len bytes of wpa_ie */ 42 | }; 43 | 44 | struct privsep_cmd_set_key 45 | { 46 | int alg; 47 | u8 addr[ETH_ALEN]; 48 | int key_idx; 49 | int set_tx; 50 | u8 seq[8]; 51 | size_t seq_len; 52 | u8 key[32]; 53 | size_t key_len; 54 | }; 55 | 56 | enum privsep_event { 57 | PRIVSEP_EVENT_SCAN_RESULTS, 58 | PRIVSEP_EVENT_ASSOC, 59 | PRIVSEP_EVENT_DISASSOC, 60 | PRIVSEP_EVENT_ASSOCINFO, 61 | PRIVSEP_EVENT_MICHAEL_MIC_FAILURE, 62 | PRIVSEP_EVENT_INTERFACE_STATUS, 63 | PRIVSEP_EVENT_PMKID_CANDIDATE, 64 | PRIVSEP_EVENT_STKSTART, 65 | PRIVSEP_EVENT_FT_RESPONSE, 66 | PRIVSEP_EVENT_RX_EAPOL, 67 | }; 68 | 69 | #endif /* PRIVSEP_COMMANDS_H */ 70 | -------------------------------------------------------------------------------- /HostapdHeaders/common/qca-vendor-attr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Qualcomm Atheros vendor specific attribute definitions 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef QCA_VENDOR_ATTR_H 10 | #define QCA_VENDOR_ATTR_H 11 | 12 | /* 13 | * This file defines some of the attributes used with Qualcomm Atheros OUI 14 | * 00:13:74 in a way that is not suitable for qca-vendor.h, e.g., due to 15 | * compiler dependencies. 16 | */ 17 | 18 | struct qca_avoid_freq_range { 19 | u32 start_freq; 20 | u32 end_freq; 21 | } __attribute__ ((packed)); 22 | 23 | struct qca_avoid_freq_list { 24 | u32 count; 25 | struct qca_avoid_freq_range range[0]; 26 | } __attribute__ ((packed)); 27 | 28 | #endif /* QCA_VENDOR_ATTR_H */ 29 | -------------------------------------------------------------------------------- /HostapdHeaders/common/qca-vendor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Qualcomm Atheros OUI and vendor specific assignments 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef QCA_VENDOR_H 10 | #define QCA_VENDOR_H 11 | 12 | /* 13 | * This file is a registry of identifier assignments from the Qualcomm Atheros 14 | * OUI 00:13:74 for purposes other than MAC address assignment. New identifiers 15 | * can be assigned through normal review process for changes to the upstream 16 | * hostap.git repository. 17 | */ 18 | 19 | #define OUI_QCA 0x001374 20 | 21 | /** 22 | * enum qca_radiotap_vendor_ids - QCA radiotap vendor namespace IDs 23 | */ 24 | enum qca_radiotap_vendor_ids { 25 | QCA_RADIOTAP_VID_WLANTEST = 0, 26 | }; 27 | 28 | /** 29 | * enum qca_nl80211_vendor_subcmds - QCA nl80211 vendor command identifiers 30 | * 31 | * @QCA_NL80211_VENDOR_SUBCMD_UNSPEC: Reserved value 0 32 | * 33 | * @QCA_NL80211_VENDOR_SUBCMD_TEST: Test command/event 34 | * 35 | * @QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY: Recommendation of frequency 36 | * ranges to avoid to reduce issues due to interference or internal 37 | * co-existence information in the driver. The event data structure is 38 | * defined in struct qca_avoid_freq_list. 39 | * 40 | * @QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY: Command to check driver support 41 | * for DFS offloading. 42 | * 43 | * @QCA_NL80211_VENDOR_SUBCMD_NAN: NAN command/event which is used to pass 44 | * NAN Request/Response and NAN Indication messages. These messages are 45 | * interpreted between the framework and the firmware component. 46 | */ 47 | enum qca_nl80211_vendor_subcmds { 48 | QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0, 49 | QCA_NL80211_VENDOR_SUBCMD_TEST = 1, 50 | /* subcmds 2..9 not yet allocated */ 51 | QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY = 10, 52 | QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY = 11, 53 | QCA_NL80211_VENDOR_SUBCMD_NAN = 12, 54 | QCA_NL80211_VENDOR_SUBMCD_STATS_EXT = 13, 55 | /* 14..33 - reserved for QCA */ 56 | }; 57 | 58 | 59 | enum qca_wlan_vendor_attr { 60 | QCA_WLAN_VENDOR_ATTR_INVALID = 0, 61 | /* used by QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY */ 62 | QCA_WLAN_VENDOR_ATTR_DFS = 1, 63 | /* used by QCA_NL80211_VENDOR_SUBCMD_NAN */ 64 | QCA_WLAN_VENDOR_ATTR_NAN = 2, 65 | /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */ 66 | QCA_WLAN_VENDOR_ATTR_STATS_EXT = 3, 67 | /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */ 68 | QCA_WLAN_VENDOR_ATTR_IFINDEX = 4, 69 | /* keep last */ 70 | QCA_WLAN_VENDOR_ATTR_AFTER_LAST, 71 | QCA_WLAN_VENDOR_ATTR_MAX = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1, 72 | }; 73 | 74 | #endif /* QCA_VENDOR_H */ 75 | -------------------------------------------------------------------------------- /HostapdHeaders/common/sae.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Simultaneous authentication of equals 3 | * Copyright (c) 2012-2013, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef SAE_H 10 | #define SAE_H 11 | 12 | #define SAE_KCK_LEN 32 13 | #define SAE_PMK_LEN 32 14 | #define SAE_PMKID_LEN 16 15 | #define SAE_KEYSEED_KEY_LEN 32 16 | #define SAE_MAX_PRIME_LEN 512 17 | #define SAE_MAX_ECC_PRIME_LEN 66 18 | #define SAE_COMMIT_MAX_LEN (2 + 3 * SAE_MAX_PRIME_LEN) 19 | #define SAE_CONFIRM_MAX_LEN (2 + SAE_MAX_PRIME_LEN) 20 | 21 | struct sae_temporary_data { 22 | u8 kck[SAE_KCK_LEN]; 23 | struct crypto_bignum *own_commit_scalar; 24 | struct crypto_bignum *own_commit_element_ffc; 25 | struct crypto_ec_point *own_commit_element_ecc; 26 | struct crypto_bignum *peer_commit_element_ffc; 27 | struct crypto_ec_point *peer_commit_element_ecc; 28 | struct crypto_ec_point *pwe_ecc; 29 | struct crypto_bignum *pwe_ffc; 30 | struct crypto_bignum *sae_rand; 31 | struct crypto_ec *ec; 32 | int prime_len; 33 | const struct dh_group *dh; 34 | const struct crypto_bignum *prime; 35 | const struct crypto_bignum *order; 36 | struct crypto_bignum *prime_buf; 37 | struct crypto_bignum *order_buf; 38 | }; 39 | 40 | struct sae_data { 41 | enum { SAE_NOTHING, SAE_COMMITTED, SAE_CONFIRMED, SAE_ACCEPTED } state; 42 | u16 send_confirm; 43 | u8 pmk[SAE_PMK_LEN]; 44 | struct crypto_bignum *peer_commit_scalar; 45 | int group; 46 | struct sae_temporary_data *tmp; 47 | }; 48 | 49 | int sae_set_group(struct sae_data *sae, int group); 50 | void sae_clear_temp_data(struct sae_data *sae); 51 | void sae_clear_data(struct sae_data *sae); 52 | 53 | int sae_prepare_commit(const u8 *addr1, const u8 *addr2, 54 | const u8 *password, size_t password_len, 55 | struct sae_data *sae); 56 | int sae_process_commit(struct sae_data *sae); 57 | void sae_write_commit(struct sae_data *sae, struct wpabuf *buf, 58 | const struct wpabuf *token); 59 | u16 sae_parse_commit(struct sae_data *sae, const u8 *data, size_t len, 60 | const u8 **token, size_t *token_len, int *allowed_groups); 61 | void sae_write_confirm(struct sae_data *sae, struct wpabuf *buf); 62 | int sae_check_confirm(struct sae_data *sae, const u8 *data, size_t len); 63 | 64 | #endif /* SAE_H */ 65 | -------------------------------------------------------------------------------- /HostapdHeaders/common/tnc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TNC - Common defines 3 | * Copyright (c) 2007-2014, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef TNC_H 10 | #define TNC_H 11 | 12 | typedef unsigned long TNC_UInt32; 13 | typedef unsigned char *TNC_BufferReference; 14 | 15 | typedef TNC_UInt32 TNC_IMVID; 16 | typedef TNC_UInt32 TNC_IMCID; 17 | typedef TNC_UInt32 TNC_ConnectionID; 18 | typedef TNC_UInt32 TNC_ConnectionState; 19 | typedef TNC_UInt32 TNC_RetryReason; 20 | typedef TNC_UInt32 TNC_IMV_Action_Recommendation; 21 | typedef TNC_UInt32 TNC_IMV_Evaluation_Result; 22 | typedef TNC_UInt32 TNC_MessageType; 23 | typedef TNC_MessageType *TNC_MessageTypeList; 24 | typedef TNC_UInt32 TNC_VendorID; 25 | typedef TNC_UInt32 TNC_Subtype; 26 | typedef TNC_UInt32 TNC_MessageSubtype; 27 | typedef TNC_UInt32 TNC_Version; 28 | typedef TNC_UInt32 TNC_Result; 29 | typedef TNC_UInt32 TNC_AttributeID; 30 | 31 | typedef TNC_Result (*TNC_TNCS_BindFunctionPointer)( 32 | TNC_IMVID imvID, 33 | char *functionName, 34 | void **pOutfunctionPointer); 35 | typedef TNC_Result (*TNC_TNCS_ReportMessageTypesPointer)( 36 | TNC_IMVID imvID, 37 | TNC_MessageTypeList supportedTypes, 38 | TNC_UInt32 typeCount); 39 | typedef TNC_Result (*TNC_TNCS_SendMessagePointer)( 40 | TNC_IMVID imvID, 41 | TNC_ConnectionID connectionID, 42 | TNC_BufferReference message, 43 | TNC_UInt32 messageLength, 44 | TNC_MessageType messageType); 45 | typedef TNC_Result (*TNC_TNCS_RequestHandshakeRetryPointer)( 46 | TNC_IMVID imvID, 47 | TNC_ConnectionID connectionID, 48 | TNC_RetryReason reason); 49 | typedef TNC_Result (*TNC_TNCS_ProvideRecommendationPointer)( 50 | TNC_IMVID imvID, 51 | TNC_ConnectionID connectionID, 52 | TNC_IMV_Action_Recommendation recommendation, 53 | TNC_IMV_Evaluation_Result evaluation); 54 | typedef TNC_Result (*TNC_TNCC_BindFunctionPointer)( 55 | TNC_IMCID imcID, 56 | char *functionName, 57 | void **pOutfunctionPointer); 58 | typedef TNC_Result (*TNC_TNCC_SendMessagePointer)( 59 | TNC_IMCID imcID, 60 | TNC_ConnectionID connectionID, 61 | TNC_BufferReference message, 62 | TNC_UInt32 messageLength, 63 | TNC_MessageType messageType); 64 | typedef TNC_Result (*TNC_TNCC_ReportMessageTypesPointer)( 65 | TNC_IMCID imcID, 66 | TNC_MessageTypeList supportedTypes, 67 | TNC_UInt32 typeCount); 68 | typedef TNC_Result (*TNC_TNCC_RequestHandshakeRetryPointer)( 69 | TNC_IMCID imcID, 70 | TNC_ConnectionID connectionID, 71 | TNC_RetryReason reason); 72 | 73 | #define TNC_IFIMV_VERSION_1 1 74 | #define TNC_IFIMC_VERSION_1 1 75 | 76 | #define TNC_RESULT_SUCCESS 0 77 | #define TNC_RESULT_NOT_INITIALIZED 1 78 | #define TNC_RESULT_ALREADY_INITIALIZED 2 79 | #define TNC_RESULT_NO_COMMON_VERSION 3 80 | #define TNC_RESULT_CANT_RETRY 4 81 | #define TNC_RESULT_WONT_RETRY 5 82 | #define TNC_RESULT_INVALID_PARAMETER 6 83 | #define TNC_RESULT_CANT_RESPOND 7 84 | #define TNC_RESULT_ILLEGAL_OPERATION 8 85 | #define TNC_RESULT_OTHER 9 86 | #define TNC_RESULT_FATAL 10 87 | 88 | #define TNC_CONNECTION_STATE_CREATE 0 89 | #define TNC_CONNECTION_STATE_HANDSHAKE 1 90 | #define TNC_CONNECTION_STATE_ACCESS_ALLOWED 2 91 | #define TNC_CONNECTION_STATE_ACCESS_ISOLATED 3 92 | #define TNC_CONNECTION_STATE_ACCESS_NONE 4 93 | #define TNC_CONNECTION_STATE_DELETE 5 94 | 95 | #define TNC_VENDORID_ANY ((TNC_VendorID) 0xffffff) 96 | #define TNC_SUBTYPE_ANY ((TNC_Subtype) 0xff) 97 | 98 | /* TNCC-TNCS Message Types */ 99 | #define TNC_TNCCS_RECOMMENDATION 0x00000001 100 | #define TNC_TNCCS_ERROR 0x00000002 101 | #define TNC_TNCCS_PREFERREDLANGUAGE 0x00000003 102 | #define TNC_TNCCS_REASONSTRINGS 0x00000004 103 | 104 | /* Possible TNC_IMV_Action_Recommendation values: */ 105 | enum IMV_Action_Recommendation { 106 | TNC_IMV_ACTION_RECOMMENDATION_ALLOW, 107 | TNC_IMV_ACTION_RECOMMENDATION_NO_ACCESS, 108 | TNC_IMV_ACTION_RECOMMENDATION_ISOLATE, 109 | TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION 110 | }; 111 | 112 | /* Possible TNC_IMV_Evaluation_Result values: */ 113 | enum IMV_Evaluation_Result { 114 | TNC_IMV_EVALUATION_RESULT_COMPLIANT, 115 | TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MINOR, 116 | TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR, 117 | TNC_IMV_EVALUATION_RESULT_ERROR, 118 | TNC_IMV_EVALUATION_RESULT_DONT_KNOW 119 | }; 120 | 121 | #endif /* TNC_H */ 122 | -------------------------------------------------------------------------------- /HostapdHeaders/common/version.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | #define VERSION_H 3 | 4 | #ifndef VERSION_STR_POSTFIX 5 | #define VERSION_STR_POSTFIX "" 6 | #endif /* VERSION_STR_POSTFIX */ 7 | 8 | #define VERSION_STR "2.3-devel" VERSION_STR_POSTFIX 9 | 10 | #endif /* VERSION_H */ 11 | -------------------------------------------------------------------------------- /HostapdHeaders/common/wpa_helpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wpa_supplicant ctrl_iface helpers 3 | * Copyright (c) 2010-2011, Atheros Communications, Inc. 4 | * Copyright (c) 2011-2012, Qualcomm Atheros, Inc. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef WPA_HELPERS_H 11 | #define WPA_HELPERS_H 12 | 13 | int wpa_command(const char *ifname, const char *cmd); 14 | int wpa_command_resp(const char *ifname, const char *cmd, 15 | char *resp, size_t resp_size); 16 | int get_wpa_status(const char *ifname, const char *field, char *obuf, 17 | size_t obuf_size); 18 | 19 | struct wpa_ctrl * open_wpa_mon(const char *ifname); 20 | int wait_ip_addr(const char *ifname, int timeout); 21 | int get_wpa_cli_event(struct wpa_ctrl *mon, 22 | const char *event, char *buf, size_t buf_size); 23 | int get_wpa_cli_event2(struct wpa_ctrl *mon, 24 | const char *event, const char *event2, 25 | char *buf, size_t buf_size); 26 | 27 | int add_network(const char *ifname); 28 | int set_network(const char *ifname, int id, const char *field, 29 | const char *value); 30 | int set_network_quoted(const char *ifname, int id, const char *field, 31 | const char *value); 32 | int add_cred(const char *ifname); 33 | int set_cred(const char *ifname, int id, const char *field, const char *value); 34 | int set_cred_quoted(const char *ifname, int id, const char *field, 35 | const char *value); 36 | 37 | #endif /* WPA_HELPERS_H */ 38 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/.gitignore: -------------------------------------------------------------------------------- 1 | libutils.a 2 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Base64 encoding/decoding (RFC1341) 3 | * Copyright (c) 2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef BASE64_H 10 | #define BASE64_H 11 | 12 | unsigned char * base64_encode(const unsigned char *src, size_t len, 13 | size_t *out_len); 14 | unsigned char * base64_decode(const unsigned char *src, size_t len, 15 | size_t *out_len); 16 | 17 | #endif /* BASE64_H */ 18 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/bitfield.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Bitfield 3 | * Copyright (c) 2013, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef BITFIELD_H 10 | #define BITFIELD_H 11 | 12 | struct bitfield; 13 | 14 | struct bitfield * bitfield_alloc(size_t max_bits); 15 | void bitfield_free(struct bitfield *bf); 16 | void bitfield_set(struct bitfield *bf, size_t bit); 17 | void bitfield_clear(struct bitfield *bf, size_t bit); 18 | int bitfield_is_set(struct bitfield *bf, size_t bit); 19 | int bitfield_get_first_zero(struct bitfield *bf); 20 | 21 | #endif /* BITFIELD_H */ 22 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/browser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hotspot 2.0 client - Web browser 3 | * Copyright (c) 2013, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef BROWSER_H 10 | #define BROWSER_H 11 | 12 | #ifdef CONFIG_NO_BROWSER 13 | static inline int hs20_web_browser(const char *url) 14 | { 15 | return -1; 16 | } 17 | #else /* CONFIG_NO_BROWSER */ 18 | int hs20_web_browser(const char *url); 19 | #endif /* CONFIG_NO_BROWSER */ 20 | 21 | #endif /* BROWSER_H */ 22 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/build_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wpa_supplicant/hostapd - Build time configuration defines 3 | * Copyright (c) 2005-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | * 8 | * This header file can be used to define configuration defines that were 9 | * originally defined in Makefile. This is mainly meant for IDE use or for 10 | * systems that do not have suitable 'make' tool. In these cases, it may be 11 | * easier to have a single place for defining all the needed C pre-processor 12 | * defines. 13 | */ 14 | 15 | #ifndef BUILD_CONFIG_H 16 | #define BUILD_CONFIG_H 17 | 18 | /* Insert configuration defines, e.g., #define EAP_MD5, here, if needed. */ 19 | 20 | #ifdef CONFIG_WIN32_DEFAULTS 21 | #define CONFIG_NATIVE_WINDOWS 22 | #define CONFIG_ANSI_C_EXTRA 23 | #define CONFIG_WINPCAP 24 | #define IEEE8021X_EAPOL 25 | #define PKCS12_FUNCS 26 | #define PCSC_FUNCS 27 | #define CONFIG_CTRL_IFACE 28 | #define CONFIG_CTRL_IFACE_NAMED_PIPE 29 | #define CONFIG_DRIVER_NDIS 30 | #define CONFIG_NDIS_EVENTS_INTEGRATED 31 | #define CONFIG_DEBUG_FILE 32 | #define EAP_MD5 33 | #define EAP_TLS 34 | #define EAP_MSCHAPv2 35 | #define EAP_PEAP 36 | #define EAP_TTLS 37 | #define EAP_GTC 38 | #define EAP_OTP 39 | #define EAP_LEAP 40 | #define EAP_TNC 41 | #define _CRT_SECURE_NO_DEPRECATE 42 | 43 | #ifdef USE_INTERNAL_CRYPTO 44 | #define CONFIG_TLS_INTERNAL_CLIENT 45 | #define CONFIG_INTERNAL_LIBTOMMATH 46 | #define CONFIG_CRYPTO_INTERNAL 47 | #endif /* USE_INTERNAL_CRYPTO */ 48 | #endif /* CONFIG_WIN32_DEFAULTS */ 49 | 50 | #endif /* BUILD_CONFIG_H */ 51 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/edit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Command line editing and history 3 | * Copyright (c) 2010, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EDIT_H 10 | #define EDIT_H 11 | 12 | int edit_init(void (*cmd_cb)(void *ctx, char *cmd), 13 | void (*eof_cb)(void *ctx), 14 | char ** (*completion_cb)(void *ctx, const char *cmd, int pos), 15 | void *ctx, const char *history_file, const char *ps); 16 | void edit_deinit(const char *history_file, 17 | int (*filter_cb)(void *ctx, const char *cmd)); 18 | void edit_clear_line(void); 19 | void edit_redraw(void); 20 | 21 | #endif /* EDIT_H */ 22 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/ext_password.h: -------------------------------------------------------------------------------- 1 | /* 2 | * External password backend 3 | * Copyright (c) 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EXT_PASSWORD_H 10 | #define EXT_PASSWORD_H 11 | 12 | struct ext_password_data; 13 | 14 | #ifdef CONFIG_EXT_PASSWORD 15 | 16 | struct ext_password_data * ext_password_init(const char *backend, 17 | const char *params); 18 | void ext_password_deinit(struct ext_password_data *data); 19 | 20 | struct wpabuf * ext_password_get(struct ext_password_data *data, 21 | const char *name); 22 | void ext_password_free(struct wpabuf *pw); 23 | 24 | #else /* CONFIG_EXT_PASSWORD */ 25 | 26 | #define ext_password_init(b, p) ((void *) 1) 27 | #define ext_password_deinit(d) do { } while (0) 28 | #define ext_password_get(d, n) (NULL) 29 | #define ext_password_free(p) do { } while (0) 30 | 31 | #endif /* CONFIG_EXT_PASSWORD */ 32 | 33 | #endif /* EXT_PASSWORD_H */ 34 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/ext_password_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * External password backend - internal definitions 3 | * Copyright (c) 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EXT_PASSWORD_I_H 10 | #define EXT_PASSWORD_I_H 11 | 12 | #include "ext_password.h" 13 | 14 | struct ext_password_backend { 15 | const char *name; 16 | void * (*init)(const char *params); 17 | void (*deinit)(void *ctx); 18 | struct wpabuf * (*get)(void *ctx, const char *name); 19 | }; 20 | 21 | struct wpabuf * ext_password_alloc(size_t len); 22 | 23 | #endif /* EXT_PASSWORD_I_H */ 24 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/http-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HTTP wrapper 3 | * Copyright (c) 2012-2013, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef HTTP_UTILS_H 10 | #define HTTP_UTILS_H 11 | 12 | struct http_ctx; 13 | 14 | struct http_othername { 15 | char *oid; 16 | u8 *data; 17 | size_t len; 18 | }; 19 | 20 | #define HTTP_MAX_CERT_LOGO_HASH 32 21 | 22 | struct http_logo { 23 | char *alg_oid; 24 | u8 *hash; 25 | size_t hash_len; 26 | char *uri; 27 | }; 28 | 29 | struct http_cert { 30 | char **dnsname; 31 | unsigned int num_dnsname; 32 | struct http_othername *othername; 33 | unsigned int num_othername; 34 | struct http_logo *logo; 35 | unsigned int num_logo; 36 | }; 37 | 38 | int soap_init_client(struct http_ctx *ctx, const char *address, 39 | const char *ca_fname, const char *username, 40 | const char *password, const char *client_cert, 41 | const char *client_key); 42 | int soap_reinit_client(struct http_ctx *ctx); 43 | xml_node_t * soap_send_receive(struct http_ctx *ctx, xml_node_t *node); 44 | 45 | struct http_ctx * http_init_ctx(void *upper_ctx, struct xml_node_ctx *xml_ctx); 46 | void http_ocsp_set(struct http_ctx *ctx, int val); 47 | void http_deinit_ctx(struct http_ctx *ctx); 48 | 49 | int http_download_file(struct http_ctx *ctx, const char *url, 50 | const char *fname, const char *ca_fname); 51 | char * http_post(struct http_ctx *ctx, const char *url, const char *data, 52 | const char *content_type, const char *ext_hdr, 53 | const char *ca_fname, 54 | const char *username, const char *password, 55 | const char *client_cert, const char *client_key, 56 | size_t *resp_len); 57 | void http_set_cert_cb(struct http_ctx *ctx, 58 | int (*cb)(void *ctx, struct http_cert *cert), 59 | void *cb_ctx); 60 | const char * http_get_err(struct http_ctx *ctx); 61 | void http_parse_x509_certificate(struct http_ctx *ctx, const char *fname); 62 | 63 | #endif /* HTTP_UTILS_H */ 64 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/includes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wpa_supplicant/hostapd - Default include files 3 | * Copyright (c) 2005-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | * 8 | * This header file is included into all C files so that commonly used header 9 | * files can be selected with OS specific ifdef blocks in one place instead of 10 | * having to have OS/C library specific selection in many files. 11 | */ 12 | 13 | #ifndef INCLUDES_H 14 | #define INCLUDES_H 15 | 16 | /* Include possible build time configuration before including anything else */ 17 | #include "build_config.h" 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #ifndef _WIN32_WCE 24 | #ifndef CONFIG_TI_COMPILER 25 | #include 26 | #include 27 | #endif /* CONFIG_TI_COMPILER */ 28 | #include 29 | #endif /* _WIN32_WCE */ 30 | #include 31 | 32 | #ifndef CONFIG_TI_COMPILER 33 | #ifndef _MSC_VER 34 | #include 35 | #endif /* _MSC_VER */ 36 | #endif /* CONFIG_TI_COMPILER */ 37 | 38 | #ifndef CONFIG_NATIVE_WINDOWS 39 | #ifndef CONFIG_TI_COMPILER 40 | #include 41 | #include 42 | #include 43 | #ifndef __vxworks 44 | #include 45 | #include 46 | #endif /* __vxworks */ 47 | #endif /* CONFIG_TI_COMPILER */ 48 | #endif /* CONFIG_NATIVE_WINDOWS */ 49 | 50 | #endif /* INCLUDES_H */ 51 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/ip_addr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IP address processing 3 | * Copyright (c) 2003-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IP_ADDR_H 10 | #define IP_ADDR_H 11 | 12 | struct hostapd_ip_addr { 13 | int af; /* AF_INET / AF_INET6 */ 14 | union { 15 | struct in_addr v4; 16 | #ifdef CONFIG_IPV6 17 | struct in6_addr v6; 18 | #endif /* CONFIG_IPV6 */ 19 | u8 max_len[16]; 20 | } u; 21 | }; 22 | 23 | const char * hostapd_ip_txt(const struct hostapd_ip_addr *addr, char *buf, 24 | size_t buflen); 25 | int hostapd_parse_ip_addr(const char *txt, struct hostapd_ip_addr *addr); 26 | 27 | #endif /* IP_ADDR_H */ 28 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Doubly-linked list 3 | * Copyright (c) 2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef LIST_H 10 | #define LIST_H 11 | 12 | /** 13 | * struct dl_list - Doubly-linked list 14 | */ 15 | struct dl_list { 16 | struct dl_list *next; 17 | struct dl_list *prev; 18 | }; 19 | 20 | static inline void dl_list_init(struct dl_list *list) 21 | { 22 | list->next = list; 23 | list->prev = list; 24 | } 25 | 26 | static inline void dl_list_add(struct dl_list *list, struct dl_list *item) 27 | { 28 | item->next = list->next; 29 | item->prev = list; 30 | list->next->prev = item; 31 | list->next = item; 32 | } 33 | 34 | static inline void dl_list_add_tail(struct dl_list *list, struct dl_list *item) 35 | { 36 | dl_list_add(list->prev, item); 37 | } 38 | 39 | static inline void dl_list_del(struct dl_list *item) 40 | { 41 | item->next->prev = item->prev; 42 | item->prev->next = item->next; 43 | item->next = NULL; 44 | item->prev = NULL; 45 | } 46 | 47 | static inline int dl_list_empty(struct dl_list *list) 48 | { 49 | return list->next == list; 50 | } 51 | 52 | static inline unsigned int dl_list_len(struct dl_list *list) 53 | { 54 | struct dl_list *item; 55 | int count = 0; 56 | for (item = list->next; item != list; item = item->next) 57 | count++; 58 | return count; 59 | } 60 | 61 | #ifndef offsetof 62 | #define offsetof(type, member) ((long) &((type *) 0)->member) 63 | #endif 64 | 65 | #define dl_list_entry(item, type, member) \ 66 | ((type *) ((char *) item - offsetof(type, member))) 67 | 68 | #define dl_list_first(list, type, member) \ 69 | (dl_list_empty((list)) ? NULL : \ 70 | dl_list_entry((list)->next, type, member)) 71 | 72 | #define dl_list_last(list, type, member) \ 73 | (dl_list_empty((list)) ? NULL : \ 74 | dl_list_entry((list)->prev, type, member)) 75 | 76 | #define dl_list_for_each(item, list, type, member) \ 77 | for (item = dl_list_entry((list)->next, type, member); \ 78 | &item->member != (list); \ 79 | item = dl_list_entry(item->member.next, type, member)) 80 | 81 | #define dl_list_for_each_safe(item, n, list, type, member) \ 82 | for (item = dl_list_entry((list)->next, type, member), \ 83 | n = dl_list_entry(item->member.next, type, member); \ 84 | &item->member != (list); \ 85 | item = n, n = dl_list_entry(n->member.next, type, member)) 86 | 87 | #define dl_list_for_each_reverse(item, list, type, member) \ 88 | for (item = dl_list_entry((list)->prev, type, member); \ 89 | &item->member != (list); \ 90 | item = dl_list_entry(item->member.prev, type, member)) 91 | 92 | #define DEFINE_DL_LIST(name) \ 93 | struct dl_list name = { &(name), &(name) } 94 | 95 | #endif /* LIST_H */ 96 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/pcsc_funcs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WPA Supplicant / PC/SC smartcard interface for USIM, GSM SIM 3 | * Copyright (c) 2004-2006, 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef PCSC_FUNCS_H 10 | #define PCSC_FUNCS_H 11 | 12 | #ifdef PCSC_FUNCS 13 | struct scard_data * scard_init(const char *reader); 14 | void scard_deinit(struct scard_data *scard); 15 | 16 | int scard_set_pin(struct scard_data *scard, const char *pin); 17 | int scard_get_imsi(struct scard_data *scard, char *imsi, size_t *len); 18 | int scard_get_mnc_len(struct scard_data *scard); 19 | int scard_gsm_auth(struct scard_data *scard, const unsigned char *_rand, 20 | unsigned char *sres, unsigned char *kc); 21 | int scard_umts_auth(struct scard_data *scard, const unsigned char *_rand, 22 | const unsigned char *autn, 23 | unsigned char *res, size_t *res_len, 24 | unsigned char *ik, unsigned char *ck, unsigned char *auts); 25 | int scard_get_pin_retry_counter(struct scard_data *scard); 26 | int scard_supports_umts(struct scard_data *scard); 27 | 28 | #else /* PCSC_FUNCS */ 29 | 30 | #define scard_init(r) NULL 31 | #define scard_deinit(s) do { } while (0) 32 | #define scard_set_pin(s, p) -1 33 | #define scard_get_imsi(s, i, l) -1 34 | #define scard_get_mnc_len(s) -1 35 | #define scard_gsm_auth(s, r, s2, k) -1 36 | #define scard_umts_auth(s, r, a, r2, rl, i, c, a2) -1 37 | #define scard_get_pin_retry_counter(s) -1 38 | #define scard_supports_umts(s) 0 39 | 40 | #endif /* PCSC_FUNCS */ 41 | 42 | #endif /* PCSC_FUNCS_H */ 43 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/platform.h: -------------------------------------------------------------------------------- 1 | #ifndef PLATFORM_H 2 | #define PLATFORM_H 3 | 4 | #include "includes.h" 5 | #include "common.h" 6 | 7 | //#define le16_to_cpu le_to_host16 8 | //#define le32_to_cpu le_to_host32 9 | 10 | #define get_unaligned(p) \ 11 | ({ \ 12 | struct packed_dummy_struct { \ 13 | typeof(*(p)) __val; \ 14 | } __attribute__((packed)) *__ptr = (void *) (p); \ 15 | \ 16 | __ptr->__val; \ 17 | }) 18 | #define get_unaligned_le16(p) le16_to_cpu(get_unaligned((uint16_t *)(p))) 19 | #define get_unaligned_le32(p) le32_to_cpu(get_unaligned((uint32_t *)(p))) 20 | 21 | #endif /* PLATFORM_H */ 22 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/radiotap_iter.h: -------------------------------------------------------------------------------- 1 | #ifndef __RADIOTAP_ITER_H 2 | #define __RADIOTAP_ITER_H 3 | 4 | #include 5 | #include "radiotap.h" 6 | 7 | /* Radiotap header iteration 8 | * implemented in radiotap.c 9 | */ 10 | 11 | struct radiotap_override { 12 | uint8_t field; 13 | uint8_t align:4, size:4; 14 | }; 15 | 16 | struct radiotap_align_size { 17 | uint8_t align:4, size:4; 18 | }; 19 | 20 | struct ieee80211_radiotap_namespace { 21 | const struct radiotap_align_size *align_size; 22 | int n_bits; 23 | uint32_t oui; 24 | uint8_t subns; 25 | }; 26 | 27 | struct ieee80211_radiotap_vendor_namespaces { 28 | const struct ieee80211_radiotap_namespace *ns; 29 | int n_ns; 30 | }; 31 | 32 | /** 33 | * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args 34 | * @this_arg_index: index of current arg, valid after each successful call 35 | * to ieee80211_radiotap_iterator_next() 36 | * @this_arg: pointer to current radiotap arg; it is valid after each 37 | * call to ieee80211_radiotap_iterator_next() but also after 38 | * ieee80211_radiotap_iterator_init() where it will point to 39 | * the beginning of the actual data portion 40 | * @this_arg_size: length of the current arg, for convenience 41 | * @current_namespace: pointer to the current namespace definition 42 | * (or internally %NULL if the current namespace is unknown) 43 | * @is_radiotap_ns: indicates whether the current namespace is the default 44 | * radiotap namespace or not 45 | * 46 | * @overrides: override standard radiotap fields 47 | * @n_overrides: number of overrides 48 | * 49 | * @_rtheader: pointer to the radiotap header we are walking through 50 | * @_max_length: length of radiotap header in cpu byte ordering 51 | * @_arg_index: next argument index 52 | * @_arg: next argument pointer 53 | * @_next_bitmap: internal pointer to next present u32 54 | * @_bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present 55 | * @_vns: vendor namespace definitions 56 | * @_next_ns_data: beginning of the next namespace's data 57 | * @_reset_on_ext: internal; reset the arg index to 0 when going to the 58 | * next bitmap word 59 | * 60 | * Describes the radiotap parser state. Fields prefixed with an underscore 61 | * must not be used by users of the parser, only by the parser internally. 62 | */ 63 | 64 | struct ieee80211_radiotap_iterator { 65 | struct ieee80211_radiotap_header *_rtheader; 66 | const struct ieee80211_radiotap_vendor_namespaces *_vns; 67 | const struct ieee80211_radiotap_namespace *current_namespace; 68 | 69 | unsigned char *_arg, *_next_ns_data; 70 | uint32_t *_next_bitmap; 71 | 72 | unsigned char *this_arg; 73 | #ifdef RADIOTAP_SUPPORT_OVERRIDES 74 | const struct radiotap_override *overrides; 75 | int n_overrides; 76 | #endif 77 | int this_arg_index; 78 | int this_arg_size; 79 | 80 | int is_radiotap_ns; 81 | 82 | int _max_length; 83 | int _arg_index; 84 | uint32_t _bitmap_shifter; 85 | int _reset_on_ext; 86 | }; 87 | 88 | extern int ieee80211_radiotap_iterator_init( 89 | struct ieee80211_radiotap_iterator *iterator, 90 | struct ieee80211_radiotap_header *radiotap_header, 91 | int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns); 92 | 93 | extern int ieee80211_radiotap_iterator_next( 94 | struct ieee80211_radiotap_iterator *iterator); 95 | 96 | #endif /* __RADIOTAP_ITER_H */ 97 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Backtrace debugging 3 | * Copyright (c) 2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef TRACE_H 10 | #define TRACE_H 11 | 12 | #define WPA_TRACE_LEN 16 13 | 14 | #ifdef WPA_TRACE 15 | #include 16 | 17 | #include "list.h" 18 | 19 | #define WPA_TRACE_INFO void *btrace[WPA_TRACE_LEN]; int btrace_num; 20 | 21 | struct wpa_trace_ref { 22 | struct dl_list list; 23 | const void *addr; 24 | WPA_TRACE_INFO 25 | }; 26 | #define WPA_TRACE_REF(name) struct wpa_trace_ref wpa_trace_ref_##name 27 | 28 | #define wpa_trace_dump(title, ptr) \ 29 | wpa_trace_dump_func((title), (ptr)->btrace, (ptr)->btrace_num) 30 | void wpa_trace_dump_func(const char *title, void **btrace, int btrace_num); 31 | #define wpa_trace_record(ptr) \ 32 | (ptr)->btrace_num = backtrace((ptr)->btrace, WPA_TRACE_LEN) 33 | void wpa_trace_show(const char *title); 34 | #define wpa_trace_add_ref(ptr, name, addr) \ 35 | wpa_trace_add_ref_func(&(ptr)->wpa_trace_ref_##name, (addr)) 36 | void wpa_trace_add_ref_func(struct wpa_trace_ref *ref, const void *addr); 37 | #define wpa_trace_remove_ref(ptr, name, addr) \ 38 | do { \ 39 | if ((addr)) \ 40 | dl_list_del(&(ptr)->wpa_trace_ref_##name.list); \ 41 | } while (0) 42 | void wpa_trace_check_ref(const void *addr); 43 | 44 | #else /* WPA_TRACE */ 45 | 46 | #define WPA_TRACE_INFO 47 | #define WPA_TRACE_REF(n) 48 | #define wpa_trace_dump(title, ptr) do { } while (0) 49 | #define wpa_trace_record(ptr) do { } while (0) 50 | #define wpa_trace_show(title) do { } while (0) 51 | #define wpa_trace_add_ref(ptr, name, addr) do { } while (0) 52 | #define wpa_trace_remove_ref(ptr, name, addr) do { } while (0) 53 | #define wpa_trace_check_ref(addr) do { } while (0) 54 | 55 | #endif /* WPA_TRACE */ 56 | 57 | 58 | #ifdef WPA_TRACE_BFD 59 | 60 | void wpa_trace_dump_funcname(const char *title, void *pc); 61 | 62 | #else /* WPA_TRACE_BFD */ 63 | 64 | #define wpa_trace_dump_funcname(title, pc) do { } while (0) 65 | 66 | #endif /* WPA_TRACE_BFD */ 67 | 68 | #endif /* TRACE_H */ 69 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/uuid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Universally Unique IDentifier (UUID) 3 | * Copyright (c) 2008, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef UUID_H 10 | #define UUID_H 11 | 12 | #define UUID_LEN 16 13 | 14 | int uuid_str2bin(const char *str, u8 *bin); 15 | int uuid_bin2str(const u8 *bin, char *str, size_t max_len); 16 | int is_nil_uuid(const u8 *uuid); 17 | 18 | #endif /* UUID_H */ 19 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/wpabuf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dynamic data buffer 3 | * Copyright (c) 2007-2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef WPABUF_H 10 | #define WPABUF_H 11 | 12 | /* wpabuf::buf is a pointer to external data */ 13 | #define WPABUF_FLAG_EXT_DATA BIT(0) 14 | 15 | /* 16 | * Internal data structure for wpabuf. Please do not touch this directly from 17 | * elsewhere. This is only defined in header file to allow inline functions 18 | * from this file to access data. 19 | */ 20 | struct wpabuf { 21 | size_t size; /* total size of the allocated buffer */ 22 | size_t used; /* length of data in the buffer */ 23 | u8 *buf; /* pointer to the head of the buffer */ 24 | unsigned int flags; 25 | /* optionally followed by the allocated buffer */ 26 | }; 27 | 28 | 29 | int wpabuf_resize(struct wpabuf **buf, size_t add_len); 30 | struct wpabuf * wpabuf_alloc(size_t len); 31 | struct wpabuf * wpabuf_alloc_ext_data(u8 *data, size_t len); 32 | struct wpabuf * wpabuf_alloc_copy(const void *data, size_t len); 33 | struct wpabuf * wpabuf_dup(const struct wpabuf *src); 34 | void wpabuf_free(struct wpabuf *buf); 35 | void * wpabuf_put(struct wpabuf *buf, size_t len); 36 | struct wpabuf * wpabuf_concat(struct wpabuf *a, struct wpabuf *b); 37 | struct wpabuf * wpabuf_zeropad(struct wpabuf *buf, size_t len); 38 | void wpabuf_printf(struct wpabuf *buf, char *fmt, ...) PRINTF_FORMAT(2, 3); 39 | 40 | 41 | /** 42 | * wpabuf_size - Get the currently allocated size of a wpabuf buffer 43 | * @buf: wpabuf buffer 44 | * Returns: Currently allocated size of the buffer 45 | */ 46 | static inline size_t wpabuf_size(const struct wpabuf *buf) 47 | { 48 | return buf->size; 49 | } 50 | 51 | /** 52 | * wpabuf_len - Get the current length of a wpabuf buffer data 53 | * @buf: wpabuf buffer 54 | * Returns: Currently used length of the buffer 55 | */ 56 | static inline size_t wpabuf_len(const struct wpabuf *buf) 57 | { 58 | return buf->used; 59 | } 60 | 61 | /** 62 | * wpabuf_tailroom - Get size of available tail room in the end of the buffer 63 | * @buf: wpabuf buffer 64 | * Returns: Tail room (in bytes) of available space in the end of the buffer 65 | */ 66 | static inline size_t wpabuf_tailroom(const struct wpabuf *buf) 67 | { 68 | return buf->size - buf->used; 69 | } 70 | 71 | /** 72 | * wpabuf_head - Get pointer to the head of the buffer data 73 | * @buf: wpabuf buffer 74 | * Returns: Pointer to the head of the buffer data 75 | */ 76 | static inline const void * wpabuf_head(const struct wpabuf *buf) 77 | { 78 | return buf->buf; 79 | } 80 | 81 | static inline const u8 * wpabuf_head_u8(const struct wpabuf *buf) 82 | { 83 | return wpabuf_head(buf); 84 | } 85 | 86 | /** 87 | * wpabuf_mhead - Get modifiable pointer to the head of the buffer data 88 | * @buf: wpabuf buffer 89 | * Returns: Pointer to the head of the buffer data 90 | */ 91 | static inline void * wpabuf_mhead(struct wpabuf *buf) 92 | { 93 | return buf->buf; 94 | } 95 | 96 | static inline u8 * wpabuf_mhead_u8(struct wpabuf *buf) 97 | { 98 | return wpabuf_mhead(buf); 99 | } 100 | 101 | static inline void wpabuf_put_u8(struct wpabuf *buf, u8 data) 102 | { 103 | u8 *pos = wpabuf_put(buf, 1); 104 | *pos = data; 105 | } 106 | 107 | static inline void wpabuf_put_le16(struct wpabuf *buf, u16 data) 108 | { 109 | u8 *pos = wpabuf_put(buf, 2); 110 | WPA_PUT_LE16(pos, data); 111 | } 112 | 113 | static inline void wpabuf_put_le32(struct wpabuf *buf, u32 data) 114 | { 115 | u8 *pos = wpabuf_put(buf, 4); 116 | WPA_PUT_LE32(pos, data); 117 | } 118 | 119 | static inline void wpabuf_put_be16(struct wpabuf *buf, u16 data) 120 | { 121 | u8 *pos = wpabuf_put(buf, 2); 122 | WPA_PUT_BE16(pos, data); 123 | } 124 | 125 | static inline void wpabuf_put_be24(struct wpabuf *buf, u32 data) 126 | { 127 | u8 *pos = wpabuf_put(buf, 3); 128 | WPA_PUT_BE24(pos, data); 129 | } 130 | 131 | static inline void wpabuf_put_be32(struct wpabuf *buf, u32 data) 132 | { 133 | u8 *pos = wpabuf_put(buf, 4); 134 | WPA_PUT_BE32(pos, data); 135 | } 136 | 137 | static inline void wpabuf_put_data(struct wpabuf *buf, const void *data, 138 | size_t len) 139 | { 140 | if (data) 141 | os_memcpy(wpabuf_put(buf, len), data, len); 142 | } 143 | 144 | static inline void wpabuf_put_buf(struct wpabuf *dst, 145 | const struct wpabuf *src) 146 | { 147 | wpabuf_put_data(dst, wpabuf_head(src), wpabuf_len(src)); 148 | } 149 | 150 | static inline void wpabuf_set(struct wpabuf *buf, const void *data, size_t len) 151 | { 152 | buf->buf = (u8 *) data; 153 | buf->flags = WPABUF_FLAG_EXT_DATA; 154 | buf->size = buf->used = len; 155 | } 156 | 157 | static inline void wpabuf_put_str(struct wpabuf *dst, const char *str) 158 | { 159 | wpabuf_put_data(dst, str, os_strlen(str)); 160 | } 161 | 162 | #endif /* WPABUF_H */ 163 | -------------------------------------------------------------------------------- /HostapdHeaders/utils/xml-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generic XML helper functions 3 | * Copyright (c) 2012-2013, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef XML_UTILS_H 10 | #define XML_UTILS_H 11 | 12 | struct xml_node_ctx; 13 | typedef struct xml_node xml_node_t; 14 | typedef struct xml_namespace_foo xml_namespace_t; 15 | 16 | /* XML library wrappers */ 17 | 18 | int xml_validate(struct xml_node_ctx *ctx, xml_node_t *node, 19 | const char *xml_schema_fname, char **ret_err); 20 | int xml_validate_dtd(struct xml_node_ctx *ctx, xml_node_t *node, 21 | const char *dtd_fname, char **ret_err); 22 | void xml_node_free(struct xml_node_ctx *ctx, xml_node_t *node); 23 | xml_node_t * xml_node_get_parent(struct xml_node_ctx *ctx, xml_node_t *node); 24 | xml_node_t * xml_node_from_buf(struct xml_node_ctx *ctx, const char *buf); 25 | const char * xml_node_get_localname(struct xml_node_ctx *ctx, 26 | xml_node_t *node); 27 | char * xml_node_to_str(struct xml_node_ctx *ctx, xml_node_t *node); 28 | void xml_node_detach(struct xml_node_ctx *ctx, xml_node_t *node); 29 | void xml_node_add_child(struct xml_node_ctx *ctx, xml_node_t *parent, 30 | xml_node_t *child); 31 | xml_node_t * xml_node_create_root(struct xml_node_ctx *ctx, const char *ns_uri, 32 | const char *ns_prefix, 33 | xml_namespace_t **ret_ns, const char *name); 34 | xml_node_t * xml_node_create(struct xml_node_ctx *ctx, xml_node_t *parent, 35 | xml_namespace_t *ns, const char *name); 36 | xml_node_t * xml_node_create_text(struct xml_node_ctx *ctx, 37 | xml_node_t *parent, xml_namespace_t *ns, 38 | const char *name, const char *value); 39 | xml_node_t * xml_node_create_text_ns(struct xml_node_ctx *ctx, 40 | xml_node_t *parent, const char *ns_uri, 41 | const char *name, const char *value); 42 | void xml_node_set_text(struct xml_node_ctx *ctx, xml_node_t *node, 43 | const char *value); 44 | int xml_node_add_attr(struct xml_node_ctx *ctx, xml_node_t *node, 45 | xml_namespace_t *ns, const char *name, const char *value); 46 | char * xml_node_get_attr_value(struct xml_node_ctx *ctx, xml_node_t *node, 47 | char *name); 48 | char * xml_node_get_attr_value_ns(struct xml_node_ctx *ctx, xml_node_t *node, 49 | const char *ns_uri, char *name); 50 | void xml_node_get_attr_value_free(struct xml_node_ctx *ctx, char *val); 51 | xml_node_t * xml_node_first_child(struct xml_node_ctx *ctx, 52 | xml_node_t *parent); 53 | xml_node_t * xml_node_next_sibling(struct xml_node_ctx *ctx, 54 | xml_node_t *node); 55 | int xml_node_is_element(struct xml_node_ctx *ctx, xml_node_t *node); 56 | char * xml_node_get_text(struct xml_node_ctx *ctx, xml_node_t *node); 57 | void xml_node_get_text_free(struct xml_node_ctx *ctx, char *val); 58 | char * xml_node_get_base64_text(struct xml_node_ctx *ctx, xml_node_t *node, 59 | int *ret_len); 60 | xml_node_t * xml_node_copy(struct xml_node_ctx *ctx, xml_node_t *node); 61 | 62 | #define xml_node_for_each_child(ctx, child, parent) \ 63 | for (child = xml_node_first_child(ctx, parent); \ 64 | child; \ 65 | child = xml_node_next_sibling(ctx, child)) 66 | 67 | #define xml_node_for_each_sibling(ctx, node) \ 68 | for (; \ 69 | node; \ 70 | node = xml_node_next_sibling(ctx, node)) 71 | 72 | #define xml_node_for_each_check(ctx, child) \ 73 | if (!xml_node_is_element(ctx, child)) \ 74 | continue 75 | 76 | 77 | struct xml_node_ctx * xml_node_init_ctx(void *upper_ctx, 78 | const void *env); 79 | void xml_node_deinit_ctx(struct xml_node_ctx *ctx); 80 | 81 | 82 | xml_node_t * get_node_uri(struct xml_node_ctx *ctx, xml_node_t *root, 83 | const char *uri); 84 | xml_node_t * get_node(struct xml_node_ctx *ctx, xml_node_t *root, 85 | const char *path); 86 | xml_node_t * get_child_node(struct xml_node_ctx *ctx, xml_node_t *root, 87 | const char *path); 88 | xml_node_t * node_from_file(struct xml_node_ctx *ctx, const char *name); 89 | int node_to_file(struct xml_node_ctx *ctx, const char *fname, xml_node_t *node); 90 | xml_node_t * mo_to_tnds(struct xml_node_ctx *ctx, xml_node_t *mo, 91 | int use_path, const char *urn, const char *ns_uri); 92 | xml_node_t * tnds_to_mo(struct xml_node_ctx *ctx, xml_node_t *tnds); 93 | 94 | xml_node_t * soap_build_envelope(struct xml_node_ctx *ctx, xml_node_t *node); 95 | xml_node_t * soap_get_body(struct xml_node_ctx *ctx, xml_node_t *soap); 96 | 97 | #endif /* XML_UTILS_H */ 98 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | HOW TO BUILD AND RUN CAPWAP FOR LINUX SYSTEMS: 2 | 3 | NOTE: To run WTP you must have a wireless card with AP mode (check with iw) 4 | 5 | HOW TO BUILD AC AND WTP: 6 | 7 | - Enter into "capwap" directory 8 | - Run "make clean" 9 | - Run "make" 10 | 11 | Required: 12 | libnl-3-dev 13 | libnl-3-genl 14 | libssl-dev 15 | 16 | HOW TO RUN WTP: 17 | 18 | - Open a shell in superuser mode 19 | - Be sure that your wireless card is working 20 | - Be sure that the wireless card you want to use as Access Point hasn't any active wireless interface (delete all wlanX) 21 | - In file settings.wtp.txt you have to put the phy name of your wireless card (use iw): 22 | 1 23 | phy2 24 | - Open the file "config.wtp" and write the AC IP-address between and tags 25 | - Run "./WTP" in superuser mode 26 | - In LocalMAC mode, you need to bridge the master interface with your ethernet port or setting the route with ip command 27 | 28 | HOW TO RUN AC (32-bit OS recommended): 29 | 30 | - Open a shell in superuser mode 31 | - Run "./AC" in superuser mode 32 | - Create a bridge between AC_tap interface and eth0 using a script like this: 33 | dhclient -r bridgeAC 34 | brctl addbr bridgeAC 35 | brctl addif bridgeAC AC_tap 36 | brctl addif bridgeAC eth0 37 | ifconfig bridgeAC up 38 | ifconfig AC_tap up 39 | ifconfig eth0 0 40 | ifconfig AC_tap 0 41 | dhclient bridgeAC 42 | 43 | HOW TO CREATE AN Access Point Interface ON WTP SIDE: 44 | - Enter into the "wum" folder and run "make" 45 | - Run: ./wum -c wtps if you want to know all WTPs associated with your AC 46 | - Run: ./wum -c addwlan -w -r 1 -l 1 -s -t 1 47 | 48 | // -------------- 49 | N.B. 50 | OpenCAPWAP doesn't provide any type of dhcp service or IP assignation to associated stations, i.e. you must have a dhcp server active. When a client station associates with the WTP AP interface, it starts to send DHCP Discovery messages. 51 | If you are using the SPLIT MAC mode, you must create a bridge between AC's network interface (ethernet or wireless) and the AC's tap interface. 52 | If you are using the LOCAL MAC mode, you must create a bridge between the WTP's AP interface and the ethernet interface. 53 | The DHCP server must be reachable from WTP's ethernet (LOCAL MAC) or AC's ethernet (SPLIT MAC). 54 | // -------------- 55 | 56 | To set WTP and AC options edit the "config.wtp" and "config.ac" files and restart applications. 57 | 58 | For more info: elena.ago@gmail.com 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenCAPWAP v2.0 2 | 3 | Open source implementation of the CAPWAP protocol according to RFC 4515 and RFC 4516. 4 | It supports both SplitMAC and LocalMAC operational architectures. 5 | 6 | For further informations please refer to:
7 | "OpenCAPWAP v2.0: the new open-source implementation of the CAPWAP protocol", E. Agostini, M. Bernaschi, M. Vellucci, L. Vollero 8 | International Journal of Network Management 2016, Volume 26, Issue 6, Pages 537–552
9 | 10 | [Wiley Online Library](http://onlinelibrary.wiley.com/doi/10.1002/nem.1949/abstract)
11 | [ResearchGate](https://www.researchgate.net/publication/307913953_OpenCAPWAP_v20_the_new_open-source_implementation_of_the_CAPWAP_protocol_OPENCAPWAP_V20) 12 | 13 | 14 | ## Requirements 15 | 16 | This version has been tested on Linux Debian distro 32-bit. 17 | You need to install the following libraries: 18 | ``` 19 | libnl-3-dev 20 | libnl-3-genl-dev 21 | libssl-dev 22 | ``` 23 | 24 | In order to run the WTP software, you must have a wireless card with AP mode available (check with iw) 25 | 26 | ## Installing 27 | 28 | Within the openCAPWAP folder, type: 29 | ``` 30 | make clean 31 | make 32 | ``` 33 | 34 | For further info, please refer to the INSTALL file 35 | 36 | ## Notes 37 | 38 | OpenCAPWAP doesn't provide any type of DHCP service or IP assignation to associated stations, that is you must have a DHCP server active. When a client station associates with the WTP's AP interface, it starts to send DHCP Discovery messages. 39 | If you are using the SPLIT MAC mode, you must create a bridge between AC's network interface (ethernet or wireless) and the AC's tap interface. 40 | If you are using the LOCAL MAC mode, you must create a bridge between the WTP's AP interface and the ethernet interface. 41 | The DHCP server must be reachable from WTP's ethernet (LOCAL MAC) or AC's ethernet (SPLIT MAC). 42 | -------------------------------------------------------------------------------- /WTPBinding.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************ 2 | * Copyright (c) 2006-2009 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * -------------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Authors : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | * Antonio Davoli (antonio.davoli@gmail.com) * 37 | ************************************************************************************************/ 38 | 39 | 40 | #ifndef __CAPWAP_WTPBinding_HEADER__ 41 | #define __CAPWAP_WTPBinding_HEADER__ 42 | 43 | typedef struct { 44 | unsigned char radioID; 45 | WTPQosValues qosValues[NUM_QOS_PROFILES]; 46 | } RadioQosValues; 47 | 48 | typedef struct { 49 | int qosCount; 50 | RadioQosValues *radioQosValues; 51 | } CWBindingConfigurationRequestValues; 52 | 53 | typedef struct { 54 | int qosCount; 55 | RadioQosValues *radioQosValues; 56 | } CWBindingConfigurationUpdateRequestValues; 57 | 58 | /**************************************************** 59 | * 2009 Updates: * 60 | * New Structure for mananagement of * 61 | * OFDM Message Element * 62 | ****************************************************/ 63 | 64 | typedef struct { 65 | unsigned char radioID; 66 | OFDMControlValues *radioOFDMValues; 67 | } CWBindingConfigurationUpdateRequestValuesOFDM; 68 | 69 | 70 | /**************************************************** 71 | * 2009 Updates: * 72 | * Definition of port number and type * 73 | * of commands of Frequency Server * 74 | * Manager (WTP side). * 75 | ****************************************************/ 76 | 77 | #define FREQ_SERVER_ADDR "127.0.0.1" 78 | #define FREQ_SERVER_PORT 1236 79 | 80 | CWBool CWWTPInitBinding(int radioIndex); 81 | CWBool CWBindingSaveConfigureResponse(void* bindingValuesPtr, CWProtocolResultCode* resultCode); 82 | CWBool CWBindingSetQosValues(int qosCount, RadioQosValues *radioQosValues, CWProtocolResultCode *resultCode); 83 | CWBool CWBindingParseConfigurationUpdateRequest (char *msg, int len, void **valuesPtr); 84 | CWBool CWBindingParseConfigureResponse (char *msg, int len, void **valuesPtr); 85 | /**************************************************** 86 | * 2009 Updates: (SaveConfiguration) * 87 | * Prototype Modification (int * added)* 88 | ****************************************************/ 89 | CWBool CWBindingSaveConfigurationUpdateRequest(void* bindingValuesPtr, CWProtocolResultCode* resultCode, int *updateRequestType); 90 | #endif 91 | -------------------------------------------------------------------------------- /WTPFreqStatsReceive.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2009 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Antonio Davoli (antonio.davoli@gmail.com) * 32 | * * 33 | *******************************************************************************************/ 34 | 35 | 36 | #ifndef __CAPWAP_WTPFreqStatsReceive_HEADER__ 37 | #define __CAPWAP_WTPFreqStatsReceive_HEADER__ 38 | 39 | #include "CWWTP.h" 40 | #include 41 | #include 42 | #include 43 | 44 | #define SERVER_PORT 1237 45 | #define PACKET_SIZE 65536 46 | 47 | 48 | #define EXIT_THREAD CWLog("ERROR Handling Frequency Stats: application will be closed!"); \ 49 | close(recSock); \ 50 | exit(1); 51 | 52 | /* Structs for frequencies' informations */ 53 | 54 | typedef unsigned char uint8; 55 | 56 | #define MAX_FREQ_LENGTH 16 57 | #define MAX_ESSID_LENGTH 32 58 | #define MAX_MAC_ADDR_LENGTH 18 /* XX:XX:XX:XX:XX:XX */ 59 | 60 | typedef struct _quality { 61 | uint8 numerator; 62 | uint8 denominator; 63 | } quality; 64 | 65 | typedef struct _FreqQualityInfo { 66 | uint8 version; 67 | char ESSID[MAX_ESSID_LENGTH]; 68 | char Address[MAX_MAC_ADDR_LENGTH]; 69 | uint8 channel; 70 | uint8 assocStations; 71 | uint8 throughStations; 72 | quality qualityLevel; 73 | int signalLevel; 74 | int noiseLevel; 75 | } FreqQualityInfo; 76 | 77 | typedef struct _FREQ_MONITOR_DATA { 78 | int numberOfCells; 79 | FreqQualityInfo *qualityOfCells; 80 | } FREQ_MONITOR_DATA; 81 | 82 | #endif 83 | 84 | -------------------------------------------------------------------------------- /WTPipcHostapd.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Sotiraq Sima (Sotiraq.Sima@gmail.com) * 32 | * * 33 | *******************************************************************************************/ 34 | 35 | 36 | #ifndef __CAPWAP_WTPFrameReceive_HEADER__ 37 | #define __CAPWAP_WTPFrameReceive_HEADER__ 38 | 39 | #endif 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include "smac_code.h" 49 | 50 | #include "CWWTP.h" 51 | 52 | -------------------------------------------------------------------------------- /WUM.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WUM.h - WTP Update Messages 3 | * 4 | * 5 | * 4/11/2009 - Donato Capitella (d.capitella@gmail.com) 6 | */ 7 | 8 | #ifndef WUM_H 9 | #define WUM_H 10 | 11 | #include "CWCommon.h" 12 | 13 | #define WTP_VERSION_MAJOR 0 14 | #define WTP_VERSION_MINOR 93 15 | #define WTP_VERSION_REVISION 2 16 | 17 | 18 | #define WTP_VERSION_REQUEST 1 19 | #define WTP_VERSION_RESPONSE 2 20 | 21 | #define WTP_UPDATE_REQUEST 3 22 | #define WTP_UPDATE_RESPONSE 4 23 | 24 | #define WTP_CUP_FRAGMENT 5 25 | #define WTP_CUP_ACK 6 26 | 27 | #define WTP_COMMIT_UPDATE 7 28 | #define WTP_COMMIT_ACK 8 29 | 30 | #define WTP_CANCEL_UPDATE_REQUEST 9 31 | #define WTP_CANCEL_UPDATE_RESPONSE 10 32 | 33 | #define WTP_LOCK_FILE "wtp.lock" 34 | 35 | void WTPUpdateAgent(char *CupPath); 36 | 37 | #endif /* WUM_H */ 38 | -------------------------------------------------------------------------------- /capwap_bugfix_0.01: -------------------------------------------------------------------------------- 1 | 2 | ___ ____ 3 | / _ \ _ __ ___ _ __ / ___|__ _ _ ____ ____ _ _ __ 4 | | | | | '_ \ / _ \ '_ \| | / _` | '_ \ \ /\ / / _` | '_ \ 5 | | |_| | |_) | __/ | | | |__| (_| | |_) \ V V / (_| | |_) | 6 | \___/| .__/ \___|_| |_|\____\__,_| .__/ \_/\_/ \__,_| .__/ 7 | |_| |_|BUGFIX 0.01 |_| 8 | 9 | by mty (Matteo Latini, mtylty@gmail.com) 10 | 11 | 12 | 13 | This stuff """should""" now work the way is intended below...Please don't be harsh!!! :) 14 | 15 | ===> WTP re-enters Discovery State when session times out (WTPRunstate.c in CWWTPManageGenericRunMessage when using CWResetTimers) <=== 16 | 17 | ===> Fixed Segfault when using configuration tags missing preceding whitespace (ACConfigFile.c and WTPConfigFile.c) <=== 18 | 19 | ===> *** Neighbour Dead interval timeout is now down to 70 (previous value 200). DTLS doesn't complain anymore about wrong format certificates when 20 | Neighbour Dead interval timeout drops below 200. Please read the quick note to know more... *** <=== 21 | 22 | ===> WTP won't crash anymore when changing the status of the interface on which its socket is binded. Now it simply reenters discovery state with 23 | a reset <=== 24 | 25 | 26 | 27 | 28 | *** Quick Note: 29 | It should be possible (in my opinion) to lower the Neighbour Dead interval timeout even more... WARNING! Before doing so, another bugfix 30 | will be required. Infact, by running some tests, I found a bug (???) which I could not fix. Essentially, the problem lays in a concurrent 31 | thread-wait-for-condition function of both WTP and AC, after the Neighbour dead interval alarm has been started on both daemons. 32 | The condition (if I got it correctly) is just the daemon waiting for some frames on the interface. Since both daemons are waiting to hear 33 | from each other, they take some time to unlock... So, if the neighbour dead interval timeout is too low, they both (the AC and the WTP) get 34 | stuck in an endless loop (every time the timeout reaches zero the AC will think the WTP is dead so it will close the DTLS session while the 35 | WTP is still waiting to send Echo requests to the AC). 36 | The current setting (70) is the value I found working in all my tests. 37 | DISCLAIMER: Since all tests I made were carried out on my home LAN, maybe a value below 70 is even possible (or maybe my LAN did not work 38 | properly during the tests and this isn't a bug at all..) 39 | 40 | 41 | 42 | In case you were curious, this is the code (or at least this is where it got stuck (checked it with gdb)): 43 | 44 | AC Side (Function CWManageWTP inside ACMainLoop.c): 45 | 46 | /* Wait WTP action */ 47 | CWThreadMutexLock(&gWTPs[i].interfaceMutex); 48 | 49 | while ((gWTPs[i].isRequestClose == CW_FALSE) && 50 | (CWGetCountElementFromSafeList(gWTPs[i].packetReceiveList) == 0) && 51 | (gWTPs[i].interfaceCommand == NO_CMD)) { 52 | 53 | /*TODO: Check system */ 54 | CWWaitThreadCondition(&gWTPs[i].interfaceWait, 55 | &gWTPs[i].interfaceMutex); 56 | } 57 | 58 | CWThreadMutexUnlock(&gWTPs[i].interfaceMutex); 59 | 60 | 61 | 62 | 63 | WTP Side (Function CWManageWTP inside ACMainLoop.c): 64 | 65 | /* 66 | * if there are no frames from stations 67 | * and no packets from AC... 68 | */ 69 | if ((CWGetCountElementFromSafeList(gPacketReceiveList) == 0) && (CWGetCountElementFromSafeList(gFrameList) == 0)) { 70 | /* 71 | * ...wait at most 4 mins for a frame or packet. 72 | */ 73 | if (!CWErr(CWWaitThreadConditionTimeout(&gInterfaceWait, &gInterfaceMutex, &timenow))) { 74 | 75 | CWThreadMutexUnlock(&gInterfaceMutex); 76 | 77 | if (CWErrorGetLastErrorCode() == CW_ERROR_TIME_EXPIRED) { 78 | 79 | CWLog("No Message from AC for a long time... restart Discovery State"); 80 | break; 81 | } 82 | continue; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /changelog-1.0: -------------------------------------------------------------------------------- 1 | OpenCAPWAP v1.0 2 | 3 | DTLS: 4 | AC and WTP can connect using OpenSSL on Control Channel, Data Channel or both 5 | 6 | MORE WTP, ONE IP: 7 | AC accepts connections from multiple WTPs with same IP and different ports 8 | 9 | SPLIT MAC: 10 | OpenCAPWAP v1.0 works in SPLIT MAC mode too 11 | 12 | ACCESS POINT: 13 | AC can handle one or more Access Point on its associated WTPs. Client stations can connect to WTP's Master mode interfaces. 14 | 15 | For more info, please refer to "The new version of OpenCAPWAP", E. Agostini, M. Bernaschi, M. Vellucci, L. Vollero 16 | Submitted to "International Journal of Network Management" 17 | -------------------------------------------------------------------------------- /client.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDgjCCAuugAwIBAgIBAzANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJJVDEO 3 | MAwGA1UECBMFSXRhbHkxDTALBgNVBAcTBFJvbWUxEjAQBgNVBAoTCUNhcHdhcCBD 4 | QTESMBAGA1UEAxQJQ0FQV0FQX0NBMRswGQYJKoZIhvcNAQkBFgxjYUBsb2NhbGhv 5 | c3QwHhcNMDkwNDExMTc1MDAwWhcNMTkwNDA5MTc1MDAwWjB0MQswCQYDVQQGEwJJ 6 | VDEOMAwGA1UECBMFSXRhbHkxDTALBgNVBAcTBFJvbWUxEzARBgNVBAoTCkNhcHdh 7 | cCBXVFAxEzARBgNVBAMUCkNBUFdBUF9XVFAxHDAaBgkqhkiG9w0BCQEWDXd0cEBs 8 | b2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANR4Am/YUjvqfBOp 9 | 1HRYTNlt6VR26mx0inC3+HKecWO8225D2MZrNJTkKJiiWxaeqJ4ZUGEB0/b9N+eL 10 | vp6/vJbCPtP6/hp2QlySdnMfl5RCOJPQVqWysV+6kJAX9IjLxjWbfQ+kdW3Su7Id 11 | z1Wd55sDNf5vG98QPVh7dxzluqV1AgMBAAGjggElMIIBITAJBgNVHRMEAjAAMC0G 12 | CWCGSAGG+EIBDQQgFh5FYXN5LVJTQSBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYD 13 | VR0OBBYEFFPrNxEjzCdTiQQvCMUFR9RlI3MtMIGjBgNVHSMEgZswgZiAFEliRgbh 14 | 5dM6CHnG1v6TqNmqdevkoXWkczBxMQswCQYDVQQGEwJJVDEOMAwGA1UECBMFSXRh 15 | bHkxDTALBgNVBAcTBFJvbWUxEjAQBgNVBAoTCUNhcHdhcCBDQTESMBAGA1UEAxQJ 16 | Q0FQV0FQX0NBMRswGQYJKoZIhvcNAQkBFgxjYUBsb2NhbGhvc3SCCQCUWVUgWPZm 17 | MzATBgNVHSUEDDAKBggrBgEFBQcDAjALBgNVHQ8EBAMCB4AwDQYJKoZIhvcNAQEF 18 | BQADgYEAV5PWQwvmX7d3LB3TsExqNWLsW1bl9zS5x42f58sSDfDPx6PBJA9k8qKr 19 | 94DopWaKwy+bT4fXjifnKXPM/EwN+4907ny9ztMB7mkfQlZv4bNsw6FNYBQGuqc4 20 | oHgdqc05kPIzbPtIy26AAM58UOLnb4Pxhr45XAxkHwF8G5/m6uI= 21 | -----END CERTIFICATE----- 22 | -----BEGIN RSA PRIVATE KEY----- 23 | MIICXAIBAAKBgQDUeAJv2FI76nwTqdR0WEzZbelUdupsdIpwt/hynnFjvNtuQ9jG 24 | azSU5CiYolsWnqieGVBhAdP2/Tfni76ev7yWwj7T+v4adkJcknZzH5eUQjiT0Fal 25 | srFfupCQF/SIy8Y1m30PpHVt0ruyHc9VneebAzX+bxvfED1Ye3cc5bqldQIDAQAB 26 | AoGAAIP2BY1xzaFpAac0079vGEvy9/h94xt5RoK7wJNv1P0dTyws93ZFH2NaUdx6 27 | +hgScqe/ES0u9XdxzkcBhGMUswvNmofgk9w/ynQhey7g739TXeEh76zMphNVJf0z 28 | pawFFP/FIIgYVf7CdHkQ8cU4LEvTUCxAE5bICHMuOgCiEQECQQDz5/PSc/ZuMOZq 29 | ngYOCaf3p3CQdeFcFOeU3ldxW8j5eZR2Xdhu5CCeY5ELPq+yW4+J+6KBAVh6Q8Uv 30 | MwDCSqrBAkEA3wEBMgaJvpEijv6P6Ryc+khazEASDAbvUmrcUD0t14aPrCoAHAUU 31 | stCCcn8zV4MqETPr7bO9joh/oh7IpCGrtQJAMYzTydNpIuWoScykqkFn8DYB9jcc 32 | e1p72ZB57zuYTqZWdN2H1K9fuQ29L62if/d956hJUS/2y4/tBTO1WcNVgQJBALQK 33 | jJuF2cmoRV1rOma6+iW7KstCYw+gvbEtoyeI7SzXb8FQu3vjwj1HyDmGZr4doGX5 34 | JF5pwf2ESH9sGRMiOA0CQGKVeegxodjqwNEY8WqJjgROHkI1aJhdHVehAcCLhtGX 35 | WBcQEK73GJC5Kb4yTg0VEFkIWeGpy0aDnOyTJlNrQKc= 36 | -----END RSA PRIVATE KEY----- 37 | -------------------------------------------------------------------------------- /config.ac: -------------------------------------------------------------------------------- 1 | # Config File for AC. Lines beginning with # and blank lines will be ignored 2 | 3 | # HW version of the AC 4 | 1235656 5 | 6 | # SW version of the AC 7 | 3256984 8 | 9 | # Max number of mobile stations supported 10 | 200 11 | 12 | # Max number of WTP supported 13 | 15 14 | 15 | # Authentication mode for AC. Can be X509_CERTIFICATE or PRESHARED (for 16 | # preshared keys) 17 | X509_CERTIFICATE 18 | # PRESHARED 19 | 20 | # Can be IPv4 or IPv6. Of course the host must have IPv6 enabled to work with the 21 | # setting IPv6 22 | IPv4 23 | 24 | # Force MTU to 50 bytes, used to debug fragmentation ;-) If you don't need this, simply 25 | # comment the line by adding a #. 26 | 1420 27 | 28 | My AC 29 | 30 | # The AC will join the Multicast Groups you add here 31 | 32 | #239.255.1.2 33 | #239.255.1.3 34 | 35 | 36 | 1 37 | 38 | 30000000 39 | 40 | # Elena Agostini - 02/2014 41 | # OpenSSL params 42 | root.pem 43 | server.pem 44 | prova 45 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | *******************************************************************************************/ 36 | 37 | 38 | #ifdef __APPLE__ 39 | #else 40 | #define HAVE_SEM_TIMEDWAIT 41 | #endif 42 | 43 | 44 | -------------------------------------------------------------------------------- /config.wtp: -------------------------------------------------------------------------------- 1 | 2 | # Config File for WTP. Lines beginning with # and blank lines will be ignored 3 | 4 | # List of ACs' addresses for Discovery. They can be host names (e.g. "localhost", 5 | # IPv4 addresses if we are an IPv4 host or IPv6 addresses if we are an 6 | # IPv6Host. Wecan also add limited broadcast address (255.255.255.255) or 7 | # multicast addresses 8 | 9 | #255.255.255.255 10 | #localhost 11 | 192.168.1.10 12 | #239.255.1.3 13 | #127.0.0.1 14 | 15 | 16 | #Elena Agostini - 04/2014 17 | 12225 18 | 12226 19 | 20 | My WTP 1 21 | Next to Fridge 22 | 23 | # Can be IPv4 or IPv6. Of course the host must have IPv6 enabled to work with the 24 | # setting IPv6 25 | IPv4 26 | 27 | # Force MTU to 50 bytes, used to debug fragmentation ;-) If you don't need this, simply 28 | # comment the line by adding a #. 29 | 1420 30 | 31 | # If you uncomment the following line, the WTP will jump to Join State 32 | # (without doing Discovery) and the address will be considered the AC's address. 33 | # 10.0.2.15 34 | 35 | # Usually the WTP knows if the AC supports Certificate or Preshared-keys authentication 36 | # from the Discovery Response. If we jump to the Join State using , 37 | # however, we must know how to behave. This setting can be X509_CERTIFICATE (default if you 38 | # leave the line commented) or PRESHARED. This setting is ignored if you don't use 39 | # PRESHARED 40 | X509_CERTIFICATE 41 | 42 | # Elena Agostini - 02/2014 43 | # OpenSSL params 44 | root.pem 45 | client.pem 46 | prova 47 | 48 | # Elena Agostini - 02/2014 49 | # Correction labels 50 | 1 51 | 8388608 52 | 53 | -------------------------------------------------------------------------------- /docs/OpenCapwap.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vollero/openCAPWAP/04b6c7203e73cce604e8359cfef85359eb44fad2/docs/OpenCapwap.pdf -------------------------------------------------------------------------------- /docs/WTPUpdateSystem.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vollero/openCAPWAP/04b6c7203e73cce604e8359cfef85359eb44fad2/docs/WTPUpdateSystem.pdf -------------------------------------------------------------------------------- /ieee80211.h: -------------------------------------------------------------------------------- 1 | #ifndef __IEEE80211 2 | #define __IEEE80211 3 | 4 | /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ 5 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 6 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C 7 | 8 | #define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 9 | #define IEEE80211_HT_CAP_SGI_40 0x0040 10 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 11 | 12 | #define IEEE80211_HT_MCS_MASK_LEN 10 13 | 14 | /** 15 | * struct ieee80211_mcs_info - MCS information 16 | * @rx_mask: RX mask 17 | * @rx_highest: highest supported RX rate. If set represents 18 | * the highest supported RX data rate in units of 1 Mbps. 19 | * If this field is 0 this value should not be used to 20 | * consider the highest RX data rate supported. 21 | * @tx_params: TX parameters 22 | */ 23 | struct ieee80211_mcs_info { 24 | __u8 rx_mask[IEEE80211_HT_MCS_MASK_LEN]; 25 | __u16 rx_highest; 26 | __u8 tx_params; 27 | __u8 reserved[3]; 28 | } __attribute__ ((packed)); 29 | 30 | 31 | /** 32 | * struct ieee80211_ht_cap - HT capabilities 33 | * 34 | * This structure is the "HT capabilities element" as 35 | * described in 802.11n D5.0 7.3.2.57 36 | */ 37 | struct ieee80211_ht_cap { 38 | __u16 cap_info; 39 | __u8 ampdu_params_info; 40 | 41 | /* 16 bytes MCS information */ 42 | struct ieee80211_mcs_info mcs; 43 | 44 | __u16 extended_ht_cap_info; 45 | __u32 tx_BF_cap_info; 46 | __u8 antenna_selection_info; 47 | } __attribute__ ((packed)); 48 | 49 | struct ieee80211_vht_mcs_info { 50 | __u16 rx_vht_mcs; 51 | __u16 rx_highest; 52 | __u16 tx_vht_mcs; 53 | __u16 tx_highest; 54 | } __attribute__ ((packed)); 55 | 56 | struct ieee80211_vht_cap { 57 | __u32 cap_info; 58 | struct ieee80211_vht_mcs_info mcs; 59 | } __attribute__ ((packed)); 60 | 61 | #endif /* __IEEE80211 */ 62 | -------------------------------------------------------------------------------- /include/openssl/comp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_COMP_H 3 | #define HEADER_COMP_H 4 | 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef struct comp_ctx_st COMP_CTX; 12 | 13 | typedef struct comp_method_st 14 | { 15 | int type; /* NID for compression library */ 16 | const char *name; /* A text string to identify the library */ 17 | int (*init)(COMP_CTX *ctx); 18 | void (*finish)(COMP_CTX *ctx); 19 | int (*compress)(COMP_CTX *ctx, 20 | unsigned char *out, unsigned int olen, 21 | unsigned char *in, unsigned int ilen); 22 | int (*expand)(COMP_CTX *ctx, 23 | unsigned char *out, unsigned int olen, 24 | unsigned char *in, unsigned int ilen); 25 | /* The following two do NOTHING, but are kept for backward compatibility */ 26 | long (*ctrl)(void); 27 | long (*callback_ctrl)(void); 28 | } COMP_METHOD; 29 | 30 | struct comp_ctx_st 31 | { 32 | COMP_METHOD *meth; 33 | unsigned long compress_in; 34 | unsigned long compress_out; 35 | unsigned long expand_in; 36 | unsigned long expand_out; 37 | 38 | CRYPTO_EX_DATA ex_data; 39 | }; 40 | 41 | 42 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 43 | void COMP_CTX_free(COMP_CTX *ctx); 44 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 45 | unsigned char *in, int ilen); 46 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 47 | unsigned char *in, int ilen); 48 | COMP_METHOD *COMP_rle(void ); 49 | COMP_METHOD *COMP_zlib(void ); 50 | void COMP_zlib_cleanup(void); 51 | 52 | #ifdef HEADER_BIO_H 53 | #ifdef ZLIB 54 | BIO_METHOD *BIO_f_zlib(void); 55 | #endif 56 | #endif 57 | 58 | /* BEGIN ERROR CODES */ 59 | /* The following lines are auto generated by the script mkerr.pl. Any changes 60 | * made after this point may be overwritten when the script is next run. 61 | */ 62 | void ERR_load_COMP_strings(void); 63 | 64 | /* Error codes for the COMP functions. */ 65 | 66 | /* Function codes. */ 67 | #define COMP_F_BIO_ZLIB_FLUSH 99 68 | #define COMP_F_BIO_ZLIB_NEW 100 69 | #define COMP_F_BIO_ZLIB_READ 101 70 | #define COMP_F_BIO_ZLIB_WRITE 102 71 | 72 | /* Reason codes. */ 73 | #define COMP_R_ZLIB_DEFLATE_ERROR 99 74 | #define COMP_R_ZLIB_INFLATE_ERROR 100 75 | #define COMP_R_ZLIB_NOT_SUPPORTED 101 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | #endif 81 | -------------------------------------------------------------------------------- /include/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* conf_api.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CONF_API_H 60 | #define HEADER_CONF_API_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* Up until OpenSSL 0.9.5a, this was new_section */ 70 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); 71 | /* Up until OpenSSL 0.9.5a, this was get_section */ 72 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); 73 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ 74 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, 75 | const char *section); 76 | 77 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); 78 | char *_CONF_get_string(const CONF *conf, const char *section, 79 | const char *name); 80 | long _CONF_get_number(const CONF *conf, const char *section, const char *name); 81 | 82 | int _CONF_new_data(CONF *conf); 83 | void _CONF_free_data(CONF *conf); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | #define HEADER_EBCDIC_H 5 | 6 | #include 7 | 8 | /* Avoid name clashes with other applications */ 9 | #define os_toascii _openssl_os_toascii 10 | #define os_toebcdic _openssl_os_toebcdic 11 | #define ebcdic2ascii _openssl_ebcdic2ascii 12 | #define ascii2ebcdic _openssl_ascii2ebcdic 13 | 14 | extern const unsigned char os_toascii[256]; 15 | extern const unsigned char os_toebcdic[256]; 16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/openssl/fips_rand.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 2003 The OpenSSL Project. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * 3. All advertising materials mentioning features or use of this 17 | * software must display the following acknowledgment: 18 | * "This product includes software developed by the OpenSSL Project 19 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 20 | * 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 22 | * endorse or promote products derived from this software without 23 | * prior written permission. For written permission, please contact 24 | * openssl-core@openssl.org. 25 | * 26 | * 5. Products derived from this software may not be called "OpenSSL" 27 | * nor may "OpenSSL" appear in their names without prior written 28 | * permission of the OpenSSL Project. 29 | * 30 | * 6. Redistributions of any form whatsoever must retain the following 31 | * acknowledgment: 32 | * "This product includes software developed by the OpenSSL Project 33 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. 47 | * 48 | */ 49 | 50 | #ifndef HEADER_FIPS_RAND_H 51 | #define HEADER_FIPS_RAND_H 52 | 53 | #include "des.h" 54 | 55 | #ifdef OPENSSL_FIPS 56 | 57 | #ifdef __cplusplus 58 | extern "C" { 59 | #endif 60 | 61 | int FIPS_rand_set_key(const unsigned char *key, FIPS_RAND_SIZE_T keylen); 62 | int FIPS_rand_seed(const void *buf, FIPS_RAND_SIZE_T num); 63 | int FIPS_rand_bytes(unsigned char *out, FIPS_RAND_SIZE_T outlen); 64 | 65 | int FIPS_rand_test_mode(void); 66 | void FIPS_rand_reset(void); 67 | int FIPS_rand_set_dt(unsigned char *dt); 68 | 69 | int FIPS_rand_status(void); 70 | 71 | const RAND_METHOD *FIPS_rand_method(void); 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | #endif 77 | #endif 78 | -------------------------------------------------------------------------------- /include/openssl/md2.h: -------------------------------------------------------------------------------- 1 | /* crypto/md/md2.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MD2_H 60 | #define HEADER_MD2_H 61 | 62 | #include /* OPENSSL_NO_MD2, MD2_INT */ 63 | #ifdef OPENSSL_NO_MD2 64 | #error MD2 is disabled. 65 | #endif 66 | #include 67 | 68 | #define MD2_DIGEST_LENGTH 16 69 | #define MD2_BLOCK 16 70 | 71 | #ifdef __cplusplus 72 | extern "C" { 73 | #endif 74 | 75 | typedef struct MD2state_st 76 | { 77 | unsigned int num; 78 | unsigned char data[MD2_BLOCK]; 79 | MD2_INT cksm[MD2_BLOCK]; 80 | MD2_INT state[MD2_BLOCK]; 81 | } MD2_CTX; 82 | 83 | const char *MD2_options(void); 84 | #ifdef OPENSSL_FIPS 85 | int private_MD2_Init(MD2_CTX *c); 86 | #endif 87 | int MD2_Init(MD2_CTX *c); 88 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); 89 | int MD2_Final(unsigned char *md, MD2_CTX *c); 90 | unsigned char *MD2(const unsigned char *d, size_t n,unsigned char *md); 91 | #ifdef __cplusplus 92 | } 93 | #endif 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /include/openssl/opensslconf.h: -------------------------------------------------------------------------------- 1 | /* This file is here to prevent a file conflict on multiarch systems. A 2 | * conflict will frequently occur because arch-specific build-time 3 | * configuration options are stored (and used, so they can't just be stripped 4 | * out) in opensslconf.h. The original opensslconf.h has been renamed. 5 | * DO NOT INCLUDE THE NEW FILE DIRECTLY -- ALWAYS INCLUDE THIS ONE INSTEAD. */ 6 | 7 | #ifdef openssl_opensslconf_multilib_redirection_h 8 | #error "Do not define openssl_opensslconf_multilib_redirection_h!" 9 | #endif 10 | #define openssl_opensslconf_multilib_redirection_h 11 | 12 | #if defined(__i386__) 13 | #include "opensslconf-i386.h" 14 | #elif defined(__ia64__) 15 | #include "opensslconf-ia64.h" 16 | #elif defined(__powerpc64__) 17 | #include "opensslconf-ppc64.h" 18 | #elif defined(__powerpc__) 19 | #include "opensslconf-ppc.h" 20 | #elif defined(__s390x__) 21 | #include "opensslconf-s390x.h" 22 | #elif defined(__s390__) 23 | #include "opensslconf-s390.h" 24 | #elif defined(__sparc__) && defined(__arch64__) 25 | #include "opensslconf-sparc64.h" 26 | #elif defined(__sparc__) 27 | #include "opensslconf-sparc.h" 28 | #elif defined(__x86_64__) 29 | #include "opensslconf-x86_64.h" 30 | #else 31 | #error "This openssl-devel package does not work your architecture?" 32 | #endif 33 | 34 | #undef openssl_opensslconf_multilib_redirection_h 35 | -------------------------------------------------------------------------------- /include/openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OPENSSLV_H 2 | #define HEADER_OPENSSLV_H 3 | 4 | /* Numeric release version identifier: 5 | * MNNFFPPS: major minor fix patch status 6 | * The status nibble has one of the values 0 for development, 1 to e for betas 7 | * 1 to 14, and f for release. The patch level is exactly that. 8 | * For example: 9 | * 0.9.3-dev 0x00903000 10 | * 0.9.3-beta1 0x00903001 11 | * 0.9.3-beta2-dev 0x00903002 12 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) 13 | * 0.9.3 0x0090300f 14 | * 0.9.3a 0x0090301f 15 | * 0.9.4 0x0090400f 16 | * 1.2.3z 0x102031af 17 | * 18 | * For continuity reasons (because 0.9.5 is already out, and is coded 19 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level 20 | * part is slightly different, by setting the highest bit. This means 21 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start 22 | * with 0x0090600S... 23 | * 24 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) 25 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 26 | * major minor fix final patch/beta) 27 | */ 28 | #define OPENSSL_VERSION_NUMBER 0x009080bfL 29 | #ifdef OPENSSL_FIPS 30 | #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8k-fips 25 Mar 2009" 31 | #else 32 | #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8k 25 Mar 2009" 33 | #endif 34 | #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 35 | 36 | 37 | /* The macros below are to be used for shared library (.so, .dll, ...) 38 | * versioning. That kind of versioning works a bit differently between 39 | * operating systems. The most usual scheme is to set a major and a minor 40 | * number, and have the runtime loader check that the major number is equal 41 | * to what it was at application link time, while the minor number has to 42 | * be greater or equal to what it was at application link time. With this 43 | * scheme, the version number is usually part of the file name, like this: 44 | * 45 | * libcrypto.so.0.9 46 | * 47 | * Some unixen also make a softlink with the major verson number only: 48 | * 49 | * libcrypto.so.0 50 | * 51 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the 52 | * shared library version is stored in the file, and is actually a series 53 | * of versions, separated by colons. The rightmost version present in the 54 | * library when linking an application is stored in the application to be 55 | * matched at run time. When the application is run, a check is done to 56 | * see if the library version stored in the application matches any of the 57 | * versions in the version string of the library itself. 58 | * This version string can be constructed in any way, depending on what 59 | * kind of matching is desired. However, to implement the same scheme as 60 | * the one used in the other unixen, all compatible versions, from lowest 61 | * to highest, should be part of the string. Consecutive builds would 62 | * give the following versions strings: 63 | * 64 | * 3.0 65 | * 3.0:3.1 66 | * 3.0:3.1:3.2 67 | * 4.0 68 | * 4.0:4.1 69 | * 70 | * Notice how version 4 is completely incompatible with version, and 71 | * therefore give the breach you can see. 72 | * 73 | * There may be other schemes as well that I haven't yet discovered. 74 | * 75 | * So, here's the way it works here: first of all, the library version 76 | * number doesn't need at all to match the overall OpenSSL version. 77 | * However, it's nice and more understandable if it actually does. 78 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER, 79 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit). 80 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, 81 | * we need to keep a history of version numbers, which is done in the 82 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and 83 | * should only keep the versions that are binary compatible with the current. 84 | */ 85 | #define SHLIB_VERSION_HISTORY "" 86 | #define SHLIB_VERSION_NUMBER "0.9.8k" 87 | 88 | 89 | #endif /* HEADER_OPENSSLV_H */ 90 | -------------------------------------------------------------------------------- /include/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * 3. All advertising materials mentioning features or use of this 17 | * software must display the following acknowledgment: 18 | * "This product includes software developed by the OpenSSL Project 19 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 20 | * 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 22 | * endorse or promote products derived from this software without 23 | * prior written permission. For written permission, please contact 24 | * licensing@OpenSSL.org. 25 | * 26 | * 5. Products derived from this software may not be called "OpenSSL" 27 | * nor may "OpenSSL" appear in their names without prior written 28 | * permission of the OpenSSL Project. 29 | * 30 | * 6. Redistributions of any form whatsoever must retain the following 31 | * acknowledgment: 32 | * "This product includes software developed by the OpenSSL Project 33 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. 47 | * ==================================================================== 48 | * 49 | * This product includes cryptographic software written by Eric Young 50 | * (eay@cryptsoft.com). This product includes software written by Tim 51 | * Hudson (tjh@cryptsoft.com). 52 | * 53 | */ 54 | 55 | /* 56 | * This header only exists to break a circular dependency between pem and err 57 | * Ben 30 Jan 1999. 58 | */ 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | #ifndef HEADER_PEM_H 65 | void ERR_load_PEM_strings(void); 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /include/openssl/pqueue.h: -------------------------------------------------------------------------------- 1 | /* crypto/pqueue/pqueue.h */ 2 | /* 3 | * DTLS implementation written by Nagendra Modadugu 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_PQUEUE_H 61 | #define HEADER_PQUEUE_H 62 | 63 | #include 64 | #include 65 | #include 66 | 67 | #include 68 | 69 | typedef struct _pqueue *pqueue; 70 | 71 | typedef struct _pitem 72 | { 73 | PQ_64BIT priority; 74 | void *data; 75 | struct _pitem *next; 76 | } pitem; 77 | 78 | typedef struct _pitem *piterator; 79 | 80 | pitem *pitem_new(PQ_64BIT priority, void *data); 81 | void pitem_free(pitem *item); 82 | 83 | pqueue pqueue_new(void); 84 | void pqueue_free(pqueue pq); 85 | 86 | pitem *pqueue_insert(pqueue pq, pitem *item); 87 | pitem *pqueue_peek(pqueue pq); 88 | pitem *pqueue_pop(pqueue pq); 89 | pitem *pqueue_find(pqueue pq, PQ_64BIT priority); 90 | pitem *pqueue_iterator(pqueue pq); 91 | pitem *pqueue_next(piterator *iter); 92 | 93 | void pqueue_print(pqueue pq); 94 | int pqueue_size(pqueue pq); 95 | 96 | #endif /* ! HEADER_PQUEUE_H */ 97 | -------------------------------------------------------------------------------- /include/openssl/rc2.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc2/rc2.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC2_H 60 | #define HEADER_RC2_H 61 | 62 | #include /* OPENSSL_NO_RC2, RC2_INT */ 63 | #ifdef OPENSSL_NO_RC2 64 | #error RC2 is disabled. 65 | #endif 66 | 67 | #define RC2_ENCRYPT 1 68 | #define RC2_DECRYPT 0 69 | 70 | #define RC2_BLOCK 8 71 | #define RC2_KEY_LENGTH 16 72 | 73 | #ifdef __cplusplus 74 | extern "C" { 75 | #endif 76 | 77 | typedef struct rc2_key_st 78 | { 79 | RC2_INT data[64]; 80 | } RC2_KEY; 81 | 82 | #ifdef OPENSSL_FIPS 83 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); 84 | #endif 85 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); 86 | void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, 87 | int enc); 88 | void RC2_encrypt(unsigned long *data,RC2_KEY *key); 89 | void RC2_decrypt(unsigned long *data,RC2_KEY *key); 90 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 91 | RC2_KEY *ks, unsigned char *iv, int enc); 92 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, 93 | long length, RC2_KEY *schedule, unsigned char *ivec, 94 | int *num, int enc); 95 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, 96 | long length, RC2_KEY *schedule, unsigned char *ivec, 97 | int *num); 98 | 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /include/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc4/rc4.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC4_H 60 | #define HEADER_RC4_H 61 | 62 | #include /* OPENSSL_NO_RC4, RC4_INT */ 63 | #ifdef OPENSSL_NO_RC4 64 | #error RC4 is disabled. 65 | #endif 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | 71 | typedef struct rc4_key_st 72 | { 73 | RC4_INT x,y; 74 | RC4_INT data[256]; 75 | } RC4_KEY; 76 | 77 | 78 | const char *RC4_options(void); 79 | #ifdef OPENSSL_FIPS 80 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 81 | #endif 82 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 83 | void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, 84 | unsigned char *outdata); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /include/openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | /* crypto/ripemd/ripemd.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RIPEMD_H 60 | #define HEADER_RIPEMD_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | #ifdef OPENSSL_NO_RIPEMD 70 | #error RIPEMD is disabled. 71 | #endif 72 | 73 | #if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) 74 | #define RIPEMD160_LONG unsigned long 75 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 76 | #define RIPEMD160_LONG unsigned long 77 | #define RIPEMD160_LONG_LOG2 3 78 | #else 79 | #define RIPEMD160_LONG unsigned int 80 | #endif 81 | 82 | #define RIPEMD160_CBLOCK 64 83 | #define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) 84 | #define RIPEMD160_DIGEST_LENGTH 20 85 | 86 | typedef struct RIPEMD160state_st 87 | { 88 | RIPEMD160_LONG A,B,C,D,E; 89 | RIPEMD160_LONG Nl,Nh; 90 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 91 | unsigned int num; 92 | } RIPEMD160_CTX; 93 | #ifdef OPENSSL_FIPS 94 | int private_RIPEMD160_Init(RIPEMD160_CTX *c); 95 | #endif 96 | int RIPEMD160_Init(RIPEMD160_CTX *c); 97 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 98 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 99 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, 100 | unsigned char *md); 101 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /include/openssl/ssl23.h: -------------------------------------------------------------------------------- 1 | /* ssl/ssl23.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_SSL23_H 60 | #define HEADER_SSL23_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | /*client */ 67 | /* write to server */ 68 | #define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) 69 | #define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) 70 | /* read from server */ 71 | #define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) 72 | #define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) 73 | 74 | /* server */ 75 | /* read from client */ 76 | #define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) 77 | #define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif 83 | 84 | -------------------------------------------------------------------------------- /include/openssl/tmdiff.h: -------------------------------------------------------------------------------- 1 | /* crypto/tmdiff.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | /* Header for dynamic hash table routines 60 | * Author - Eric Young 61 | */ 62 | /* ... erm yeah, "dynamic hash tables" you say? 63 | * 64 | * And what would dynamic hash tables have to do with any of this code *now*? 65 | * AFAICS, this code is only referenced by crypto/bn/exp.c which is an unused 66 | * file that I doubt compiles any more. speed.c is the only thing that could 67 | * use this (and it has nothing to do with hash tables), yet it instead has its 68 | * own duplication of all this stuff and looks, if anything, more complete. See 69 | * the corresponding note in apps/speed.c. 70 | * The Bemused - Geoff 71 | */ 72 | 73 | #ifndef HEADER_TMDIFF_H 74 | #define HEADER_TMDIFF_H 75 | 76 | #ifdef __cplusplus 77 | extern "C" { 78 | #endif 79 | 80 | typedef struct ms_tm MS_TM; 81 | 82 | MS_TM *ms_time_new(void ); 83 | void ms_time_free(MS_TM *a); 84 | void ms_time_get(MS_TM *a); 85 | double ms_time_diff(MS_TM *start, MS_TM *end); 86 | int ms_time_cmp(const MS_TM *ap, const MS_TM *bp); 87 | 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | 92 | #endif 93 | 94 | -------------------------------------------------------------------------------- /include/openssl/txt_db.h: -------------------------------------------------------------------------------- 1 | /* crypto/txt_db/txt_db.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_TXT_DB_H 60 | #define HEADER_TXT_DB_H 61 | 62 | #include 63 | #ifndef OPENSSL_NO_BIO 64 | #include 65 | #endif 66 | #include 67 | #include 68 | 69 | #define DB_ERROR_OK 0 70 | #define DB_ERROR_MALLOC 1 71 | #define DB_ERROR_INDEX_CLASH 2 72 | #define DB_ERROR_INDEX_OUT_OF_RANGE 3 73 | #define DB_ERROR_NO_INDEX 4 74 | #define DB_ERROR_INSERT_INDEX_CLASH 5 75 | 76 | #ifdef __cplusplus 77 | extern "C" { 78 | #endif 79 | 80 | typedef struct txt_db_st 81 | { 82 | int num_fields; 83 | STACK /* char ** */ *data; 84 | LHASH **index; 85 | int (**qual)(char **); 86 | long error; 87 | long arg1; 88 | long arg2; 89 | char **arg_row; 90 | } TXT_DB; 91 | 92 | #ifndef OPENSSL_NO_BIO 93 | TXT_DB *TXT_DB_read(BIO *in, int num); 94 | long TXT_DB_write(BIO *out, TXT_DB *db); 95 | #else 96 | TXT_DB *TXT_DB_read(char *in, int num); 97 | long TXT_DB_write(char *out, TXT_DB *db); 98 | #endif 99 | int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(char **), 100 | LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); 101 | void TXT_DB_free(TXT_DB *db); 102 | char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value); 103 | int TXT_DB_insert(TXT_DB *db,char **value); 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /include/openssl/ui_compat.h: -------------------------------------------------------------------------------- 1 | /* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 3 | * project 2001. 4 | */ 5 | /* ==================================================================== 6 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. All advertising materials mentioning features or use of this 21 | * software must display the following acknowledgment: 22 | * "This product includes software developed by the OpenSSL Project 23 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 24 | * 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 26 | * endorse or promote products derived from this software without 27 | * prior written permission. For written permission, please contact 28 | * openssl-core@openssl.org. 29 | * 30 | * 5. Products derived from this software may not be called "OpenSSL" 31 | * nor may "OpenSSL" appear in their names without prior written 32 | * permission of the OpenSSL Project. 33 | * 34 | * 6. Redistributions of any form whatsoever must retain the following 35 | * acknowledgment: 36 | * "This product includes software developed by the OpenSSL Project 37 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 38 | * 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. 51 | * ==================================================================== 52 | * 53 | * This product includes cryptographic software written by Eric Young 54 | * (eay@cryptsoft.com). This product includes software written by Tim 55 | * Hudson (tjh@cryptsoft.com). 56 | * 57 | */ 58 | 59 | #ifndef HEADER_UI_COMPAT_H 60 | #define HEADER_UI_COMPAT_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* The following functions were previously part of the DES section, 70 | and are provided here for backward compatibility reasons. */ 71 | 72 | #define des_read_pw_string(b,l,p,v) \ 73 | _ossl_old_des_read_pw_string((b),(l),(p),(v)) 74 | #define des_read_pw(b,bf,s,p,v) \ 75 | _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) 76 | 77 | int _ossl_old_des_read_pw_string(char *buf,int length,const char *prompt,int verify); 78 | int _ossl_old_des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif 84 | -------------------------------------------------------------------------------- /modifiche_uci_frequency_2009.txt: -------------------------------------------------------------------------------- 1 | Capwap README 2009: Uci - Frequency 2 | 3 | 4 | DISCLAIMER: If you want to realize new capabilities into the OpenCapwap Protocol, you need to read the IETF draft writed by CAPWAP Working Group and ACAppsProtocol.h (inside Capwap directoy) first, then you need to modify the Application server which we talk about below is just a way of centering application development, it's not meant to bypass coding in the OpenCapwap code base (many message elements are still missing, so you may have to implement some new ones). 5 | 6 | AC side: 7 | 8 | - All sockets, previously Unix sockets, are now Inet sockets. 9 | 10 | To let the Access Controller receive multiple connections from other applications (the ones which add fuctionality), we added to 11 | ACInterface a multi-thread TCP server. This TCP server provides to external applications the possibility to talk to the connected 12 | Wireless Termination Points tunnelling packets through the Capwap protocol. 13 | 14 | When the AC server is started, a standalone thread is spawned to manage the various applications' requests. 15 | Every time the TCP server receives a new connection, a new thread is spawned to manage that one specific external application. 16 | The communication between the AC (through the TCP server) and external applications is ruled by a protocol which (we hope) will 17 | be used for every other application (even those which are not yet implemented) as is. This simple protocol is basically made of 18 | the command id, the WTP id, the length of the attached payload and the payload itself (refer to ACAppsProtocol.h for header specs). 19 | The protocol's main commands are LIST_MSG and CONF_UPDATE_MSG: 20 | LIST_MSG returns the list of the WTPs attached to the AC 21 | CONF_UPDATE_MSG lets the application send a Capwap Configuration Update Request Message to a single (or all) connected WTP. 22 | 23 | 24 | At the moment, implemented Configuration Update Request/Response message elements are: 25 | - OFDM Element Type ( Binding 802.11 ) 26 | - Vendor Specific Payload Type 27 | 28 | *** All other element types are NOT yet implemented in the OpenCapwap protocol (except those already implemented) 29 | 30 | 31 | 32 | WTP side: 33 | 34 | Frequencies Management: 35 | To realize Frequencies management inside Capwap WTP we added an additional parsing of Configuration Update Request Message 36 | (inside code of 802.11 Binding) with Orthogonal Frequency Division Multiplexing (OFDM) Element Type. (This message, 37 | when sent by AC, force the WTP to adhere to received values). 38 | 39 | When a new OFDM message is received, the WTP provide to forward it, through an inet socket (udp), to an external application 40 | that will do the corrispondent operations (scanning, monitoring, setting). 41 | We added a new thread too (WTPFreqStatsReceive) inside WTP that receive the statistics packets (or ack packet, for frequency 42 | setting operation) and provide to encapsulate them in CAPWAP Data Message that will recognize by AC through an apposite flag 43 | (for more informations see CWBinding.h). 44 | 45 | 46 | Remote UCI command execution via Vendor Specific Payload: 47 | OpenCapwap was used to deploy basic remote administration and configuration to a number of access points. The access points 48 | use OpenWrt (http://openwrt.org/) running the OpenCapwap WTP daemon. Since OpenWrt comes with a very handy, centralized 49 | configuration utility called UCI, custom Vendor Specific Payloads have been coded to implement Uci Vendor Specific Payloads. 50 | These custom payloads basically carry uci commands to be executed on one or more wtps (the access points). When the AC issues 51 | a Configuration Update Request containing an Uci Vendor Specific Payload to a WTP, the WTP daemon unpacks it and forwards the 52 | command to be executed to an external application. The WTP daemon and the external application talk through an inet socket (udp). 53 | The external application basically executes the command and signals back the daemon if the command succeded/failed. The WTP 54 | daemon then forwards this response to the AC via a Configuration Update Response carrying an Uci Vendor Specific Payload. 55 | (For more information see CWVendorPayloads.h) 56 | These messages have all been handled by some new code which is completely separated from the 802.11 Binding Code. This code 57 | is essentially meant to manage Capwap Protocol Element Types (which couldn't be treated as part of a specific Technology Binding). 58 | -------------------------------------------------------------------------------- /root.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDNzCCAqCgAwIBAgIJAJRZVSBY9mYzMA0GCSqGSIb3DQEBBQUAMHExCzAJBgNV 3 | BAYTAklUMQ4wDAYDVQQIEwVJdGFseTENMAsGA1UEBxMEUm9tZTESMBAGA1UEChMJ 4 | Q2Fwd2FwIENBMRIwEAYDVQQDFAlDQVBXQVBfQ0ExGzAZBgkqhkiG9w0BCQEWDGNh 5 | QGxvY2FsaG9zdDAeFw0wOTA0MTExNzQ2MzlaFw0xOTA0MDkxNzQ2MzlaMHExCzAJ 6 | BgNVBAYTAklUMQ4wDAYDVQQIEwVJdGFseTENMAsGA1UEBxMEUm9tZTESMBAGA1UE 7 | ChMJQ2Fwd2FwIENBMRIwEAYDVQQDFAlDQVBXQVBfQ0ExGzAZBgkqhkiG9w0BCQEW 8 | DGNhQGxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAw0gvx6qo 9 | B4fd23/dU5yBdj/TKzVM1/kC/bwRRFjNd2FIMpjsJ7drbwhZo5CrOSFyKn8X4Exr 10 | EdkfMjjNFi6mZVmdFfJO4ex+6qJqc1m52AocUEOkyG/52LOnCTsT91yps97obPUF 11 | 8ezK0m9a5dnuoJ8q7lxbGu7m0PJ0Qgws3dsCAwEAAaOB1jCB0zAdBgNVHQ4EFgQU 12 | SWJGBuHl0zoIecbW/pOo2ap16+QwgaMGA1UdIwSBmzCBmIAUSWJGBuHl0zoIecbW 13 | /pOo2ap16+ShdaRzMHExCzAJBgNVBAYTAklUMQ4wDAYDVQQIEwVJdGFseTENMAsG 14 | A1UEBxMEUm9tZTESMBAGA1UEChMJQ2Fwd2FwIENBMRIwEAYDVQQDFAlDQVBXQVBf 15 | Q0ExGzAZBgkqhkiG9w0BCQEWDGNhQGxvY2FsaG9zdIIJAJRZVSBY9mYzMAwGA1Ud 16 | EwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAsHOGDPcwslke/Ux3bp2tZj4MizTL 17 | DJqTRbqoiQLOTfUI7KU0GQ2m+ywTwhpiUPhmqqmgtGKXbL9mQB/qcG6HGNzdRc56 18 | 4ttc1RVErhmM/LZEFjyHamuOryUY5FmS78XXBGFRkvPAap9OSQU4vXPfehYFCL+p 19 | /L9CoKunApUqH3g= 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /server.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDmTCCAwKgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJJVDEO 3 | MAwGA1UECBMFSXRhbHkxDTALBgNVBAcTBFJvbWUxEjAQBgNVBAoTCUNhcHdhcCBD 4 | QTESMBAGA1UEAxQJQ0FQV0FQX0NBMRswGQYJKoZIhvcNAQkBFgxjYUBsb2NhbGhv 5 | c3QwHhcNMDkwNDExMTc0OTI1WhcNMTkwNDA5MTc0OTI1WjBxMQswCQYDVQQGEwJJ 6 | VDEOMAwGA1UECBMFSXRhbHkxDTALBgNVBAcTBFJvbWUxEjAQBgNVBAoTCUNhcHdh 7 | cCBBQzESMBAGA1UEAxQJQ0FQV0FQX0FDMRswGQYJKoZIhvcNAQkBFgxhY0Bsb2Nh 8 | bGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOKfkPb1xVIjzI0obHwL 9 | SuwNUN4NNw3edcth2FjjP+zLW7XgyoeTzyLzfTXPLe+tpIrTjOx/0n4ZyxEVKLDu 10 | dDPiISRw0OQiL+tZPe/Ewhv3fRusPPhGyQr0ErBxEQ1ShNmpdoRoM8Z8VBpMNPQi 11 | rftMey7uGv6zDRg4FkZInXq3AgMBAAGjggE/MIIBOzAJBgNVHRMEAjAAMBEGCWCG 12 | SAGG+EIBAQQEAwIGQDA0BglghkgBhvhCAQ0EJxYlRWFzeS1SU0EgR2VuZXJhdGVk 13 | IFNlcnZlciBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUY3sBfLYr3NXkvaGs1Lvgb6YH 14 | FqQwgaMGA1UdIwSBmzCBmIAUSWJGBuHl0zoIecbW/pOo2ap16+ShdaRzMHExCzAJ 15 | BgNVBAYTAklUMQ4wDAYDVQQIEwVJdGFseTENMAsGA1UEBxMEUm9tZTESMBAGA1UE 16 | ChMJQ2Fwd2FwIENBMRIwEAYDVQQDFAlDQVBXQVBfQ0ExGzAZBgkqhkiG9w0BCQEW 17 | DGNhQGxvY2FsaG9zdIIJAJRZVSBY9mYzMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAsG 18 | A1UdDwQEAwIFoDANBgkqhkiG9w0BAQUFAAOBgQAKvp5socYMptNekmsJIXiZ8IOh 19 | pC9WVlVRYfQEpf6axJV2AfNylhjilvmNz20ybDmckqJBOeI/Mu9zdfA+9JyTrzFj 20 | x1Uujd6rmVmCNlRJ7+8Tpybbjy6TDKHVteZdeqQ/HY6tc8UyuiTSSvWulRiYB4D8 21 | vpVFzlCr/G6QeosoXQ== 22 | -----END CERTIFICATE----- 23 | -----BEGIN RSA PRIVATE KEY----- 24 | MIICWwIBAAKBgQDin5D29cVSI8yNKGx8C0rsDVDeDTcN3nXLYdhY4z/sy1u14MqH 25 | k88i8301zy3vraSK04zsf9J+GcsRFSiw7nQz4iEkcNDkIi/rWT3vxMIb930brDz4 26 | RskK9BKwcRENUoTZqXaEaDPGfFQaTDT0Iq37THsu7hr+sw0YOBZGSJ16twIDAQAB 27 | AoGAM0gEV735rsKnEPIqyk8L3yqMOBMpeBv079buS/7wgjbqQ9fgPJm376LFnJ2L 28 | OYdDip6gbwvlp99SUkVFdfQfmwjmBDk1IfEWYiPO4CUrsIUzid2KtueZW5c6Cm0Q 29 | RMutCQrsZw9s6VpL9bmV0zsm3MYNYfERs0rPOIW9I3YyrEECQQD5t5V4Uj7+gpZO 30 | Qvb+tYAVb8NcYTPBfdVbZJ8MRrs9tH2Y2AkuE1D+g7S5qq+Ld1tBIcCeKhlG4+ee 31 | ClH20s3RAkEA6FM8eGKOhZ4nmu4yzwdMJnqY0d4+56805VS5Z+uJJiXvCXKQ+wQr 32 | e/8BLsWRLxXlqijshsWzHID2g8i/rlC6BwJADiHqrqWQ9Rx03zcA/YdOGWh62PaT 33 | VEcH1SVLrwktvZ9CYG0Rj+797XmMt9lGGBGIM5ZybUEarx1k1VfmLZ7ekQJAKPOD 34 | FTVKKgNWt9iE3DlNEvtJNLUYIX6gtEva4paB9ld5axDmvVhe0dyBON1aWhJiCTxt 35 | dNQkXkHdMh2QrAlOwQJAcoEhG5Zl0wATXSCFvbvaJKiH9Ab1IjlCtNI3O/+TgQjN 36 | ZQMA0nO5ZJ3p266M8zh2hgIRdNstv4oilqh/3DnO3g== 37 | -----END RSA PRIVATE KEY----- 38 | -------------------------------------------------------------------------------- /settings.ac.txt: -------------------------------------------------------------------------------- 1 | # Settings File for AC. Lines beginning with # and blank lines will be ignored 2 | # 3 | # 4 | # 5 | 2 6 | 3 7 | 1 8 | # 9 | # 10 | 3 11 | 4 12 | 1 13 | # 14 | # 15 | 3 16 | 10 17 | 2 18 | # 19 | # 20 | 4 21 | 10 22 | 7 23 | 24 | 25 | 5543 26 | /tmp/ac_ipc_hostapd 27 | 28 | -------------------------------------------------------------------------------- /settings.wtp.txt: -------------------------------------------------------------------------------- 1 | # Settings File for WTP. Lines beginning with # and blank lines will be ignored 2 | 3 | /var/log/wtp1.txt 4 | 5 | #Elena Agostini 07-2014: nl80211 support 6 | 1 7 | phy1 8 | #phyX 9 | 10 | #Elena Agostini 11/2014: Local Bridgind Support with mac80211 11 | eth0 12 | bridge0 13 | 14 | mon.wlan0 15 | wlan0 16 | vmnet1 17 | eth0 18 | 12345678 19 | 12345678 20 | 21 | 6333 22 | /tmp/wtp_ipc_hostapd 23 | 24 | # Elena Agostini - 02/2014 25 | # QoS Static Values variables 26 | 1 27 | 1 28 | 1 29 | 1 30 | 1 31 | 1 32 | 1 33 | 1 34 | 1 35 | 1 36 | 37 | # mon.wlan0 38 | # eth0 39 | # wlan0 40 | # lo 41 | # eth0 42 | # 12345678 43 | # 12345678 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /tap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Documentation/networking/tuntap.txt 3 | * 4 | */ 5 | 6 | #include "CWAC.h" 7 | #include "CWVendorPayloads.h" 8 | #include "CWFreqPayloads.h" 9 | #include "WUM.h" 10 | 11 | 12 | #include 13 | 14 | 15 | 16 | #ifdef DMALLOC 17 | #include "../dmalloc-5.5.0/dmalloc.h" 18 | #endif 19 | 20 | int tun_alloc(char *dev, int flags) { 21 | 22 | struct ifreq ifr; 23 | int fd, err; 24 | char *clonedev = "/dev/net/tun"; 25 | 26 | /* Arguments taken by the function: 27 | * 28 | * char *dev: the name of an interface (or '\0'). MUST have enough 29 | * space to hold the interface name if '\0' is passed 30 | * int flags: interface flags (eg, IFF_TUN etc.) 31 | */ 32 | 33 | /* open the clone device */ 34 | if( (fd = open(clonedev, O_RDWR)) < 0 ) { 35 | return fd; 36 | } 37 | 38 | /* preparation of the struct ifr, of type "struct ifreq" */ 39 | memset(&ifr, 0, sizeof(ifr)); 40 | 41 | ifr.ifr_flags = flags; /* IFF_TUN or IFF_TAP, plus maybe IFF_NO_PI */ 42 | 43 | if (*dev) { 44 | /* if a device name was specified, put it in the structure; otherwise, 45 | * the kernel will try to allocate the "next" device of the 46 | * specified type */ 47 | strncpy(ifr.ifr_name, dev, IFNAMSIZ); 48 | } 49 | 50 | /* try to create the device */ 51 | if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) { 52 | CWLog("Err to creater tap device"); 53 | close(fd); 54 | return err; 55 | } 56 | 57 | /* if the operation was successful, write back the name of the 58 | * interface to the variable "dev", so the caller can know 59 | * it. Note that the caller MUST reserve space in *dev (see calling 60 | * code below) */ 61 | strcpy(dev, ifr.ifr_name); 62 | 63 | /* this is the special file descriptor that the caller will use to talk 64 | * with the virtual interface */ 65 | return fd; 66 | } 67 | 68 | 69 | int init_AC_tap_interface(int WTPIndex) 70 | { 71 | sprintf(gWTPs[WTPIndex].tap_name,"wtp%d", WTPIndex); 72 | 73 | gWTPs[WTPIndex].tap_fd = tun_alloc(gWTPs[WTPIndex].tap_name, IFF_TAP | IFF_NO_PI); 74 | 75 | CWDebugLog("gWTPs[%d].tap_name %s,tap_fd %d",WTPIndex,gWTPs[WTPIndex].tap_name,gWTPs[WTPIndex].tap_fd); 76 | 77 | return 0; 78 | } 79 | 80 | //Elena Agostini: unique AC Tap Interface 81 | CWBool CWACTapInterfaceInit() 82 | { 83 | CW_CREATE_ARRAY_CALLOC_ERR(ACTap_name, 7, char, return CWErrorRaise(CW_ERROR_OUT_OF_MEMORY, NULL);); 84 | sprintf(ACTap_name,"AC_tap", 6); 85 | ACTap_FD = tun_alloc(ACTap_name, IFF_TAP | IFF_NO_PI); 86 | CWLog("ACTap_name:%s, ACTap_FD:%d", ACTap_name, ACTap_FD); 87 | 88 | return CW_TRUE; 89 | } 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /tap.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica * 3 | * Universita' Campus BioMedico - Italy * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify it under the terms * 6 | * of the GNU General Public License as published by the Free Software Foundation; either * 7 | * version 2 of the License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 | * * 13 | * You should have received a copy of the GNU General Public License along with this * 14 | * program; if not, write to the: * 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 16 | * MA 02111-1307, USA. * 17 | * * 18 | * In addition, as a special exception, the copyright holders give permission to link the * 19 | * code of portions of this program with the OpenSSL library under certain conditions as * 20 | * described in each individual source file, and distribute linked combinations including * 21 | * the two. You must obey the GNU General Public License in all respects for all of the * 22 | * code used other than OpenSSL. If you modify file(s) with this exception, you may * 23 | * extend this exception to your version of the file(s), but you are not obligated to do * 24 | * so. If you do not wish to do so, delete this exception statement from your version. * 25 | * If you delete this exception statement from all source files in the program, then also * 26 | * delete it here. * 27 | * 28 | * --------------------------------------------------------------------------------------- * 29 | * Project: Capwap * 30 | * * 31 | * Author : Ludovico Rossi (ludo@bluepixysw.com) * 32 | * Del Moro Andrea (andrea_delmoro@libero.it) * 33 | * Giovannini Federica (giovannini.federica@gmail.com) * 34 | * Massimo Vellucci (m.vellucci@unicampus.it) * 35 | * Mauro Bisson (mauro.bis@gmail.com) * 36 | *******************************************************************************************/ 37 | 38 | #ifndef __AC_TAP_H__ 39 | #define __AC_TAP_H__ 40 | 41 | int init_AC_tap_interface(int WTPIndex); 42 | CWBool CWACTapInterfaceInit(); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /timerlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 17 | * 18 | * Author(s): Mauro Bisson 19 | */ 20 | 21 | /* 22 | * This C module implements a simple timer library. 23 | */ 24 | 25 | #ifndef TIMERLIB_H 26 | #define TIMERLIB_H 27 | 28 | /* 29 | * Initializes the timer library. It is important that the calling thread and 30 | * any other thread in the process block the signal SIGALRM. 31 | * 32 | * Return: 1 in case of success; 0 otherwise. 33 | */ 34 | int timer_init(); 35 | 36 | /* 37 | * Tears down any data allocated for the library. 38 | */ 39 | void timer_destroy(); 40 | 41 | /* 42 | * Adds a timer to expire "sec" seconds + "usec" milliseconds after the 43 | * invocation. When the timer will expire, function "hndlr" will be executed 44 | * with arg "hndlr_arg". The id of the timer (>=0) is returned. 45 | * 46 | * Return: id>=0 in case of success; -1 in case of error. 47 | * 48 | * Remarks: sec and usec must define a future time relative to "now". If 49 | * one is negative or both equal zero the funtion will return -1. The 50 | * library don't manipulate in any way the address pointed by "hndlr_arg", 51 | * it is responsibility of the calling thread to free any memory, if 52 | * allocated (a good place is at the end of "hndlr" function or when calling 53 | * "timer_rem()" ;). 54 | * There is no costraint about relative time definition, you can set a two 55 | * second timer as (sec,usec)=(2,0) or (sec,usec)=(0,2000000). 56 | * Since this library implementation do not rely on "sigaction()" syscall, 57 | * inside "hndlr" it is perfectly legal to call any not signal safe and 58 | * pthread_* function. The only limitation is that timer_destroy() MUST 59 | * NOT be called inside hndlr. 60 | * Note that this fuction can be called inside "hndlr" to create 61 | * "chain timers". 62 | */ 63 | int timer_add(long /*sec*/, long /*usec*/, void(* /*hndlr*/)(void *), 64 | void * /*hndlr_arg*/); 65 | 66 | /* 67 | * Remove from the queue the timer of identifier "id", if it retured 68 | * from a previous succesful call to timer_add(). The function 69 | * "free_arg" is called with the handler argument specified in "timer_add" 70 | * call. It should be used to free the memory when the timer is destroyed 71 | * before expiring. 72 | * 73 | * Remarks: if "id" is a value not returned by timer_add() nothing happens. 74 | */ 75 | void timer_rem(int /*id*/, void(* /*free_arg*/)(void *)); 76 | 77 | /* 78 | * Prints the content of the timer queue (do not use, it's for debug purpose). 79 | */ 80 | void timer_print(); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /wum/Makefile: -------------------------------------------------------------------------------- 1 | wum: wum.o wumLib.o 2 | clean: 3 | rm -rf wum *.o 4 | -------------------------------------------------------------------------------- /wum/README: -------------------------------------------------------------------------------- 1 | WUM - WTP Update Manager 2 | 3 | Wum (WTP Update Manager) is the command line tool used to send update 4 | requests to the WTPs. Of course it is executed on the AC machine and interacts 5 | with the AC Interface. 6 | 7 | To compile it, just run 'make'. 8 | 9 | For further details about how to use it, refer to the document WTPUpdateSystem.pdf 10 | in the docs sub-directory of this source tree. 11 | -------------------------------------------------------------------------------- /wum/wumLib.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #define QUIT_MSG 0 5 | #define LIST_MSG 1 6 | #define CONF_UPDATE_MSG 2 7 | 8 | #define MSG_ELEMENT_TYPE_VENDOR_WUM 3 9 | //Elena Agostini - 09/2014: IEEE Binding 10 | #define MSG_ELEMENT_TYPE_ADD_WLAN 4 11 | #define MSG_ELEMENT_TYPE_DEL_WLAN 5 12 | 13 | #define WTP_VERSION_REQUEST 1 14 | #define WTP_VERSION_RESPONSE 2 15 | 16 | #define WTP_UPDATE_REQUEST 3 17 | #define WTP_UPDATE_RESPONSE 4 18 | 19 | #define WTP_CUP_FRAGMENT 5 20 | #define WTP_CUP_ACK 6 21 | 22 | #define WTP_COMMIT_UPDATE 7 23 | #define WTP_COMMIT_ACK 8 24 | 25 | #define WTP_CANCEL_UPDATE_REQUEST 9 26 | #define WTP_CANCEL_UPDATE_RESPONSE 10 27 | 28 | #define WTP_WLAN_ADD_REQUEST 11 29 | #define WTP_WLAN_ADD_RESPONSE 12 30 | 31 | #define WTP_WLAN_DEL_REQUEST 13 32 | #define WTP_WLAN_DEL_RESPONSE 14 33 | 34 | #define SUCCESS 0 35 | #define ERROR 1 36 | 37 | #define FRAGMENT_SIZE 4000 38 | 39 | struct WTPInfo { 40 | int wtpId; 41 | char *name; 42 | }; 43 | 44 | struct version_info { 45 | char major; 46 | char minor; 47 | char revision; 48 | int size; 49 | }; 50 | 51 | int ACServerConnect(char *address, int port); 52 | void ACServerDisconnect(int acserver); 53 | struct WTPInfo *ACServerWTPList(int acserver, int *nWTPs); 54 | void freeWTPList(struct WTPInfo *wtpList, int nWTPs); 55 | 56 | int WUMGetWTPVersion(int acserver, int wtpId, struct version_info *); 57 | int WUMReadCupVersion(char *cup_pathname, struct version_info *update_v); 58 | int WUMUpdate(int acserver, int wtpId, void *cup_buf, struct version_info update_v); 59 | int WUMSendCancelRequest(int acserver, int wtpId); 60 | 61 | /* 62 | * Elena Agostini - 09/2014: IEEE 802.11 Binding 63 | */ 64 | void do_wlan_add_cmd(int acserver, char *wtpIds, char *wtpNames, char * ssid, char * radioID, char * wlanID, char * tunnel); 65 | void do_wlan_del_cmd(int acserver, char *wtpIds, char *wtpNames, char * radioID, char * wlanID); 66 | 67 | 68 | --------------------------------------------------------------------------------