for (int i = 0; (service_list + i)->service_id != noserv_e; i++) {
service_t *s = service_list + i;
if (s && servname && (strcmp (s->name, servname) == 0)) {
- memcpy (mode ? &(s->rx) : &(s->tx), comm_list + nbcomms, sizeof (comm_t));
+ memcpy ((mode == 0) ? &(s->rx) : &(s->tx), comm_list + nbcomms, sizeof (comm_t));
break;
}
}
service_t *s = service_list + i;
VERBOSE (simul, TRACE, PRINTF ("test %c[%s]\n", *line, s->name));
if (strncmp (line + offset, s->name, strlen (s->name)) == 0) {
- comm = mode ? &(s->rx) : &(s->tx);
+ comm = (mode == 0) ? &(s->rx) : &(s->tx);
serv = s;
offset += strlen (s->name);
}
/* find MOREP by ethertype */
for (int j = 0; (j < nbcomms) && (comm == NULL); j++) {
comm_t *c = comm_list + j;
- VERBOSE (simul, TRACE, PRINTF ("test %c[%s]\n", c->mode ? 'T' : 'R', c->etype));
+ VERBOSE (simul, TRACE, PRINTF ("test %c[%s]\n", (c->mode == 0) ? 'R' : 'T', c->etype));
if ((strncmp (line + offset, c->etype, strlen (c->etype)) == 0) && (c->mode == mode)) {
comm = c;
for (int i = 0; ((service_list + i)->service_id != noserv_e) && (serv == NULL); i++) {
service_t *s = service_list + i;
- c = mode ? &(s->rx) : &(s->tx);
+ c = (mode == 0) ? &(s->rx) : &(s->tx);
if (strncmp (c->etype, comm->etype, strlen (comm->etype)) == 0) {
serv = s;
}
VERBOSE (simul, TRACE, PRINTF ("no morep found '%s'\n", line));
continue;
}
- VERBOSE (simul, DEBUG, PRINTF ("select %c[%s]\n", comm->mode ? 'T' : 'R', serv->name));
+ VERBOSE (simul, DEBUG, PRINTF ("select %c[%s]\n", (comm->mode == 0) ? 'R' : 'T', serv->name));
/* skip space */
tmp = line + offset;
VERBOSE (simul, WARNING, PRINTF ("message %s is not allowed for service %s (line '%s')\n", msg->name, serv->name, line));
continue;
}
- VERBOSE (simul, DEBUG, PRINTF ("%s message %s\n", comm->mode ? "sending" : "waiting", msg->name));
+ VERBOSE (simul, DEBUG, PRINTF ("%s message %s\n", (comm->mode == 0) ? "waiting" : "sending", msg->name));
CHANNEL_t pdu_channel = {0};
CLEAR_DATA_t pdu_clear_data = {0};
/* log message */
if (log) {
- fprintf (log, "%c:%s[%s] [SEG=%d MSG=%d LEN=%d PDU=%d] %s", mode ? 'T' : 'R',
+ fprintf (log, "%c:%s[%s] [SEG=%d MSG=%d LEN=%d PDU=%d] %s", (mode == 0) ? 'R' : 'T',
serv->name, comm->etype, seqnum, msg->msgtype, len, pdu, msg->name);
char buffer[MOREP_PAYLOAD * 3 + 256] = {0};
switch (pdu) {
case "$1" in
red)
+ #gdb $SIMULATOR --args \
$SIMULATOR -l script-red.log \
-s BYPASS -t $ETH_SECRED/080D -r $ETH_RADIORED/080D \
-s CONTROL -t $ETH_SECRED/080E -r $ETH_RADIORED/080E \
script-red.eth -v 3 -V 3
;;
secu)
+ #gdb $SIMULATOR --args \
$SIMULATOR -l script-secu.log \
-s BYPASS_BLACK -t $ETH_RADIOBLACK/081D -r $ETH_SECBLACK/081D \
-s BYPASS_RED -t $ETH_RADIORED/080D -r $ETH_SECRED/080D \
script-secu.eth -v 3 -V 3
;;
black)
+ #gdb $SIMULATOR --args \
$SIMULATOR -l script-black.log \
-s BYPASS -t $ETH_SECBLACK/081D -r $ETH_RADIOBLACK/081D \
-s CROSS_CRYPTO -t $ETH_SECBLACK/0819 -r $ETH_RADIOBLACK/0819 \