summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cesar/host/fcall/fcall.h6
-rw-r--r--cesar/host/fcall/src/fcall.c69
-rw-r--r--cesar/host/fcall/src/fcall_param.c34
-rw-r--r--cesar/host/fcall/src/probe.c8
-rw-r--r--cesar/host/sci/cesar/inc/sci.h5
-rw-r--r--cesar/host/test/src/test_fcall_param.c4
-rw-r--r--cesar/interface/fcall/inc/context.h4
-rw-r--r--cesar/interface/fcall/inc/interface_fcall.h7
-rw-r--r--cesar/interface/fcall/src/interface_fcall.c84
-rw-r--r--cesar/interface/fcall/test/src/test_interface_fcall.c58
-rw-r--r--cesar/interface/src/interface.c7
-rw-r--r--cesar/maximus/prototest/fcall/src/test_fcall.c24
-rw-r--r--cesar/maximus/prototest/integration/Makefile4
-rw-r--r--cesar/maximus/prototest/integration/src/cl_stub.c112
-rw-r--r--cesar/maximus/prototest/integration/src/test_integration.c49
-rw-r--r--cesar/maximus/python/lib/proto/fcall.py125
-rw-r--r--cesar/maximus/python/lib/proto/maximus_proto.py62
-rw-r--r--cesar/maximus/python/py/test_proto.py149
-rwxr-xr-xcesar/maximus/test/test_python.sh25
-rw-r--r--cesar/test_general/maximus/integration/cp_beacon-dp/Makefile12
20 files changed, 644 insertions, 204 deletions
diff --git a/cesar/host/fcall/fcall.h b/cesar/host/fcall/fcall.h
index 87cb7c5f5c..0942a21c7e 100644
--- a/cesar/host/fcall/fcall.h
+++ b/cesar/host/fcall/fcall.h
@@ -51,8 +51,8 @@ struct fcall_param_elt
{
/** parameter id in string format */
char *id;
- /** parameter data length in network format (big endian)*/
- unsigned short *length;
+ /** parameter data length */
+ unsigned short length;
/** parameter data */
unsigned char *data;
};
@@ -93,8 +93,6 @@ struct fcall_ctx
struct fcall_function function_table[FUNCTION_CALL_FUNCTION_MAX_NB];
/** number of registered functions */
int function_nb;
- /** bitstream context */
- bitstream_t bitstream_ctx;
};
/** variable register structure */
diff --git a/cesar/host/fcall/src/fcall.c b/cesar/host/fcall/src/fcall.c
index 96bc07e484..0719f8261f 100644
--- a/cesar/host/fcall/src/fcall.c
+++ b/cesar/host/fcall/src/fcall.c
@@ -21,12 +21,16 @@
#include <stdio.h>
#include <errno.h>
#include "host/fcall/fcall.h"
+
#ifndef UNIT_TEST
#include "lib/swap.h"
#include "host/syscall.h"
+#include <cyg/infra/diag.h>
+//#define diag_printf(arg, ...) ((void) 0)
#else /* UNIT_TEST */
#include <unistd.h>
#include <arpa/inet.h>
+#define diag_printf(arg, ...) ((void) 0)
#endif /* UNIT_TEST */
/**
@@ -276,10 +280,7 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
fcall_param_t param_recv, *param_ref;
unsigned char return_flags = 0;
int len = 0;
-
-#ifdef FCALL_PROTO
- u8 tmp = 0;
-#endif /* FCALL_PROTO */
+ u8 type = 0;
fcall = (fcall_ctx_t *)fcall_data;
@@ -291,36 +292,29 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
errno = EINVAL;
return -1;
}
-
+
param_ref = &param_recv;
fcall_param_init(&param_recv, "", 0);
-
+
/* set header pointer in case of not already done */
msg->hdr.fcall = (struct fcall_msg_hdr *)(msg->data_begin);
+
/* check header content */
- DBG_ASSERT(msg->hdr.fcall->type == FUNCTION_CALL_TYPE_REQ);
- if(msg->hdr.fcall->type != FUNCTION_CALL_TYPE_REQ)
+ type = msg->hdr.fcall->type;
+ DBG_ASSERT(type == FUNCTION_CALL_TYPE_REQ);
+ if(type != FUNCTION_CALL_TYPE_REQ)
{
errno = EPROTOTYPE;
station_log(fcall->sci->station, STATION_LOG_WARNING, STATION_LOGTYPE_FCALL,
- "%s: errno = %d: bad type %x", __FUNCTION__, errno, msg->hdr.fcall->type);
+ "%s: errno = %d: bad type %x", __FUNCTION__, errno, type);
return -1;
}
-
+
/* fill the param structure */
/* get the parameter number */
-
-#ifndef FCALL_PROTO
param_ref->param_nb = msg->hdr.fcall->param_nb;
+ /* get the message id */
param_ref->msg_id = ntohs(msg->hdr.fcall->msg_id);
-#else /* FCALL_PROTO */
- bitstream_init (&fcall->bitstream_ctx, msg->hdr.fcall, sizeof(struct fcall_msg_hdr), BITSTREAM_READ);
- bitstream_access (&fcall->bitstream_ctx, &tmp, 8); // version
- bitstream_access (&fcall->bitstream_ctx, &tmp, 8); // type
- bitstream_access (&fcall->bitstream_ctx, &param_ref->msg_id, 16);
- bitstream_access (&fcall->bitstream_ctx, &param_ref->param_nb, 8);
- bitstream_finalise (&fcall->bitstream_ctx);
-#endif /* FCALL_PROTO */
if(sci_msg_pop(msg, sizeof(struct fcall_msg_hdr)) < (int)sizeof(struct fcall_msg_hdr))
{
@@ -328,7 +322,7 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
"%s: errno = %d because cannot get fcall header", __FUNCTION__, errno);
return -1;
}
-
+
/* check function id len */
DBG_ASSERT((strlen((char *)(msg->data_begin)) != 0)
&& (strlen((char *)(msg->data_begin)) < FUNCTION_CALL_ID_MAX_SIZE));
@@ -344,13 +338,15 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
/* init param structure */
strcpy(param_ref->id, (char *)(msg->data_begin));
len = (int)strlen((char *)(msg->data_begin)) + 1;
+ diag_printf("fcall_recv: function id = %s\n", param_ref->id);
+
if(sci_msg_pop(msg, len) < len)
{
station_log(fcall->sci->station, STATION_LOG_ERROR, STATION_LOGTYPE_FCALL,
"%s: errno = %d because cannot get data", __FUNCTION__, errno);
return -1;
}
-
+
/* find the registred function */
DBG_ASSERT(fcall->function_nb > 0);
if(fcall->function_nb <= 0)
@@ -374,11 +370,11 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
"%s: errno = %d: function '%s' not registered", __FUNCTION__, errno, param_ref->id);
return -1;
}
-
+
/* get all param */
for(index = 0; index < param_ref->param_nb; index++)
{
- int length = 0;
+ diag_printf("fcall_recv: param#%d\n", index + 1);
DBG_ASSERT(msg->length != 0);
if(msg->length == 0)
{
@@ -389,20 +385,16 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
}
param_ref->param_table[index].id = (char *)(msg->data_begin);
len = (int)strlen((char *)(msg->data_begin)) + 1;
+ diag_printf("\tid = %s\n", param_ref->param_table[index].id);
+
if(sci_msg_pop(msg, len) < len)
{
station_log(fcall->sci->station, STATION_LOG_ERROR, STATION_LOGTYPE_FCALL,
"%s: errno = %d because cannot get data", __FUNCTION__, errno);
return -1;
}
-
- param_ref->param_table[index].length = (unsigned short *)(msg->data_begin);
-
-#ifndef FCALL_PROTO
- length = ntohs(*param_ref->param_table[index].length);
-#else /* FCALL_PROTO */
- length = read_u16_from_word((u8 *)param_ref->param_table[index].length);
-#endif /* FCALL_PROTO */
+ param_ref->param_table[index].length = (*msg->data_begin << 8) | *(msg->data_begin + 1);
+ diag_printf("\tlength = %d octets\n", param_ref->param_table[index].length);
if(sci_msg_pop(msg, sizeof(unsigned short)) < (int)sizeof(unsigned short))
{
@@ -410,15 +402,17 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
"%s: errno = %d because cannot fill param length", __FUNCTION__, errno);
return -1;
}
+
param_ref->param_table[index].data = msg->data_begin;
- if(sci_msg_pop(msg, length) < length)
+
+ if(sci_msg_pop(msg, param_ref->param_table[index].length) < param_ref->param_table[index].length)
{
station_log(fcall->sci->station, STATION_LOG_ERROR, STATION_LOGTYPE_FCALL,
"%s: errno = %d because cannot fill param data", __FUNCTION__, errno);
return -1;
}
}
-
+
DBG_ASSERT(msg->length <= 0);
if(msg->length > 0)
{
@@ -426,7 +420,7 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
"%s: errno = %d: msg length > 0 (%d) after parameter extraction", __FUNCTION__, errno, msg->length);
return -1;
}
-
+
/* call the function */
station_log(fcall->sci->station, STATION_LOG_INFO, STATION_LOGTYPE_FCALL,
"%s calling function '%s'(%p) with %d parameters",
@@ -468,9 +462,10 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
return 0;
/* after function return, we get a param structure update with return results */
-
+
/* be sure to have the same function name */
strcpy(param_ref->id, fcall->function_table[function_index].id);
+
/* fill the fcall msg header to prepare the answer */
if(fcall_fill_hdr(fcall, msg, param_ref, return_flags) < 0)
{
@@ -486,7 +481,7 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
"%s: errno = %d because cannot fill sci header", __FUNCTION__, errno);
return -1;
}
-
+
/* send the message */
if (sci_send(fcall->sci, msg) < 0)
{
diff --git a/cesar/host/fcall/src/fcall_param.c b/cesar/host/fcall/src/fcall_param.c
index a2f1114376..d432b39e39 100644
--- a/cesar/host/fcall/src/fcall_param.c
+++ b/cesar/host/fcall/src/fcall_param.c
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <errno.h>
#include "host/fcall/fcall.h"
+
#ifndef UNIT_TEST
#include "lib/swap.h"
#include "host/syscall.h"
@@ -199,13 +200,8 @@ int fcall_param_bind(fcall_param_t *param, sci_msg_t *msg, char *id, unsigned in
{
/* found id */
/* get length */
+ length = param->param_table[index].length;
-#ifndef FCALL_PROTO
- length = ntohs(*param->param_table[index].length);
-#else /* FCALL_PROTO */
- length = read_u16_from_word((u8 *)param->param_table[index].length);
-#endif /* FCALL_PROTO */
-
/* check the maximum available length */
if(length > max_length)
length = max_length;
@@ -242,7 +238,8 @@ int fcall_param_bind(fcall_param_t *param, sci_msg_t *msg, char *id, unsigned in
int fcall_param_add(fcall_param_t *param, sci_msg_t *msg, char *id, int length, void *data)
{
int total_len;
-
+ unsigned char *index = NULL;
+
DBG_ASSERT(param);
DBG_ASSERT(msg);
DBG_ASSERT(id);
@@ -286,15 +283,18 @@ int fcall_param_add(fcall_param_t *param, sci_msg_t *msg, char *id, int length,
errno = ENOSPC;
return -1;
}
-
+
/* copy id, length and data into msg and match the param structure */
- param->param_table[param->param_nb].id = (char *)(msg->data_begin);
- strcpy(param->param_table[param->param_nb].id, id);
- param->param_table[param->param_nb].length = (unsigned short *)(param->param_table[param->param_nb].id + strlen(id) + 1);
- *param->param_table[param->param_nb].length = htons(length);
- param->param_table[param->param_nb].data = (unsigned char *)param->param_table[param->param_nb].length + sizeof(unsigned short);
- memcpy(param->param_table[param->param_nb].data, data, length);
-
+ index = msg->data_begin;
+ param->param_table[param->param_nb].id = (char *)index;
+ strcpy((char *)index, id);
+ index += strlen(id) + 1;
+ *(index++) = length >> 8;
+ *(index++) = (u8)length;
+ param->param_table[param->param_nb].length = length;
+ param->param_table[param->param_nb].data = index;
+ memcpy(index, data, length);
+
/* increment the parameter number */
param->param_nb++;
@@ -309,9 +309,9 @@ void fcall_param_dump(fcall_param_t *param, int fd, char *buffer, int size)
write(fd, buffer, strlen(buffer));
for(i = 0; i < param->param_nb; i++)
{
- snprintf(buffer, size - 1, " id=%s, length=%d, data=", param->param_table[i].id, ntohs(*param->param_table[i].length));
+ snprintf(buffer, size - 1, " id=%s, length=%d, data=", param->param_table[i].id, param->param_table[i].length);
write(fd, buffer, strlen(buffer));
- for(j = 0; j < ntohs(*param->param_table[i].length); j++)
+ for(j = 0; j < param->param_table[i].length; j++)
{
snprintf(buffer, size - 1, "%02x-", param->param_table[i].data[j]);
write(fd, buffer, 3);
diff --git a/cesar/host/fcall/src/probe.c b/cesar/host/fcall/src/probe.c
index 8c5eb6f16a..4986821477 100644
--- a/cesar/host/fcall/src/probe.c
+++ b/cesar/host/fcall/src/probe.c
@@ -201,7 +201,7 @@ int probe_recv(fcall_ctx_t *fcall, fcall_param_t **param, sci_msg_t **msg, void
if(!strcmp((*param)->param_table[index_param].id, probe->var_table[index_var].id))
{
/* found !*/
- if(*(*param)->param_table[index_param].length == 0)
+ if((*param)->param_table[index_param].length == 0)
{
/* this is a get request */
station_log(fcall->sci->station, STATION_LOG_INFO, STATION_LOGTYPE_PROBE,
@@ -226,19 +226,19 @@ int probe_recv(fcall_ctx_t *fcall, fcall_param_t **param, sci_msg_t **msg, void
*((unsigned char *)probe->var_table[index_var].addr + 3)
);
}
- else if(ntohs(*(*param)->param_table[index_param].length) <= probe->var_table[index_var].length)
+ else if((*param)->param_table[index_param].length <= probe->var_table[index_var].length)
{
/* this is a set request with a correct length */
memcpy(
probe->var_table[index_var].addr,
(*param)->param_table[index_param].data,
- ntohs(*(*param)->param_table[index_param].length)
+ (*param)->param_table[index_param].length
);
station_log(fcall->sci->station, STATION_LOG_INFO, STATION_LOGTYPE_PROBE,
"%s set '%s' (%d bytes @ %p)",
__FUNCTION__,
probe->var_table[index_var].id,
- ntohs(*(*param)->param_table[index_param].length),
+ (*param)->param_table[index_param].length,
probe->var_table[index_var].addr
);
fcall_param_add(
diff --git a/cesar/host/sci/cesar/inc/sci.h b/cesar/host/sci/cesar/inc/sci.h
index 6acbcfe247..0fc2697da7 100644
--- a/cesar/host/sci/cesar/inc/sci.h
+++ b/cesar/host/sci/cesar/inc/sci.h
@@ -20,7 +20,10 @@
*/
#undef SCI_MSG_MAX_SIZE
-#define SCI_MSG_MAX_SIZE 1514 // ETH_PACKET_MAX_SIZE - sizeof(u32) /* vlantag */
+/* ETH_PACKET_MAX_SIZE
+ * - sizeof(u32) (vlantag)
+ * - 2 (for alignment) */
+#define SCI_MSG_MAX_SIZE 1512
/**
* register a send callback function to send a message
diff --git a/cesar/host/test/src/test_fcall_param.c b/cesar/host/test/src/test_fcall_param.c
index c70615dec8..cd1234438a 100644
--- a/cesar/host/test/src/test_fcall_param.c
+++ b/cesar/host/test/src/test_fcall_param.c
@@ -195,7 +195,7 @@ void fcall_param_add_test_case(test_t t)
(fcall_param_add(&param, &msg, "test1", strlen(FCALL_TEST1_STR), FCALL_TEST1_STR) >= 0)
&& (param.param_nb == 1)
&& !strcmp(param.param_table[0].id, "test1")
- && (ntohs(*param.param_table[0].length) == strlen(FCALL_TEST1_STR))
+ && (param.param_table[0].length == strlen(FCALL_TEST1_STR))
&& !memcmp(param.param_table[0].data, FCALL_TEST1_STR, strlen(FCALL_TEST1_STR))
&& !strcmp((char *)msg.data_begin, "test1")
&& (ntohs(*(unsigned short *)(msg.data_begin + strlen("test1") + 1)) == strlen(FCALL_TEST1_STR))
@@ -210,7 +210,7 @@ void fcall_param_add_test_case(test_t t)
(fcall_param_add(&param, &msg, "test2", strlen(FCALL_TEST2_STR), FCALL_TEST2_STR) >= 0)
&& (param.param_nb == 2)
&& !strcmp(param.param_table[1].id, "test2")
- && (ntohs(*param.param_table[1].length) == strlen(FCALL_TEST2_STR))
+ && (param.param_table[1].length == strlen(FCALL_TEST2_STR))
&& !memcmp(param.param_table[1].data, FCALL_TEST2_STR, strlen(FCALL_TEST2_STR))
&& !strcmp((char *)msg.data_begin, "test2")
&& (ntohs(*(unsigned short *)(msg.data_begin + strlen("test2") + 1)) == strlen(FCALL_TEST2_STR))
diff --git a/cesar/interface/fcall/inc/context.h b/cesar/interface/fcall/inc/context.h
index aa11403a28..5d202c16bf 100644
--- a/cesar/interface/fcall/inc/context.h
+++ b/cesar/interface/fcall/inc/context.h
@@ -33,13 +33,11 @@ typedef struct interface_fcall_t
probe_ctx_t *probe_ctx; /** pointer to probe context */
interface_fcall_send_message_cb_t send_cb; /** callback function to call when interface fcall module needs to send a message */
interface_fcall_send_done_message_cb_t send_done_cb; /** callback function to call when interface fcall module needs to release a buffer */
+ interface_fcall_get_buffer_cb_t buffer_get_cb; /** interface_fcall_get_buffer call back */
void *user_data; /** data to provide on callback function */
bitstream_t bitstream_ctx; /** bitstream context */
mac_t oda; /** ODA of the received MME */
mac_t osa; /** OSA of the received MME */
-
- /** interface_fcall_get_buffer call back*/
- interface_fcall_get_buffer_cb_t buffer_get_cb;
} interface_fcall_t;
#endif /* interface_fcall_inc_context_h */
diff --git a/cesar/interface/fcall/inc/interface_fcall.h b/cesar/interface/fcall/inc/interface_fcall.h
index 1a87ccb969..9f67c7eb07 100644
--- a/cesar/interface/fcall/inc/interface_fcall.h
+++ b/cesar/interface/fcall/inc/interface_fcall.h
@@ -14,7 +14,12 @@
*
*/
-#define INTERFACE_FCALL_PAYLOAD_OFFSET 22 /* mme header without vlan tag (19) + sub-module type (1) + payload length (2) */
+/* mme header without vlan tag (19 octets)
+ * + sub-module type (1 octet)
+ * + padding zero (2 octets)
+ * + payload length (2 octets) */
+#define INTERFACE_FCALL_PAYLOAD_OFFSET 24
+
#define INTERFACE_FCALL_MMTYPE 0xABCD // TBD
/**
diff --git a/cesar/interface/fcall/src/interface_fcall.c b/cesar/interface/fcall/src/interface_fcall.c
index b1eb6afaf7..e1e8be76fd 100644
--- a/cesar/interface/fcall/src/interface_fcall.c
+++ b/cesar/interface/fcall/src/interface_fcall.c
@@ -23,8 +23,16 @@
#include "hal/hle/defs.h"
#include "lib/read_word.h"
#include "lib/utils.h"
+#include "lib/swap.h" // for 'swap16()'
#include <errno.h>
+#ifndef UNIT_TEST
+#include <cyg/infra/diag.h>
+//#define diag_printf(arg, ...) ((void) 0)
+#else /* UNIT_TEST */
+#define diag_printf(arg, ...) ((void) 0)
+#endif /* UNIT_TEST */
+
/**
* initialise the interface fcall module and the callback functions
* \param send_cb the function to call when the interface fcall needs to send an INTERFACE message
@@ -118,8 +126,8 @@ interface_fcall_mme_recv (void *data, u8 *mme)
{
interface_fcall_t *ctx = NULL;
static sci_msg_t msg;
+ static unsigned char buffer[SCI_MSG_MAX_SIZE];
uint length = 0;
- u8 *buffer;
dbg_assert_ptr(data);
dbg_assert_ptr(mme);
@@ -132,34 +140,46 @@ interface_fcall_mme_recv (void *data, u8 *mme)
ctx = (interface_fcall_t*)data;
- /** Read ODA and OSA. */
+ /** Read ODA and OSA (BIG-ENDIAN). */
bitstream_init (&ctx->bitstream_ctx, mme, INTERFACE_FCALL_PAYLOAD_OFFSET, BITSTREAM_READ);
bitstream_access (&ctx->bitstream_ctx, &ctx->oda, 48);
bitstream_access (&ctx->bitstream_ctx, &ctx->osa, 48);
bitstream_finalise (&ctx->bitstream_ctx);
- /** Read payload length. */
- length = read_u16_from_word(mme + INTERFACE_FCALL_PAYLOAD_OFFSET - sizeof(u16)) + INTERFACE_FCALL_PAYLOAD_OFFSET;
-
- /** Get a buffer. */
- buffer = (*ctx->buffer_get_cb) (ctx->user_data);
+ /** Read payload length (BIG-ENDIAN). */
+ length = swap16(read_u16_from_word(mme + INTERFACE_FCALL_PAYLOAD_OFFSET - sizeof(u16))) + INTERFACE_FCALL_PAYLOAD_OFFSET;
+ diag_printf("interface_fcall_mme_recv: payload length = %d octets\n", length);
+ /** Initialize SCI message with maximum size. */
+ memset(buffer, '\0', SCI_MSG_MAX_SIZE);
if (sci_msg_init(&msg, buffer, SCI_MSG_MAX_SIZE) < 0)
{
dbg_assert_print(false, "sci msg init failed with errno = %d", errno);
return;
}
- if ((int)length != sci_msg_push(&msg, length))
+ if (SCI_MSG_MAX_SIZE != sci_msg_push(&msg, SCI_MSG_MAX_SIZE))
{
dbg_assert_print(false, "sci msg push failed with errno = %d", errno);
return;
}
- bitstream_memcpy(msg.data_begin, mme, length);
+
+ /** Update message length to the received payload length. */
+ msg.length = length;
+
+ /** Copy payload. */
+ bitstream_init (&ctx->bitstream_ctx, mme, length, BITSTREAM_READ);
+ bitstream_access_buf (&ctx->bitstream_ctx, msg.data_begin, length);
+ bitstream_finalise (&ctx->bitstream_ctx);
+ diag_printf("interface_fcall_mme_recv: payload copied @ 0x%08x\n", (uint)msg.data_begin);
+
+ /** Increment message data pointer to the beginning of function call header. */
if (INTERFACE_FCALL_PAYLOAD_OFFSET != sci_msg_pop(&msg, INTERFACE_FCALL_PAYLOAD_OFFSET))
{
dbg_assert_print(false, "sci msg pop failed with errno = %d", errno);
return;
}
+
+ /** Process the received message. */
dbg_assert_ptr(ctx->fcall_ctx);
if ( (NULL != ctx->fcall_ctx)
&& (sci_recv_msg(ctx->fcall_ctx->sci, &msg) < 0) )
@@ -174,6 +194,7 @@ interface_fcall_mme_recv (void *data, u8 *mme)
{
(*ctx->send_done_cb)(ctx->user_data, mme);
}
+ diag_printf("interface_fcall_mme_recv: SEND DONE\n");
}
/**
@@ -187,6 +208,7 @@ interface_fcall_mme_send (void *data, sci_msg_t *msg)
interface_fcall_t *ctx = NULL;
uint field = 0, length = 0;
uint word[2];
+ u8 *buffer = NULL;
dbg_assert_ptr(data);
dbg_assert_ptr(msg);
@@ -199,41 +221,50 @@ interface_fcall_mme_send (void *data, sci_msg_t *msg)
ctx = (interface_fcall_t*)data;
- if (INTERFACE_FCALL_PAYLOAD_OFFSET != sci_msg_push(msg, INTERFACE_FCALL_PAYLOAD_OFFSET))
- {
- dbg_assert_print(false, "sci msg push failed with errno = %d", errno);
- return;
- }
+ /** Get a buffer. */
+ buffer = (*ctx->buffer_get_cb) (ctx->user_data);
+ memset(buffer, '\0', SCI_MSG_MAX_SIZE);
+
+ /** Copy message. */
+ diag_printf("interface_fcall_mme_send: message length = %d octets\n", msg->length);
+ bitstream_init (&ctx->bitstream_ctx, buffer + INTERFACE_FCALL_PAYLOAD_OFFSET, msg->length, BITSTREAM_WRITE);
+ bitstream_access_buf (&ctx->bitstream_ctx, msg->data_begin, msg->length);
+ bitstream_finalise (&ctx->bitstream_ctx);
+ diag_printf("interface_fcall_mme_send: message copied @ 0x%08x\n", (uint)buffer);
// Fill the MME Header.
- bitstream_init (&ctx->bitstream_ctx, msg->data_begin, INTERFACE_FCALL_PAYLOAD_OFFSET, BITSTREAM_WRITE);
+ bitstream_init (&ctx->bitstream_ctx, buffer, INTERFACE_FCALL_PAYLOAD_OFFSET, BITSTREAM_WRITE);
- /* Inserting the ODA and the OSA. */
+ /* Inserting the ODA and the OSA (BIG-ENDIAN). */
bitstream_access (&ctx->bitstream_ctx, &ctx->osa, 48);
bitstream_access (&ctx->bitstream_ctx, &ctx->oda, 48);
- /* Inserting the MTYPE. */
- field = htons(HPAV_MTYPE_MME);
+ /* Inserting the MTYPE (BIG-ENDIAN). */
+ field = swap16(HPAV_MTYPE_MME);
bitstream_access (&ctx->bitstream_ctx, &field, 16);
- /* Inserting the MMV. */
+ /* Inserting the MMV (LITTLE-ENDIAN). */
field = HPAV_MMV;
bitstream_access (&ctx->bitstream_ctx, &field, 8);
- /* Inserting the MMTYPE. */
+ /* Inserting the MMTYPE (LITTLE-ENDIAN). */
field = INTERFACE_FCALL_MMTYPE;
bitstream_access (&ctx->bitstream_ctx, &field, 16);
- /* Inserting the FMI. */
+ /* Inserting the FMI (LITTLE-ENDIAN). */
field = 0;
bitstream_access (&ctx->bitstream_ctx, &field, 16);
- /* Inserting the module type. */
+ /* Inserting the module type (BIG-ENDIAN). */
field = INTERFACE_MODULE_FCALL;
bitstream_access (&ctx->bitstream_ctx, &field, 8);
- /* Inserting the payload length. */
- length = msg->length - INTERFACE_FCALL_PAYLOAD_OFFSET;
+ /* Inserting the padding zero (BIG-ENDIAN). */
+ field = 0;
+ bitstream_access (&ctx->bitstream_ctx, &field, 16);
+
+ /* Inserting the payload length (BIG-ENDIAN). */
+ length = swap16(msg->length);
bitstream_access (&ctx->bitstream_ctx, &length, 16);
bitstream_finalise (&ctx->bitstream_ctx);
@@ -241,8 +272,8 @@ interface_fcall_mme_send (void *data, sci_msg_t *msg)
word[0] = BF_FILL (IPMBOX_REG, (MSG_TYPE, HLE_MSG_TYPE_INTERFACE),
(MSG_LENGTH, 1),
(PARAM_INTERFACE_TYPE, INTERFACE_MODULE_FCALL),
- (PARAM_INTERFACE_LENGTH, msg->length));
- word[1] = (uint)msg->data_begin;
+ (PARAM_INTERFACE_LENGTH, msg->length + INTERFACE_FCALL_PAYLOAD_OFFSET));
+ word[1] = (uint)buffer;
/** Request the interface to send the message to the linux driver. */
dbg_assert_ptr(ctx->send_cb);
@@ -250,4 +281,5 @@ interface_fcall_mme_send (void *data, sci_msg_t *msg)
{
(*ctx->send_cb)(ctx->user_data, word, 2);
}
+ diag_printf("interface_fcall_mme_send: TX\n");
}
diff --git a/cesar/interface/fcall/test/src/test_interface_fcall.c b/cesar/interface/fcall/test/src/test_interface_fcall.c
index e538e6cd96..b6d193a5e1 100644
--- a/cesar/interface/fcall/test/src/test_interface_fcall.c
+++ b/cesar/interface/fcall/test/src/test_interface_fcall.c
@@ -16,7 +16,9 @@
#include "interface/fcall/interface_fcall.h"
#include "interface/fcall/inc/interface_fcall.h"
#include "interface/forward.h"
+#include "lib/swap.h" // for 'swap16()'
#include <stdio.h> // for 'printf'
+#include <malloc.h>
#include <errno.h>
u32 maximus_pending_isrs;
@@ -33,6 +35,7 @@ interface_fcall_send_message_cb (void *user_data, uint *message, uint length)
data = (u8*)(*(message + 1));
dbg_assert_print((0 == memcmp(data + INTERFACE_FCALL_PAYLOAD_OFFSET + sizeof(struct fcall_msg_hdr), test, strlen(test) + 1)),
"registered send function");
+ free(data);
return;
}
@@ -41,13 +44,15 @@ interface_fcall_send_done_message_cb (void *user_data, u8 *message)
{
dbg_assert_ptr(user_data);
dbg_assert_ptr(message);
+ free(message);
return;
}
u8 *
-interface_fcall_buffer_get (void *user_data)
+interface_fcall_buffer_get_cb (void *user_data)
{
- return NULL;
+ u8 *buffer = malloc(SCI_MSG_MAX_SIZE);
+ return buffer;
}
int host_fcall_test (fcall_ctx_t *fcall, fcall_param_t **param, sci_msg_t **msg, void *data)
@@ -69,7 +74,7 @@ interface_fcall_init_test_case(test_t t)
test_fail_unless(
(NULL == interface_fcall_init(NULL,
&interface_fcall_send_done_message_cb,
- &interface_fcall_buffer_get,
+ &interface_fcall_buffer_get_cb,
(void*)&user_data))
);
}
@@ -87,7 +92,7 @@ interface_fcall_init_test_case(test_t t)
test_fail_unless(
(NULL == interface_fcall_init(interface_fcall_send_message_cb,
NULL,
- &interface_fcall_buffer_get,
+ &interface_fcall_buffer_get_cb,
(void*)&user_data))
);
}
@@ -98,6 +103,24 @@ interface_fcall_init_test_case(test_t t)
dbg_fatal_try_end;
} test_end;
+ test_begin(t, "NULL buffer get cb")
+ {
+ dbg_fatal_try_begin
+ {
+ test_fail_unless(
+ (NULL == interface_fcall_init(interface_fcall_send_message_cb,
+ &interface_fcall_send_done_message_cb,
+ NULL,
+ (void*)&user_data))
+ );
+ }
+ dbg_fatal_try_catch (const char *fatal_message)
+ {
+ printf("init with NULL buffer get cb\n%s\n", fatal_message);
+ }
+ dbg_fatal_try_end;
+ } test_end;
+
test_begin(t, "NULL user data")
{
dbg_fatal_try_begin
@@ -105,8 +128,8 @@ interface_fcall_init_test_case(test_t t)
test_fail_unless(
(NULL == interface_fcall_init(&interface_fcall_send_message_cb,
&interface_fcall_send_done_message_cb,
- &interface_fcall_buffer_get,
- NULL))
+ &interface_fcall_buffer_get_cb,
+ NULL))
);
}
dbg_fatal_try_catch (const char *fatal_message)
@@ -120,7 +143,7 @@ interface_fcall_init_test_case(test_t t)
{
ctx = interface_fcall_init(&interface_fcall_send_message_cb,
&interface_fcall_send_done_message_cb,
- &interface_fcall_buffer_get,
+ &interface_fcall_buffer_get_cb,
(void*)&user_data);
test_fail_unless(
(NULL != ctx)
@@ -129,6 +152,7 @@ interface_fcall_init_test_case(test_t t)
&& (ctx->probe_ctx != NULL)
&& (ctx->send_cb == &interface_fcall_send_message_cb)
&& (ctx->send_done_cb == &interface_fcall_send_done_message_cb)
+ && (ctx->buffer_get_cb == &interface_fcall_buffer_get_cb)
&& (ctx->user_data == &user_data)
);
} test_end;
@@ -137,11 +161,8 @@ interface_fcall_init_test_case(test_t t)
void
interface_fcall_mme_recv_test_case(test_t t)
{
- u8 mme[SCI_MSG_MAX_SIZE];
- u8 buffer[SCI_MSG_MAX_SIZE];
struct fcall_msg_hdr fcall_hdr;
- memset(mme, '\0', SCI_MSG_MAX_SIZE);
- memset(buffer, '\0', SCI_MSG_MAX_SIZE);
+ u8 *mme = malloc(SCI_MSG_MAX_SIZE);
test_case_begin(t, "mme recv");
@@ -171,22 +192,9 @@ interface_fcall_mme_recv_test_case(test_t t)
dbg_fatal_try_end;
} test_end;
- test_begin(t, "NULL buffer")
- {
- dbg_fatal_try_begin
- {
- interface_fcall_mme_recv (ctx, mme);
- }
- dbg_fatal_try_catch (const char *fatal_message)
- {
- printf("mme recv with NULL buffer\n%s\n", fatal_message);
- }
- dbg_fatal_try_end;
- } test_end;
-
test_begin(t, "check mme recv")
{
- u16 length = sizeof(struct fcall_msg_hdr) + strlen(test) + 1;
+ u16 length = swap16(sizeof(struct fcall_msg_hdr) + strlen(test) + 1);
fcall_register(ctx->fcall_ctx, test, (void*)&host_fcall_test, NULL);
memset(&fcall_hdr, '\0', sizeof(fcall_hdr));
fcall_hdr.version = FUNCTION_CALL_VERSION;
diff --git a/cesar/interface/src/interface.c b/cesar/interface/src/interface.c
index 9570ece135..0b4683522d 100644
--- a/cesar/interface/src/interface.c
+++ b/cesar/interface/src/interface.c
@@ -24,6 +24,9 @@
#include "interface/inc/context.h"
#include "interface/inc/mme_process.h"
+#include "interface/fcall/inc/context.h"
+#include "interface/fcall/inc/interface_fcall.h"
+
static interface_t interface_global;
/**
@@ -439,6 +442,10 @@ interface_process (cyg_addrword_t data)
case INTERFACE_MODULE_SNIFFER:
interface_sniffer_configure_and_respond (ctx, buffer);
break;
+ }
+ case INTERFACE_FCALL_MMTYPE:
+ switch (interface_moduleid_get (buffer))
+ {
case INTERFACE_MODULE_FCALL:
interface_fcall_mme_recv (ctx->fcall, buffer);
break;
diff --git a/cesar/maximus/prototest/fcall/src/test_fcall.c b/cesar/maximus/prototest/fcall/src/test_fcall.c
index d7a9290342..b346b9dabb 100644
--- a/cesar/maximus/prototest/fcall/src/test_fcall.c
+++ b/cesar/maximus/prototest/fcall/src/test_fcall.c
@@ -14,11 +14,13 @@
*/
#include <cyg/infra/diag.h>
#include <cyg/kernel/kapi.h>
+#include <malloc.h>
#include <errno.h>
#include "common/std.h"
#include "interface/fcall/interface_fcall.h"
#include "interface/fcall/inc/interface_fcall.h"
#include "lib/read_word.h"
+#include "lib/swap.h" // for 'swap16()'
#include "maximus/prototest/fcall/inc/syscall.h"
#define MY_THREAD_STACK_SIZE (8192 / sizeof(int))
@@ -33,21 +35,19 @@ int proto_in_fd = -1, proto_out_fd = -1;
void my_thread(cyg_addrword_t index)
{
- static u8 my_mme[SCI_MSG_MAX_SIZE];
- static u8 my_buffer[SCI_MSG_MAX_SIZE];
int len = 0, data_length = 0;
+ u8 *my_mme;
diag_write_string("=> my_thread\n");
while(1)
{
- memset(my_mme, 0x00, SCI_MSG_MAX_SIZE);
- memset(my_buffer, 0x00, SCI_MSG_MAX_SIZE);
+ my_mme = malloc(SCI_MSG_MAX_SIZE);
while (INTERFACE_FCALL_PAYLOAD_OFFSET != len)
{
len = read(proto_in_fd, my_mme, INTERFACE_FCALL_PAYLOAD_OFFSET);
}
dbg_assert(INTERFACE_FCALL_PAYLOAD_OFFSET == len);
- data_length = read_u16_from_word(my_mme + INTERFACE_FCALL_PAYLOAD_OFFSET - sizeof(u16));
+ data_length = swap16(read_u16_from_word(my_mme + INTERFACE_FCALL_PAYLOAD_OFFSET - sizeof(u16)));
if ((len = read(proto_in_fd, my_mme + INTERFACE_FCALL_PAYLOAD_OFFSET, data_length)) < 0)
{
diag_write_string("error when reading proto in file\n");
@@ -56,7 +56,7 @@ void my_thread(cyg_addrword_t index)
diag_printf("READ len = %d - data length = %d\n", len, data_length);
dbg_assert(len == data_length);
diag_write_string("=> interface_fcall_mme_recv\n");
- interface_fcall_mme_recv (ctx, my_mme, my_buffer);
+ interface_fcall_mme_recv (ctx, my_mme);
}
}
@@ -82,6 +82,7 @@ my_interface_hle_send (void *user_data, uint *message, uint length)
diag_printf("WRITE len = %d - data length = %d\n", len, data_length);
diag_write_string("END interface_hle_send\n");
+ free(data);
return;
}
@@ -92,10 +93,20 @@ my_interface_hle_send_done (void *user_data, u8 *message)
dbg_assert_ptr(message);
diag_write_string("=> interface_hle_send_done\n");
+ free(message);
+ diag_write_string("END interface_hle_send_done\n");
return;
}
+u8 *
+my_interface_fcall_get_buffer_cb (void *user_data)
+{
+ u8 *buffer;
+ buffer = malloc(SCI_MSG_MAX_SIZE);
+ return buffer;
+}
+
typedef struct my_struct
{
int i1;
@@ -288,6 +299,7 @@ cyg_user_start(void)
int user_data = 123;
ctx = interface_fcall_init (&my_interface_hle_send,
&my_interface_hle_send_done,
+ &my_interface_fcall_get_buffer_cb,
&user_data);
fcall_register(ctx->fcall_ctx, "function_1", (void*)&my_function1, NULL);
diff --git a/cesar/maximus/prototest/integration/Makefile b/cesar/maximus/prototest/integration/Makefile
index f11e373035..91d16e46ef 100644
--- a/cesar/maximus/prototest/integration/Makefile
+++ b/cesar/maximus/prototest/integration/Makefile
@@ -8,7 +8,7 @@ EXTRA_TARGET_CFLAGS+= -DFCALL_PROTO
TARGET_PROGRAMS = test_integration
-test_integration_SOURCES = test_integration.c
-test_integration_MODULES = lib hal/phy interface interface/fcall hal/hle hle mac cl
+test_integration_SOURCES = test_integration.c cl_stub.c
+test_integration_MODULES = lib hal/phy interface interface/fcall hal/hle hle mac
include $(BASE)/common/make/top.mk \ No newline at end of file
diff --git a/cesar/maximus/prototest/integration/src/cl_stub.c b/cesar/maximus/prototest/integration/src/cl_stub.c
new file mode 100644
index 0000000000..9b65288d2f
--- /dev/null
+++ b/cesar/maximus/prototest/integration/src/cl_stub.c
@@ -0,0 +1,112 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cl_stub.c
+ * \brief cl stub for integration test program
+ * \ingroup maximus/prototest/integration
+ *
+ *
+ */
+#include "common/std.h"
+#include "cl/cl.h"
+#include "cl/inc/cl.h"
+#include <stdlib.h>
+
+static cl_t cl_global;
+
+cl_t *cl_init (mac_store_t *mac_store, sar_t *sar, mac_config_t *mac_config)
+{
+ return &cl_global;
+}
+
+void cl_uninit (cl_t *ctx)
+{
+}
+
+void cl_mme_ul_init_send_done (cl_t *ctx, cl_mme_ul_recv_done_cb_t cb,
+ void *user)
+{
+ dbg_assert (ctx);
+ dbg_assert (cb);
+
+ ctx->mme.ul_mme_recv_done = cb;
+ ctx->mme.ul_mme_recv_done_user_data = user;
+}
+
+void cl_mme_recv_init (cl_t *ctx, cl_mme_recv_cb_t mme_recv_cb, void *user)
+{
+}
+
+void cl_mme_init_ul_as_data (cl_t *ctx, cl_mme_ul_send_done_cb_t cb,
+ void *user)
+{
+}
+
+void cl_mme_init_buffer_add_cb (cl_t *cl, cl_mme_buffer_add_cb_t cb,
+ void *user_data)
+{
+}
+
+
+void cl_mme_send_as_mme (cl_t *ctx, u8 *buffer, uint length, mfs_tx_t *mfs)
+{
+}
+
+void cl_mme_send_as_data (cl_t *ctx, u8 *buffer, uint length)
+{
+}
+
+void cl_mme_sar_send_done (cl_t *ctx, u8 *buffer)
+{
+}
+
+void cl_mme_recv (cl_t *ctx, u8 *buffer, uint length, mfs_rx_t *mfs, bool
+ encryption)
+{
+}
+
+void cl_mme_recv_done (cl_t *ctx, cl_mme_recv_t *mme_recv)
+{
+}
+
+void cl_data_send_done_init (cl_t *cl, cl_data_send_done_cb_t cb, void *user)
+{
+ dbg_assert (cl);
+ dbg_assert (cb);
+
+ cl->data_tx.cb = cb;
+ cl->data_tx.user = user;
+}
+
+void cl_data_send_done (cl_t *ctx, u8 *buffer)
+{
+}
+
+void cl_data_send (cl_t *cl, u8 *buffer, uint length)
+{
+ dbg_assert (cl);
+ dbg_assert (buffer);
+}
+
+void cl_data_recv_init (cl_t *cl, cl_data_recv_cb_t cb, void *user)
+{
+ dbg_assert (cl);
+ dbg_assert (cb);
+}
+
+void cl_data_recv (cl_t *ctx, u8 *buffer, uint length, mfs_rx_t *mfs)
+{
+}
+
+void cl_mme_buffer_add (cl_t *cl, u8 *buffer)
+{
+}
+
+void cl_data_buffer_add (cl_t *cl, u8 *buffer)
+{
+}
diff --git a/cesar/maximus/prototest/integration/src/test_integration.c b/cesar/maximus/prototest/integration/src/test_integration.c
index 033358ed0f..62dcf11c57 100644
--- a/cesar/maximus/prototest/integration/src/test_integration.c
+++ b/cesar/maximus/prototest/integration/src/test_integration.c
@@ -67,6 +67,7 @@ my_return_function (void *data)
/* now make the return parameter list */
fcall_param_reset(&return_param);
+ //my_param4 = (swap32((u32)(my_param4 >> 32)) << 32) | swap32((u32)my_param4);
fcall_param_add(&return_param, &return_msg, "result_2", sizeof(my_type_t), &my_param4);
fcall_return(interface_ctx->fcall->fcall_ctx, &return_param, &return_msg);
@@ -87,7 +88,15 @@ my_function1 (fcall_ctx_t *fcall, fcall_param_t **param, sci_msg_t **msg, void *
fcall_param_bind(*param, *msg, "param_2", 10*sizeof(int), my_param2);
fcall_param_bind(*param, *msg, "param_3", 6, (char*)my_param3);
fcall_param_bind(*param, *msg, "param_4", sizeof(my_type_t), &my_param4);
-
+/*
+ my_param1.i1 = swap32(my_param1.i1);
+ my_param1.i2 = swap32(my_param1.i2);
+ for (i=0; i<10; i++)
+ {
+ my_param2[i] = swap32(my_param2[i]);
+ }
+ my_param4 = (swap32((u32)(my_param4 >> 32)) << 32) | swap32((u32)my_param4);
+*/
/* do other tasks ... */
diag_write_string("=> my_function1\n");
diag_printf("param 1 . i1 = %d\n", my_param1.i1);
@@ -215,16 +224,52 @@ my_function5 (fcall_ctx_t *fcall, fcall_param_t **param, sci_msg_t **msg, void *
return 0;
}
+/**
+* CP receives a new MME.
+* \param user_data the data registered by the actor in the init function
+* \param mfs the mfs
+* \param buffer the buffer containing the MME
+* \param length the MME length
+* \param mme_recv data use by the data plane
+* \param encryption inform if the packet comes from the PWL if it had been crypted or not
+*/
+void
+cp_mme_recv (void *user_data,
+ mfs_rx_t *mfs,
+ u8 *buffer,
+ uint length,
+ void *mme_recv,
+ bool encryption)
+{
+ interface_mme_recv_done (interface_ctx, mme_recv);
+}
+
+/**
+* CP receives a empty buffer.
+* \param user_data the data registered by the actor in the init function
+* \param buffer the buffer to add
+*/
+void
+cp_mme_buffer_add (void *user_data, u8 *buffer)
+{
+ /* nothing to do */
+}
+
void
cyg_user_start(void)
{
hle_ctx = hle_init (&cl_ctx);
-
interface_ctx = interface_init (hle_ctx,
&cl_ctx,
&sar_ctx,
&mac_config_ctx);
+ /* stub the interface communication with the CP */
+ interface_callback_init (interface_ctx,
+ cp_mme_recv,
+ cp_mme_buffer_add,
+ NULL);
+
ipmbox_activate(NULL, true);
fcall_register(interface_ctx->fcall->fcall_ctx, "function_1", (void*)&my_function1, NULL);
diff --git a/cesar/maximus/python/lib/proto/fcall.py b/cesar/maximus/python/lib/proto/fcall.py
index 0921e1025a..b88ca93067 100644
--- a/cesar/maximus/python/lib/proto/fcall.py
+++ b/cesar/maximus/python/lib/proto/fcall.py
@@ -31,7 +31,7 @@ SIZE_OF_TYPE = SIZE_OF_U16 # in octets
SIZE_OF_MMV = 1 # in octets
SIZE_OF_MMTYPE = 2 # in octets
SIZE_OF_FMI = 2 # in octets
-INTERFACE_FCALL_PAYLOAD_OFFSET = 22 # in octets
+INTERFACE_FCALL_PAYLOAD_OFFSET = 24 # in octets (ALIGNED)
# For unitary test purpose
FUNCTION_CALL_WRITE_FILE = "/tmp/proto_in"
@@ -41,7 +41,7 @@ class Param:
def __init__(self, name, length, value):
self.__name = name
- self.__length = htohp16(length)
+ self.__length = hton16(length)
self.__value = value
def get_name(self):
@@ -61,6 +61,7 @@ class Fcall:
# Static attributes of the class
__msg_id = 1
cb_dict = {}
+ rsp_list = []
def __init__(self, name, maximus):
self.__name = name
@@ -83,39 +84,39 @@ class Fcall:
return self
def add_param_bool(self, name, value):
- self.__param_list.append(Param(name, SIZE_OF_U8, htohp8(value)))
+ self.__param_list.append(Param(name, SIZE_OF_U8, hton8(value)))
return self
def add_param_uchar(self, name, value):
- self.__param_list.append(Param(name, SIZE_OF_U8, htohp8(value)))
+ self.__param_list.append(Param(name, SIZE_OF_U8, hton8(value)))
return self
def add_param_ushort(self, name, value):
- self.__param_list.append(Param(name, SIZE_OF_U16, htohp16(value)))
+ self.__param_list.append(Param(name, SIZE_OF_U16, hton16(value)))
return self
def add_param_ulong(self, name, value):
- self.__param_list.append(Param(name, SIZE_OF_U32, htohp32(value)))
+ self.__param_list.append(Param(name, SIZE_OF_U32, hton32(value)))
return self
def add_param_n_u8(self, name, tuple):
value = ''
for t in tuple:
- value += htohp8(t)
+ value += hton8(t)
self.__param_list.append(Param(name, SIZE_OF_U8 * len(value), value))
return self
def add_param_n_u16(self, name, tuple):
value = ''
for t in tuple:
- value += htohp16(t)
+ value += hton16(t)
self.__param_list.append(Param(name, SIZE_OF_U16 * len(value), value))
return self
def add_param_n_u32(self, name, tuple):
value = ''
for t in tuple:
- value += htohp32(t)
+ value += hton32(t)
self.__param_list.append(Param(name, SIZE_OF_U32 * len(value), value))
return self
@@ -184,7 +185,7 @@ class Fcall:
param = None
for l in self.__param_list:
if l.get_name() == name:
- param = hptoh8(l.get_value())
+ param = ntoh8(l.get_value())
break
return param
@@ -192,7 +193,7 @@ class Fcall:
param = None
for l in self.__param_list:
if l.get_name() == name:
- param = hptoh16(l.get_value())
+ param = ntoh16(l.get_value())
break
return param
@@ -200,7 +201,9 @@ class Fcall:
param = None
for l in self.__param_list:
if l.get_name() == name:
- param = hptoh32(l.get_value())
+ print "len =", len(l.get_value())
+ print "value =", l.get_value()
+ param = ntoh32(l.get_value())
break
return param
@@ -210,7 +213,7 @@ class Fcall:
if l.get_name() == name:
param = ()
for i in range (0, len(l.get_value()), SIZE_OF_U8):
- param += hptoh8(l.get_value()[i:i+SIZE_OF_U8]),
+ param += ntoh8(l.get_value()[i:i+SIZE_OF_U8]),
break
return param
@@ -220,7 +223,7 @@ class Fcall:
if l.get_name() == name:
param = ()
for i in range (0, len(l.get_value()), SIZE_OF_U16):
- param += hptoh16(l.get_value()[i:i+SIZE_OF_U16]),
+ param += ntoh16(l.get_value()[i:i+SIZE_OF_U16]),
break
return param
@@ -230,21 +233,21 @@ class Fcall:
if l.get_name() == name:
param = ()
for i in range (0, len(l.get_value()), SIZE_OF_U32):
- param += hptoh32(l.get_value()[i:i+SIZE_OF_U32]),
+ param += ntoh32(l.get_value()[i:i+SIZE_OF_U32]),
break
return param
def __get(self):
- """Return the complete MM Entry into a string.
+ """Return the complete MM Entry (BIG-ENDIAN) into a string.
"""
- # FCALL data
+ # FCALL data (BIG-ENDIAN)
#
fcall_data = self.__name + '\0'
for l in self.__param_list:
fcall_data += l.get()
- # FCALL header
+ # FCALL header (BIG-ENDIAN)
#
# uint8_t version
# uint8_t type
@@ -253,19 +256,20 @@ class Fcall:
# uint8_t flags
# uint16_t reserved
#
- fcall_hdr = htohp8(FUNCTION_CALL_VERSION)\
- + htohp8(FUNCTION_CALL_TYPE_REQ)\
- + htohp16(self.__msg_id)\
- + htohp8(len(self.__param_list))\
- + htohp8(0)\
- + htohp16(0)
+ fcall_hdr = hton8(FUNCTION_CALL_VERSION)\
+ + hton8(FUNCTION_CALL_TYPE_REQ)\
+ + hton16(self.__msg_id)\
+ + hton8(len(self.__param_list))\
+ + hton8(0)\
+ + hton16(0)
- # MM Entry
+ # MM Entry (BIG-ENDIAN)
#
# Interface sub-module (1 octet)
+ # Padding zero (2 octets)
# Payload length (2 octets)
#
- mmentry = htohp8(INTERFACE_MODULE_FCALL) + htohp16(len(fcall_hdr + fcall_data))
+ mmentry = hton8(INTERFACE_MODULE_FCALL) + hton16(0) + hton16(len(fcall_hdr + fcall_data))
return mmentry + fcall_hdr + fcall_data
@@ -274,7 +278,9 @@ class Fcall:
"""
mme = Ether()
- # Set the MM Header and the MM Entry
+ # Set the Ethernet Header (BIG-ENDIAN), the MM Header (LITTLE-ENDIAN) and the MM Entry (BIG-ENDIAN)
+
+ # Ethernet Header (BIG-ENDIAN)
#
# ODA
mme.dst = self.__sta.mac_address
@@ -282,6 +288,9 @@ class Fcall:
mme.src = self.__maximus.mac_address
# MTYPE
mme.type = HPAV_MTYPE_MME
+
+ # MM Header (LITTLE-ENDIAN)
+ #
# MMV (1 octet)
# MMTYPE (2 octets)
# FMI (2 octets)
@@ -302,12 +311,15 @@ def display(mme):
# In case of unitary test
except:
+ # Ethernet Header (BIG-ENDIAN)
begin = 0
end = 0
print "MM Header:"
print "ODA =", mme.dst
print "OSA =", mme.src
print "MTYPE =", hex(mme.type)
+
+ # MM Header (LITTLE-ENDIAN)
end = SIZE_OF_MMV
print "MMV =", hex(hptoh8(mme.payload.load[begin:end]))
begin = end
@@ -317,38 +329,42 @@ def display(mme):
end += SIZE_OF_FMI
print "FMI =", hex(hptoh16(mme.payload.load[begin:end]))
+ # MM Entry (BIG-ENDIAN)
print "MM Entry:"
begin = end
end += SIZE_OF_U8
- print "Module =", hex(hptoh8(mme.payload.load[begin:end]))
+ print "Module =", hex(ntoh8(mme.payload.load[begin:end]))
begin = end
end += SIZE_OF_U16
- print "Length =", hptoh16(mme.payload.load[begin:end]), "(" + hex(hptoh16(mme.payload.load[begin:end])) + ")"
+ print "Padding =", hex(ntoh16(mme.payload.load[begin:end]))
+ begin = end
+ end += SIZE_OF_U16
+ print "Length =", ntoh16(mme.payload.load[begin:end]), "(" + hex(ntoh16(mme.payload.load[begin:end])) + ")"
print "Fcall Header:"
begin = end
end += SIZE_OF_U8
- print "version =", hex(hptoh8(mme.payload.load[begin:end]))
+ print "version =", hex(ntoh8(mme.payload.load[begin:end]))
begin = end
end += SIZE_OF_U8
- print "type =", hex(hptoh8(mme.payload.load[begin:end]))
+ print "type =", hex(ntoh8(mme.payload.load[begin:end]))
begin = end
end += SIZE_OF_U16
- print "msg id =", hex(hptoh16(mme.payload.load[begin:end]))
+ print "msg id =", hex(ntoh16(mme.payload.load[begin:end]))
begin = end
end += SIZE_OF_U8
- print "param nb =", hex(hptoh8(mme.payload.load[begin:end]))
+ print "param nb =", hex(ntoh8(mme.payload.load[begin:end]))
begin = end
end += SIZE_OF_U8
- print "flags =", hex(hptoh8(mme.payload.load[begin:end]))
+ print "flags =", hex(ntoh8(mme.payload.load[begin:end]))
begin = end
end += SIZE_OF_U16
- print "reserved =", hex(hptoh16(mme.payload.load[begin:end]))
+ print "reserved =", hex(ntoh16(mme.payload.load[begin:end]))
print "Fcall Payload:"
print "payload =",
for i in range(16, len(mme.payload.load)):
- print hex(hptoh8(mme.payload.load[i])),
+ print hex(ntoh8(mme.payload.load[i])),
print
def read_name(data):
@@ -362,7 +378,6 @@ def read_param_name(data):
return read_name(data)
def read_param_length(data):
- #return hptoh16(data[:SIZE_OF_U16])
return ntoh16(data[:SIZE_OF_U16])
def read_param_value(data, length):
@@ -370,7 +385,9 @@ def read_param_value(data, length):
def read(mme, maximus):
- # MM Header
+ print "Reading the received MME..."
+
+ # Ethernet Header (BIG-ENDIAN)
#
# ODA: Original Destination Address (DEFAULT_MAC_ADDRESS) - 6 octets
@@ -398,6 +415,9 @@ def read(mme, maximus):
if maximus.UNIT_TEST:
mme.payload.load = mme.payload.load[SIZE_OF_DST+SIZE_OF_SRC+SIZE_OF_TYPE:]
+ # MM Header (LITTLE-ENDIAN)
+ #
+
# MMV: Management Message Version (0x01) - 1 octet
begin = 0
end = SIZE_OF_MMV
@@ -419,20 +439,24 @@ def read(mme, maximus):
display(mme)
raise Error("MM Header: bad FMI! (" + hex(hptoh16(mme.payload.load[begin:end])) + ")")
- # MM ENTRY
+ # MM Entry (BIG-ENDIAN)
#
# Module: Interface fcall sub-module (0x02) - 1 octet
begin = end
end += SIZE_OF_U8
- if hptoh8(mme.payload.load[begin:end]) != INTERFACE_MODULE_FCALL:
+ if ntoh8(mme.payload.load[begin:end]) != INTERFACE_MODULE_FCALL:
display(mme)
- raise Error("MM Header: bad Module! (" + hex(hptoh8(mme.payload.load[begin:end])) + ")")
+ raise Error("MM Header: bad Module! (" + hex(ntoh8(mme.payload.load[begin:end])) + ")")
+
+ # Padding: Pad zero for INTERFACE_FCALL_PAYLOAD_OFFSET alignement (0x0000) - 2 octets
+ begin = end
+ end += SIZE_OF_U16
# Length: Payload length (0 to 1492) - 2 octets
begin = end
end += SIZE_OF_U16
- length = hptoh16(mme.payload.load[begin:end])
+ length = ntoh16(mme.payload.load[begin:end])
# FCALL header
#
@@ -451,18 +475,17 @@ def read(mme, maximus):
begin = end
end += SIZE_OF_FUNCTION_CALL_HEADER
fcall_hdr = mme.payload.load[begin:end]
- if hptoh8(fcall_hdr[0]) != FUNCTION_CALL_VERSION: # uint8_t version
+ if ntoh8(fcall_hdr[0]) != FUNCTION_CALL_VERSION: # uint8_t version
display(mme)
- raise Error("FCALL header: bad version! (" + hex(hptoh8(fcall_hdr[0])) + ")")
- if hptoh8(fcall_hdr[1]) != FUNCTION_CALL_TYPE_RSP: # uint8_t type
+ raise Error("FCALL header: bad version! (" + hex(ntoh8(fcall_hdr[0])) + ")")
+ if ntoh8(fcall_hdr[1]) != FUNCTION_CALL_TYPE_RSP: # uint8_t type
display(mme)
- raise Error("FCALL header: bad type! (" + hex(hptoh8(fcall_hdr[1])) + ")")
- #msg_id = hptoh16(fcall_hdr[2:4])
+ raise Error("FCALL header: bad type! (" + hex(ntoh8(fcall_hdr[1])) + ")")
msg_id = ntoh16(fcall_hdr[2:4])
- param_nb = hptoh8(fcall_hdr[4]) # uint8_t param_nb
- if hptoh8(fcall_hdr[5]) >= FUNCTION_CALL_FLAG_FAILED: # uint8_t flags
+ param_nb = ntoh8(fcall_hdr[4]) # uint8_t param_nb
+ if ntoh8(fcall_hdr[5]) >= FUNCTION_CALL_FLAG_FAILED: # uint8_t flags
display(mme)
- raise Error("FCALL header: flag failed! (" + hex(hptoh8(fcall_hdr[5])) + ")")
+ raise Error("FCALL header: flag failed! (" + hex(ntoh8(fcall_hdr[5])) + ")")
# FCALL payload: function SCI message data
#
@@ -493,8 +516,10 @@ def read(mme, maximus):
raise Error("length = " + str(length))
# Callback
+ print "Number of expected responses:", len(fcall.__class__.cb_dict)
if fcall.__class__.cb_dict.has_key(msg_id):
fcall.__class__.cb_dict[msg_id](fcall)
del fcall.__class__.cb_dict[msg_id]
+ print "Updated number of expected responses:", len(fcall.__class__.cb_dict)
return fcall
diff --git a/cesar/maximus/python/lib/proto/maximus_proto.py b/cesar/maximus/python/lib/proto/maximus_proto.py
index c04a9f64c7..79cf9326d9 100644
--- a/cesar/maximus/python/lib/proto/maximus_proto.py
+++ b/cesar/maximus/python/lib/proto/maximus_proto.py
@@ -33,6 +33,37 @@ class Proto(threading.Thread):
print "Stopping proto..."
os.system("killall " + self.__proto)
+class Sniff(threading.Thread):
+
+ def __init__(self, network_interface, mac_address):
+
+ # Initialize thread
+ threading.Thread.__init__(self)
+
+ # Initialize the network interface to sniff
+ self.__network_interface = network_interface
+
+ # Initialize the destination mac address to filter
+ self.__mac_address = mac_address
+
+ # Create a FCALL to have access to the list of received MMEs
+ self.fcall = Fcall("fcall", self)
+
+ def run(self):
+ print "Starting sniff..."
+
+ while True:
+ # Sniff until a MME is received
+ mme = sniff(iface=self.__network_interface, lfilter=lambda x: x.type == HPAV_MTYPE_MME and x.dst == self.__mac_address, count=1)[0]
+
+ # When a MME is received, copy it into the list of received MMEs
+ # (the received MME will be processed later)
+ print "Receiving an MME..."
+ self.fcall.__class__.rsp_list.append(mme)
+
+ def stop(self):
+ print "Stopping sniff..."
+
class MaximusProto:
def __init__(self):
@@ -54,6 +85,9 @@ class MaximusProto:
# Set default network interface to "br0"
self.network_interface = "br0"
+ # Thread
+ self.background = None
+
# For unitary test purpose
self.UNIT_TEST = False
@@ -70,7 +104,7 @@ class MaximusProto:
self.__max_time_value = self.__start_time_value + (float(argv[i+1])/float(25000000)) # in seconds
elif argv[i] == '-a' or argv[i] == '--mac-address':
if i+1 < len(argv):
- self.mac_address = argv[i+1]
+ self.mac_address = argv[i+1].lower()
elif argv[i] == '-n' or argv[i] == '--network-interface':
if i+1 < len(argv):
self.network_interface = argv[i+1]
@@ -90,6 +124,12 @@ class MaximusProto:
print "Configuration:"
print "mac address =", self.mac_address
print "network interface =", self.network_interface
+
+ # Launch the sniff thread
+ if not self.UNIT_TEST:
+ self.background = Sniff(self.network_interface, self.mac_address)
+ self.background.start()
+ sleep(1)
def process(self):
"""Listen to network interface.
@@ -106,10 +146,17 @@ class MaximusProto:
exit(1)
if not self.UNIT_TEST:
- mme = sniff(iface=self.network_interface, count=1, timeout=time_value)
- if len(mme) != 0:
- mme = mme[0]
- mmtype = ntoh16(str(mme[MMTYPE_OFFSET:MMTYPE_OFFSET + SIZE_OF_MMTYPE]))
+ # Create a FCALL to have access to the list of received MMEs
+ fcall = Fcall("fcall", self)
+
+ # If a MME FCALL has been received, read it
+ if len(fcall.__class__.rsp_list) != 0:
+ print "Number of received MME(s):", len(fcall.__class__.rsp_list)
+ mme = fcall.__class__.rsp_list.pop(0)
+
+ # Read the MMTYPE (LITTLE-ENDIAN)
+ mmtype = hptoh16(mme.payload.load[SIZE_OF_MMV:SIZE_OF_MMV+SIZE_OF_MMTYPE])
+
if mmtype == INTERFACE_FCALL_MMTYPE:
return read(mme, self)
@@ -120,7 +167,10 @@ class MaximusProto:
mme = Struct()
mme.payload = Struct()
mme.payload.load = os.read(self.read_file, INTERFACE_FCALL_PAYLOAD_OFFSET)
- length = hptoh16(mme.payload.load[INTERFACE_FCALL_PAYLOAD_OFFSET-SIZE_OF_U16:INTERFACE_FCALL_PAYLOAD_OFFSET])
+
+ # Read the payload length (BIG-ENDIAN)
+ length = ntoh16(mme.payload.load[INTERFACE_FCALL_PAYLOAD_OFFSET-SIZE_OF_U16:INTERFACE_FCALL_PAYLOAD_OFFSET])
+
mme.payload.load += os.read(self.read_file, length)
return read(mme, self)
diff --git a/cesar/maximus/python/py/test_proto.py b/cesar/maximus/python/py/test_proto.py
new file mode 100644
index 0000000000..219248cbcc
--- /dev/null
+++ b/cesar/maximus/python/py/test_proto.py
@@ -0,0 +1,149 @@
+#! usr/bin/env python
+
+print "\n*** " + __file__ + " ***\n"
+
+import sys
+sys.path.append('./test')
+sys.path.append('../test')
+import startup
+
+
+# PROTO TEST
+# To be run on proto with following command line arguments:
+# python py/test_proto.py -n tap0 -a xx:xx:xx:xx:xx:xx
+
+from maximus_proto import *
+
+def my_cb (msg):
+ print "=>",my_cb.func_name
+ if msg.is_param("result_2"):
+ result2 = unpack('q',msg.bind_param("result_2"))
+ print "RESULT: result 2 =",result2[0]
+ receive_fc1_rsp = True
+
+# Instantiate a Maximus Proto object and initialize it.
+maximus = MaximusProto()
+maximus.init(sys.argv)
+
+# Create three stations.
+stationA = maximus.create_sta("aa:aa:aa:aa:aa:aa")
+stationB = maximus.create_sta("bb:bb:bb:bb:bb:bb")
+stationC = maximus.create_sta("cc:cc:cc:cc:cc:cc")
+
+# Launch a debugger attached to station B.
+try:
+ stationB.debug()
+except:
+ pass
+
+# Send an asynchronous function message to station A.
+#
+
+# Create a function message and set the name of the function to call of station A.
+fc1 = maximus.create_fcall("function_1")
+
+# Add a first parameter to the created message.
+param1 = pack('iiB',1,2,True)
+fc1.add_param("param_1", param1)
+
+# Add a second parameter to the created message.
+param2 = pack('iiiiiiiiii',0,1,2,3,4,5,6,7,8,9)
+fc1.add_param("param_2", param2)
+
+# Add a third parameter to the created message.
+param3 = "hello\0"
+fc1.add_param("param_3", param3)
+
+# Add a fourth parameter to the created message.
+param4 = pack('q',123)
+fc1.add_param("param_4", param4)
+
+# Register a callback function which will be called at message response reception.
+fc1.set_cb(my_cb)
+
+# Set destination station of message 1.
+fc1.set_sta(stationA)
+
+# Send the configured message in an asynchronous mode.
+receive_fc1_rsp = False
+fc1.send_async()
+
+
+
+# TO REMOVE
+maximus.wait()
+
+
+
+# Send a synchronous function message to station B.
+
+# Create a function message and set the name of the function to call into station B.
+fc2 = maximus.create_fcall("function_2")
+
+# Add a first parameter to the created message.
+fc2.add_param_bool("param_5", True)
+
+# Send the configured message to station B in a synchronous mode.
+fc2.send(stationB)
+
+# Get the function result.
+result1 = fc2.bind_param_string("result_1")
+print "RESULT: result1 =",result1
+
+# Set a parameter value of station B.
+probe1 = maximus.create_probe()
+param6 = 789
+probe1.add_param_ulong("param_6", param6)
+probe1.send(stationB)
+
+# Get a parameter value from station B.
+probe2 = maximus.create_probe().add_param("param_7")
+probe2.send(stationB)
+#param7 = probe2.bind_param_ulong("param_7")
+#print "RESULT: param 7 =",param7
+
+# Get the same parameter value from station C, re-using existing message.
+probe2.send(stationC)
+
+# Send asynchronous function message(s) to station B.
+if True: #456 == param7:
+ fc3 = maximus.create_fcall("function_3")
+ fc3.send_async(stationC)
+fc4 = maximus.create_fcall("function_4")
+fc4.send_async(stationC)
+
+# Send an asynchronous function message to station C.
+fc5 = maximus.create_fcall("function_5")
+fc5.send_async(stationC)
+
+# Wait for responses to all sent messages in asynchronous mode.
+maximus.wait()
+
+# Get list of all registered parameters of stations C.
+probe3 = maximus.create_probe()
+probe3.send(stationC)
+if probe3.is_param("param_8"):
+ # Get parameter 8 value and set parameter 9 value of station C.
+ probe4 = maximus.create_probe()
+ probe4.add_param("param_8")
+ probe4.add_param_bool("param_9", False)
+ probe4.send(stationC)
+ param8 = probe4.bind_param_bool("param_8")
+ print "RESULT: param 8 =",param8
+
+# Wait during 1000000 ticks before creating another station.
+maximus.wait(1000000)
+
+# Create a fourth station.
+stationD = maximus.create_sta("dd:dd:dd:dd:dd:dd")
+
+# Wait during 1000000 ticks before terminating the program.
+maximus.wait(1000000)
+
+# Remove stations.
+stationA.remove()
+stationB.remove()
+stationC.remove()
+stationD.remove()
+
+print "\n*** END ***\n"
diff --git a/cesar/maximus/test/test_python.sh b/cesar/maximus/test/test_python.sh
index e486cfd180..54755cfae3 100755
--- a/cesar/maximus/test/test_python.sh
+++ b/cesar/maximus/test/test_python.sh
@@ -60,14 +60,14 @@ python send_noise.py -e obj/test_rx.elf -d false -t 2500000000
echo
echo "*** CL - SAR - PB proc tests ***"
echo
-cd $WORKSPACE/test_general/integration/cl-sar-pbproc
+cd $WORKSPACE/test_general/maximus/integration/cl-sar-pbproc
make clean; make
-python src/Maximus.py -e obj/cl-sar-pbproc.elf -d false -t 2500000000
+python test1.py -e obj/cl-sar-pbproc.elf -d false -t 2500000000
echo
echo "*** CP BEACON - DP tests ***"
echo
-cd $WORKSPACE/test_general/integration/cp_beacon-dp
+cd $WORKSPACE/test_general/maximus/integration/cp_beacon-dp
make clean; make
python src/max.py -e obj/cp_beacon.elf -d false -t 2500000000
python src/max_ucco.py -e obj/cp_beacon.elf -d false -t 2500000000
@@ -79,36 +79,37 @@ python ucco_with_sta.py -e obj/cp_beacon.elf -d false -t 2500000000
echo
echo "*** HLE - CL - SAR - PB proc tests ***"
echo
-cd $WORKSPACE/test_general/integration/hle-cl-sar-pbproc
+cd $WORKSPACE/test_general/maximus/integration/hle-cl-sar-pbproc
make clean; make
-python src/Maximus.py -e obj/hle-cl-sar-pbproc.elf -d false -t 2500000000
+python test1.py -e obj/hle-cl-sar-pbproc.elf -d false -t 2500000000
echo
echo "*** IPMBOX - HLE - CL - SAR - PB proc tests ***"
echo
-cd $WORKSPACE/test_general/integration/ipmbox-hle-cl-sar-pbproc
+cd $WORKSPACE/test_general/maximus/integration/ipmbox-hle-cl-sar-pbproc
make clean; make
-python src/Maximus.py -e obj/ipmbox-hle-cl-sar-pbproc.elf -d false -t 2500000000
-python src/Maximus_mme.py -e obj/ipmbox-hle-cl-sar-pbproc.elf -d false -t 2500000000
+python test1.py -e obj/ipmbox-hle-cl-sar-pbproc.elf -d false -t 2500000000
+python test2.py -e obj/ipmbox-hle-cl-sar-pbproc.elf -d false -t 2500000000
echo
echo "*** SAR - PB proc tests ***"
echo
-cd $WORKSPACE/test_general/integration/sar-pbproc
+cd $WORKSPACE/test_general/maximus/integration/sar-pbproc
make clean; make
-python src/Maximus.py -e obj/sar-pbproc.elf -d false -t 2500000000
+python test1.py -e obj/sar-pbproc.elf -d false -t 2500000000
echo
echo "*** INTERFACE - DP tests ***"
echo
-cd $WORKSPACE/test_general/integration/interface-dp
+cd $WORKSPACE/test_general/maximus/integration/interface-dp
make clean; make
python test1.py -d false -t 2500000000
echo
echo "*** STATION - CP - DP tests ***"
echo
-cd $WORKSPACE/test_general/integration/station-cp-dp
+cd $WORKSPACE/test_general/maximus/integration/station-cp-dp
make clean; make
cd src
#python Maximus.py -d false -t 500000000
+#python Maximus_3_stations.py -d false -t 500000000
diff --git a/cesar/test_general/maximus/integration/cp_beacon-dp/Makefile b/cesar/test_general/maximus/integration/cp_beacon-dp/Makefile
index f4af95fc54..9a86c0131b 100644
--- a/cesar/test_general/maximus/integration/cp_beacon-dp/Makefile
+++ b/cesar/test_general/maximus/integration/cp_beacon-dp/Makefile
@@ -1,17 +1,17 @@
-BASE = ../../..
+BASE = ../../../..
ECOS = y
-INCLUDES = test_general/station/overide/
+INCLUDES = test_general/maximus/station/overide/
TARGET_PROGRAMS = cp_beacon
cp_beacon_SOURCES = station.c
cp_beacon_MODULES = mac cl hle cp/beacon hal lib host interface \
- test_general/station \
- test_general/station/overide/cp/cco \
- test_general/station/overide/cp/secu \
- test_general/station/overide/cp/station
+ test_general/maximus/station \
+ test_general/maximus/station/overide/cp/cco \
+ test_general/maximus/station/overide/cp/secu \
+ test_general/maximus/station/overide/cp/station
cp_beacon_MODULE_SOURCES = beacons.c bentry.c