-
Notifications
You must be signed in to change notification settings - Fork 1
/
sim_net
executable file
·33 lines (18 loc) · 836 Bytes
/
sim_net
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash -e
# Assuming ~/inet ~/nesting and are existing and built INET and NeSTiNg repositories,
# and ~/omnetpp-summit-hackathon-2018 is this repository
DIR=`dirname $0`
INET_DIR=$DIR/../inet
NESTING_DIR=$DIR/../nesting
DBG=_dbg # change to empty string to run release version
XML_FILE=$1
NED_FILE=${1/".xml"/".ned"}
# echo $XML_FILE $NED_FILE
shift
python3 $DIR/yang-to-opp/yang-to-opp.py $XML_FILE $NED_FILE
NETWORK=$(egrep 'network ' $NED_FILE | cut -d ' ' -f 2)
# This "empty" file still has to be there, even though the generated .ned is self-contained
echo "[General]" > omnetpp.ini
set -v
opp_run$DBG -n .:../src:$INET_DIR/src:$NESTING_DIR/src -l $INET_DIR/src/libINET$DBG.so -l $NESTING_DIR/src/libnesting$DBG.so -l ../src/libyto_dbg.so --image-path=$INET_DIR/images --network=$NETWORK "$@"
# echo $NETWORK