Commit 35e81d8a authored by Y_Tomita's avatar Y_Tomita

Add virtual NIC setting for L2 FAPI simulator.

parent 31d6783d
...@@ -58,6 +58,7 @@ Description Defines functions used to handle EPS bearer contexts. ...@@ -58,6 +58,7 @@ Description Defines functions used to handle EPS bearer contexts.
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
extern uint8_t nfapi_mode;
/****************************************************************************/ /****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/ /**************** E X T E R N A L D E F I N I T I O N S ****************/
...@@ -272,6 +273,20 @@ int esm_ebr_context_create( ...@@ -272,6 +273,20 @@ int esm_ebr_context_create(
strcpy(broadcast, ipv4_addr); strcpy(broadcast, ipv4_addr);
} }
if(nfapi_mode ==3){
// this is for L2 FAPI simulator.
// change for multiple UE's like 256UEs.
// if it's made too many tables , OS may crush so we use one table.
res = sprintf(command_line,
"ifconfig oip%d %s netmask %s broadcast %s up && "
"ip rule add from %s/24 table %d && "
"ip rule add to %s/24 table %d && "
"ip route add default dev oip%d table %d && "
ueid+1, ipv4_addr, netmask, broadcast,
ipv4_addr, 201,
ipv4_addr, 201,
ueid+1, 201, ueid+1);
} else {
res = sprintf(command_line, res = sprintf(command_line,
"ifconfig oip%d %s netmask %s broadcast %s up && " "ifconfig oip%d %s netmask %s broadcast %s up && "
"ip rule add from %s/32 table %d && " "ip rule add from %s/32 table %d && "
...@@ -281,6 +296,7 @@ int esm_ebr_context_create( ...@@ -281,6 +296,7 @@ int esm_ebr_context_create(
ipv4_addr, ueid + 201, ipv4_addr, ueid + 201,
ipv4_addr, ueid + 201, ipv4_addr, ueid + 201,
ueid + 1, ueid + 201); ueid + 1, ueid + 201);
}
if ( res<0 ) { if ( res<0 ) {
LOG_TRACE(WARNING, "ESM-PROC - Failed to system command string"); LOG_TRACE(WARNING, "ESM-PROC - Failed to system command string");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment