summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Kehn <rdkehn@yahoo.com>2011-01-26 14:32:06 -0800
committerInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>2011-02-04 10:18:39 -0800
commit0cf64cffc9a8bf4e67af09aa1e84540f4969016a (patch)
tree94b59a5756aff58c75f96cb1d578335baa7c137f
parent0a065f6386b285e211dcc0444847469cba9071ef (diff)
Supplicant: Big-endian support
Add byte swap calls where needed. Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
-rw-r--r--InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.am4
-rw-r--r--InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.in8
-rw-r--r--InfraStack/OSAgnostic/WiMax/Wrappers/Supplicant/wmxSDK_Sup_Impl.c14
3 files changed, 16 insertions, 10 deletions
diff --git a/InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.am b/InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.am
index ac8169f..b6d2222 100644
--- a/InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.am
+++ b/InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.am
@@ -124,7 +124,7 @@ libSupplicantAgent_la_CFLAGS = -I "$(top_srcdir)/InfraStack/OSAgnostic/Product/
-I "$(srcdir)/../../Wrappers/NDnS" \
-I "$(srcdir)/../../Wrappers/Apdo" \
-I "$(srcdir)/Source/ds" \
- -D _GNU_SOURCE \
+ -D _GNU_SOURCE @LIBWIMAX_CFLAGS@ \
-D "_USE_TRACE" -D "BMI_MACHINE_ENDIANNESS_LITTLE" \
-D "IEEE8021X_EAPOL" -D "_OS_WIN32SIM" -D "_LINUX"
@@ -133,7 +133,7 @@ libSupplicantAgent_la_CFLAGS = -I "$(top_srcdir)/InfraStack/OSAgnostic/Product/
if WPA_SUP_ENABLE
libSupplicantAgent_la_SOURCES += $(WPA_SUP_SOURCES)
libSupplicantAgent_la_CFLAGS += $(WPA_SUP_CFLAGS)
-libSupplicantAgent_la_LIBS = $(WPA_SUP_LIBS)
+libSupplicantAgent_la_LIBS = $(WPA_SUP_LIBS) @LIBWIMAX_LIBS@
EXTRA_DIST += $(DS_SUP_SOURCES)
else
libSupplicantAgent_la_SOURCES += $(DS_SUP_SOURCES)
diff --git a/InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.in b/InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.in
index 1118c3e..6078349 100644
--- a/InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.in
+++ b/InfraStack/OSAgnostic/WiMax/Agents/Supplicant/Makefile.in
@@ -396,10 +396,10 @@ libSupplicantAgent_la_CFLAGS = -I \
"$(top_srcdir)/InfraStack/OSAgnostic/Product/Instrumantation/MOCHandler/UDapiL5" \
-I "$(srcdir)/../NDnS/APDO" -I "$(srcdir)/../../Wrappers/NDnS" \
-I "$(srcdir)/../../Wrappers/Apdo" -I "$(srcdir)/Source/ds" -D \
- _GNU_SOURCE -D "_USE_TRACE" -D "BMI_MACHINE_ENDIANNESS_LITTLE" \
- -D "IEEE8021X_EAPOL" -D "_OS_WIN32SIM" -D "_LINUX" \
- $(am__append_2)
-@WPA_SUP_ENABLE_TRUE@libSupplicantAgent_la_LIBS = $(WPA_SUP_LIBS)
+ _GNU_SOURCE @LIBWIMAX_CFLAGS@ -D "_USE_TRACE" -D \
+ "BMI_MACHINE_ENDIANNESS_LITTLE" -D "IEEE8021X_EAPOL" -D \
+ "_OS_WIN32SIM" -D "_LINUX" $(am__append_2)
+@WPA_SUP_ENABLE_TRUE@libSupplicantAgent_la_LIBS = $(WPA_SUP_LIBS) @LIBWIMAX_LIBS@
all: all-am
.SUFFIXES:
diff --git a/InfraStack/OSAgnostic/WiMax/Wrappers/Supplicant/wmxSDK_Sup_Impl.c b/InfraStack/OSAgnostic/WiMax/Wrappers/Supplicant/wmxSDK_Sup_Impl.c
index 8f55917..ad592e0 100644
--- a/InfraStack/OSAgnostic/WiMax/Wrappers/Supplicant/wmxSDK_Sup_Impl.c
+++ b/InfraStack/OSAgnostic/WiMax/Wrappers/Supplicant/wmxSDK_Sup_Impl.c
@@ -53,6 +53,8 @@
#include <eap_peer/util/common.h>
#include <eap_peer/crypto/tls.h>
+#include <wimaxll.h>
+
#ifndef WPA_OPEN_SOURCE
/* temporary, remove*/
@@ -211,8 +213,12 @@ void wmxSup_MessagesHandler(L5_CONNECTION Conn,
void *pvReserved )
{
L3L4CompleteHeader_type *l3L4CompleteHeader;
+ UINT16 length;
+ UINT16 type;
l3L4CompleteHeader = (L3L4CompleteHeader_type*)pvSentBuffer;
+ type = wimaxll_le16_to_cpu(l3L4CompleteHeader->Type);
+ length = wimaxll_le16_to_cpu(l3L4CompleteHeader->Length);
UNREFERENCED_PARAMETER(pvReserved);
UNREFERENCED_PARAMETER(pvUserContext);
@@ -227,7 +233,7 @@ void wmxSup_MessagesHandler(L5_CONNECTION Conn,
//GOLD, SILVER
case L4_PROXY_OPCODE_STATUS_INDICATION_ARRIVED:
case L4_PROXY_OPCODE_L4_INDICATION_ARRIVED:
- switch (l3L4CompleteHeader->Type)
+ switch (type)
{
case L3_L4_OPCODE_REPORT_EAP_REQUEST:
pUtils->tpfnPostRequest( MEDIUM,
@@ -240,13 +246,13 @@ void wmxSup_MessagesHandler(L5_CONNECTION Conn,
case L3_L4_OPCODE_REPORT_ALT_ACCEPT:
case L3_L4_OPCODE_REPORT_KEY_REQUEST:
pUtils->tpfnPostRequest( MEDIUM,
- l3L4CompleteHeader->Type,
+ type,
NULL,
0,
wmxSup_InternalHandler );
break;
case L3_L4_OPCODE_REPORT_EMSK_RELATED_KEYS:
- TRACE(TR_MOD_SUPPLICANT_WRAPPER, TR_SEV_INFO, "Received BEK (%d bytes)", l3L4CompleteHeader->Length);
+ TRACE(TR_MOD_SUPPLICANT_WRAPPER, TR_SEV_INFO, "Received BEK (%d bytes)", length);
break;
default:
TRACE(TR_MOD_SUPPLICANT_WRAPPER, TR_SEV_ERR,"Unknown message arrived");
@@ -255,7 +261,7 @@ void wmxSup_MessagesHandler(L5_CONNECTION Conn,
break;
//PVC
case SUP_OPCODE_INDICATION_ARRIVED:
- switch (((pSUP_MESSAGE_HEADER)pvSentBuffer)->opcode)
+ switch (wimaxll_le32_to_cpu(((pSUP_MESSAGE_HEADER)pvSentBuffer)->opcode))
{
case SUP_OPCODE_IND_EVENT:
EventReportCB(*(wmx_pSupEvent_t)(((pSUP_MESSAGE)pvSentBuffer)->buf));