INET Framework for OMNeT++/OMNEST
PacketDrillUtils.h File Reference
#include "inet/common/INETDefs.h"
#include "omnetpp/platdep/sockets.h"
#include "inet/networklayer/common/L3Address.h"
#include "inet/common/ByteArray.h"
#include <sys/socket.h>
#include "inet/transportlayer/sctp/SCTPMessage.h"
#include "inet/transportlayer/sctp/SCTPAssociation.h"

Classes

struct  int_symbol
 
struct  option_list
 
struct  errno_spec
 
struct  syscall_spec
 
struct  command_spec
 
struct  invocation
 
struct  binary_expression
 
struct  sctp_rtoinfo_expr
 
struct  sctp_initmsg_expr
 
struct  sctp_assoc_value_expr
 
struct  sctp_assocparams_expr
 
struct  sctp_sack_info_expr
 
struct  sctp_paddrparams_expr
 
struct  sctp_sndrcvinfo_expr
 
struct  sctp_reset_streams_expr
 
struct  sctp_status_expr
 
struct  sctp_add_streams_expr
 
class  PacketDrillConfig
 
class  PacketDrillPacket
 
class  PacketDrillEvent
 
class  PacketDrillExpression
 
class  PacketDrillScript
 
class  PacketDrillStruct
 
class  PacketDrillOption
 
class  PacketDrillBytes
 
class  PacketDrillTcpOption
 
class  PacketDrillSctpChunk
 
class  PacketDrillSctpParameter
 

Macros

#define IPPROTO_SCTP   132
 
#define F_GETFL   3
 
#define F_SETFL   4
 
#define TCPOPT_EOL   0
 
#define TCPOPT_NOP   1
 
#define TCPOPT_MAXSEG   2
 
#define TCPOLEN_MAXSEG   4
 
#define TCPOPT_WINDOW   3
 
#define TCPOLEN_WINDOW   3
 
#define TCPOPT_SACK_PERMITTED   4
 
#define TCPOLEN_SACK_PERMITTED   2
 
#define TCPOPT_SACK   5
 
#define TCPOPT_TIMESTAMP   8
 
#define TCPOLEN_TIMESTAMP   10
 
#define TCPOPT_EXP   254 /* Experimental */
 
#define SCTP_DATA_CHUNK_TYPE   0x00
 
#define SCTP_INIT_CHUNK_TYPE   0x01
 
#define SCTP_INIT_ACK_CHUNK_TYPE   0x02
 
#define SCTP_SACK_CHUNK_TYPE   0x03
 
#define SCTP_HEARTBEAT_CHUNK_TYPE   0x04
 
#define SCTP_HEARTBEAT_ACK_CHUNK_TYPE   0x05
 
#define SCTP_ABORT_CHUNK_TYPE   0x06
 
#define SCTP_SHUTDOWN_CHUNK_TYPE   0x07
 
#define SCTP_SHUTDOWN_ACK_CHUNK_TYPE   0x08
 
#define SCTP_ERROR_CHUNK_TYPE   0x09
 
#define SCTP_COOKIE_ECHO_CHUNK_TYPE   0x0a
 
#define SCTP_COOKIE_ACK_CHUNK_TYPE   0x0b
 
#define SCTP_SHUTDOWN_COMPLETE_CHUNK_TYPE   0x0e
 
#define SCTP_PAD_CHUNK_TYPE   0x84
 
#define SCTP_RECONFIG_CHUNK_TYPE   0x82
 
#define SCTP_DATA_CHUNK_I_BIT   0x08
 
#define SCTP_DATA_CHUNK_U_BIT   0x04
 
#define SCTP_DATA_CHUNK_B_BIT   0x02
 
#define SCTP_DATA_CHUNK_E_BIT   0x01
 
#define SCTP_ABORT_CHUNK_T_BIT   0x01
 
#define SCTP_SHUTDOWN_COMPLETE_CHUNK_T_BIT   0x01
 
#define MAX_SCTP_CHUNK_BYTES   0xffff
 
#define FLAG_CHUNK_TYPE_NOCHECK   0x00000001
 
#define FLAG_CHUNK_FLAGS_NOCHECK   0x00000002
 
#define FLAG_CHUNK_LENGTH_NOCHECK   0x00000004
 
#define FLAG_CHUNK_VALUE_NOCHECK   0x00000008
 
#define FLAG_INIT_CHUNK_TAG_NOCHECK   0x00000100
 
#define FLAG_INIT_CHUNK_A_RWND_NOCHECK   0x00000200
 
#define FLAG_INIT_CHUNK_OS_NOCHECK   0x00000400
 
#define FLAG_INIT_CHUNK_IS_NOCHECK   0x00000800
 
#define FLAG_INIT_CHUNK_TSN_NOCHECK   0x00001000
 
#define FLAG_INIT_CHUNK_OPT_PARAM_NOCHECK   0x00002000
 
#define FLAG_INIT_CHUNK_OPT_SUPPORTED_ADDRESS_TYPES_PARAM_NOCHECK   0x00004000
 
#define FLAG_INIT_ACK_CHUNK_TAG_NOCHECK   0x00000100
 
#define FLAG_INIT_ACK_CHUNK_A_RWND_NOCHECK   0x00000200
 
#define FLAG_INIT_ACK_CHUNK_OS_NOCHECK   0x00000400
 
#define FLAG_INIT_ACK_CHUNK_IS_NOCHECK   0x00000800
 
#define FLAG_INIT_ACK_CHUNK_TSN_NOCHECK   0x00001000
 
#define FLAG_INIT_ACK_CHUNK_OPT_PARAM_NOCHECK   0x00002000
 
#define FLAG_SHUTDOWN_CHUNK_CUM_TSN_NOCHECK   0x00000100
 
#define FLAG_DATA_CHUNK_TSN_NOCHECK   0x00000100
 
#define FLAG_DATA_CHUNK_SID_NOCHECK   0x00000200
 
#define FLAG_DATA_CHUNK_SSN_NOCHECK   0x00000400
 
#define FLAG_DATA_CHUNK_PPID_NOCHECK   0x00000800
 
#define FLAG_SACK_CHUNK_CUM_TSN_NOCHECK   0x00000100
 
#define FLAG_SACK_CHUNK_A_RWND_NOCHECK   0x00000200
 
#define FLAG_SACK_CHUNK_GAP_BLOCKS_NOCHECK   0x00000400
 
#define FLAG_SACK_CHUNK_DUP_TSNS_NOCHECK   0x00000800
 
#define FLAG_RECONFIG_RESULT_NOCHECK   0x00000010
 
#define FLAG_RECONFIG_SENDER_NEXT_TSN_NOCHECK   0x00000040
 
#define FLAG_RECONFIG_RECEIVER_NEXT_TSN_NOCHECK   0x00000080
 
#define FLAG_RECONFIG_REQ_SN_NOCHECK   0x00000010
 
#define FLAG_RECONFIG_RESP_SN_NOCHECK   0x00000020
 
#define FLAG_RECONFIG_LAST_TSN_NOCHECK   0x00000040
 
#define FLAG_RECONFIG_NUMBER_OF_NEW_STREAMS_NOCHECK   0x00000080
 
#define SCTP_INITMSG   0
 
#define SCTP_RTOINFO   1
 
#define SCTP_NODELAY   2
 
#define SCTP_MAXSEG   3
 
#define SCTP_DELAYED_SACK   4
 
#define SCTP_MAX_BURST   5
 
#define SCTP_FRAGMENT_INTERLEAVE   6
 
#define SCTP_INTERLEAVING_SUPPORTED   7
 
#define SCTP_PADDR_PARAMS   8
 
#define SCTP_ASSOCINFO   9
 
#define SCTP_PEER_ADDR_PARAMS   10
 
#define SCTP_UNORDERED   1
 
#define SCTP_ENABLE_STREAM_RESET   0x00000900 /* struct sctp_assoc_value */
 
#define SCTP_RESET_STREAMS   0x00000901 /* struct sctp_reset_streams */
 
#define SCTP_RESET_ASSOC   0x00000902 /* sctp_assoc_t */
 
#define SCTP_ADD_STREAMS   0x00000903 /* struct sctp_add_streams */
 
#define SCTP_STATUS   0x00000100
 
#define PD_O_RDWR   0x002
 
#define SCTP_COOKIE_WAIT   0x0002
 
#define SCTP_ENABLE_RESET_STREAM_REQ   0x00000001
 
#define SCTP_ENABLE_RESET_ASSOC_REQ   0x00000002
 
#define SCTP_ENABLE_CHANGE_ASSOC_REQ   0x00000004
 
#define SCTP_ENABLE_VALUE_MASK   0x00000007
 
#define SCTP_STREAM_RESET_INCOMING   0x00000001
 
#define SCTP_STREAM_RESET_OUTGOING   0x00000002
 
#define SCTP_IPV4_ADDRESS_PARAMETER_TYPE   0x0005
 
#define SCTP_IPV6_ADDRESS_PARAMETER_TYPE   0x0006
 
#define SPP_HB_ENABLE   0x00000001
 
#define SPP_HB_DISABLE   0x00000002
 
#define SPP_HB_DEMAND   0x00000004
 
#define SPP_PMTUD_ENABLE   0x00000008
 
#define SPP_PMTUD_DISABLE   0x00000010
 
#define SPP_HB_TIME_IS_ZERO   0x00000080
 
#define SPP_IPV6_FLOWLABEL   0x00000100
 
#define SPP_DSCP   0x00000200
 
#define SPP_IPV4_TOS   SPP_DSCP
 
#define NO_TIME_RANGE   -1 /* time_usecs_end if no range */
 
#define ADDR_STR_LEN   66
 
#define TUN_DRIVER_DEFAULT_MTU   1500 /* default MTU for tun device */
 

Enumerations

enum  direction_t { DIRECTION_INVALID, DIRECTION_INBOUND, DIRECTION_OUTBOUND }
 
enum  event_t {
  INVALID_EVENT = 0, PACKET_EVENT, SYSCALL_EVENT, COMMAND_EVENT,
  NUM_EVENT_TYPES
}
 
enum  eventTime_t {
  ABSOLUTE_TIME = 0, RELATIVE_TIME, ANY_TIME, ABSOLUTE_RANGE_TIME,
  RELATIVE_RANGE_TIME, NUM_TIME_TYPES
}
 
enum  expression_t {
  EXPR_NONE, EXPR_ELLIPSIS, EXPR_INTEGER, EXPR_LINGER,
  EXPR_WORD, EXPR_STRING, EXPR_SOCKET_ADDRESS_IPV4, EXPR_SOCKET_ADDRESS_IPV6,
  EXPR_BINARY, EXPR_LIST, EXPR_SCTP_RTOINFO, EXPR_SCTP_INITMSG,
  EXPR_SCTP_ASSOCVAL, EXPR_SCTP_SACKINFO, EXPR_SCTP_PEER_ADDR_PARAMS, EXPR_SCTP_SNDRCVINFO,
  EXPR_SCTP_RESET_STREAMS, EXPR_SCTP_STATUS, EXPR_SCTP_ASSOCPARAMS, EXPR_SCTP_ADD_STREAMS,
  NUM_EXPR_TYPES
}
 
enum  ip_version_t { IP_VERSION_4 = 0, IP_VERSION_4_MAPPED_6 = 1, IP_VERSION_6 = 2 }
 
enum  status_t { STATUS_OK = 0, STATUS_ERR = -1, STATUS_WARN = -2 }
 

Functions

struct int_symbolplatform_symbols (void)
 
int parse_script (PacketDrillConfig *config, PacketDrillScript *script, struct invocation *callback_invocation)
 
void parse_and_finalize_config (struct invocation *invocation)
 

Macro Definition Documentation

#define ADDR_STR_LEN   66
#define F_GETFL   3
#define F_SETFL   4
#define FLAG_CHUNK_TYPE_NOCHECK   0x00000001
#define FLAG_DATA_CHUNK_PPID_NOCHECK   0x00000800
#define FLAG_DATA_CHUNK_SID_NOCHECK   0x00000200
#define FLAG_DATA_CHUNK_SSN_NOCHECK   0x00000400
#define FLAG_DATA_CHUNK_TSN_NOCHECK   0x00000100
#define FLAG_INIT_ACK_CHUNK_A_RWND_NOCHECK   0x00000200
#define FLAG_INIT_ACK_CHUNK_IS_NOCHECK   0x00000800
#define FLAG_INIT_ACK_CHUNK_OPT_PARAM_NOCHECK   0x00002000
#define FLAG_INIT_ACK_CHUNK_OS_NOCHECK   0x00000400
#define FLAG_INIT_ACK_CHUNK_TAG_NOCHECK   0x00000100
#define FLAG_INIT_ACK_CHUNK_TSN_NOCHECK   0x00001000
#define FLAG_INIT_CHUNK_A_RWND_NOCHECK   0x00000200
#define FLAG_INIT_CHUNK_IS_NOCHECK   0x00000800
#define FLAG_INIT_CHUNK_OPT_PARAM_NOCHECK   0x00002000
#define FLAG_INIT_CHUNK_OPT_SUPPORTED_ADDRESS_TYPES_PARAM_NOCHECK   0x00004000
#define FLAG_INIT_CHUNK_OS_NOCHECK   0x00000400
#define FLAG_INIT_CHUNK_TAG_NOCHECK   0x00000100
#define FLAG_INIT_CHUNK_TSN_NOCHECK   0x00001000
#define FLAG_RECONFIG_LAST_TSN_NOCHECK   0x00000040
#define FLAG_RECONFIG_NUMBER_OF_NEW_STREAMS_NOCHECK   0x00000080
#define FLAG_RECONFIG_RECEIVER_NEXT_TSN_NOCHECK   0x00000080
#define FLAG_RECONFIG_REQ_SN_NOCHECK   0x00000010
#define FLAG_RECONFIG_RESP_SN_NOCHECK   0x00000020
#define FLAG_RECONFIG_RESULT_NOCHECK   0x00000010
#define FLAG_RECONFIG_SENDER_NEXT_TSN_NOCHECK   0x00000040
#define FLAG_SACK_CHUNK_A_RWND_NOCHECK   0x00000200
#define FLAG_SACK_CHUNK_CUM_TSN_NOCHECK   0x00000100
#define FLAG_SACK_CHUNK_DUP_TSNS_NOCHECK   0x00000800
#define FLAG_SACK_CHUNK_GAP_BLOCKS_NOCHECK   0x00000400
#define FLAG_SHUTDOWN_CHUNK_CUM_TSN_NOCHECK   0x00000100
#define MAX_SCTP_CHUNK_BYTES   0xffff
#define NO_TIME_RANGE   -1 /* time_usecs_end if no range */
#define PD_O_RDWR   0x002
#define SCTP_ABORT_CHUNK_T_BIT   0x01

Referenced by yyparse().

#define SCTP_ABORT_CHUNK_TYPE   0x06
#define SCTP_ADD_STREAMS   0x00000903 /* struct sctp_add_streams */
#define SCTP_ASSOCINFO   9
#define SCTP_COOKIE_ACK_CHUNK_TYPE   0x0b

Referenced by yyparse().

#define SCTP_COOKIE_ECHO_CHUNK_TYPE   0x0a

Referenced by yyparse().

#define SCTP_COOKIE_WAIT   0x0002
#define SCTP_DATA_CHUNK_B_BIT   0x02
#define SCTP_DATA_CHUNK_E_BIT   0x01
#define SCTP_DATA_CHUNK_I_BIT   0x08

Referenced by yyparse().

#define SCTP_DATA_CHUNK_TYPE   0x00
#define SCTP_DATA_CHUNK_U_BIT   0x04
#define SCTP_DELAYED_SACK   4
#define SCTP_ENABLE_CHANGE_ASSOC_REQ   0x00000004
#define SCTP_ENABLE_RESET_ASSOC_REQ   0x00000002
#define SCTP_ENABLE_RESET_STREAM_REQ   0x00000001
#define SCTP_ENABLE_STREAM_RESET   0x00000900 /* struct sctp_assoc_value */
#define SCTP_ENABLE_VALUE_MASK   0x00000007
#define SCTP_ERROR_CHUNK_TYPE   0x09

Referenced by yyparse().

#define SCTP_FRAGMENT_INTERLEAVE   6
#define SCTP_HEARTBEAT_ACK_CHUNK_TYPE   0x05

Referenced by yyparse().

#define SCTP_HEARTBEAT_CHUNK_TYPE   0x04

Referenced by yyparse().

#define SCTP_INIT_ACK_CHUNK_TYPE   0x02

Referenced by yyparse().

#define SCTP_INIT_CHUNK_TYPE   0x01

Referenced by yyparse().

#define SCTP_INITMSG   0
#define SCTP_INTERLEAVING_SUPPORTED   7
#define SCTP_IPV4_ADDRESS_PARAMETER_TYPE   0x0005

Referenced by yyparse().

#define SCTP_IPV6_ADDRESS_PARAMETER_TYPE   0x0006

Referenced by yyparse().

#define SCTP_MAX_BURST   5
#define SCTP_MAXSEG   3
#define SCTP_NODELAY   2
#define SCTP_PAD_CHUNK_TYPE   0x84

Referenced by yyparse().

#define SCTP_PADDR_PARAMS   8
#define SCTP_PEER_ADDR_PARAMS   10
#define SCTP_RECONFIG_CHUNK_TYPE   0x82
#define SCTP_RESET_ASSOC   0x00000902 /* sctp_assoc_t */
#define SCTP_RESET_STREAMS   0x00000901 /* struct sctp_reset_streams */
#define SCTP_RTOINFO   1
#define SCTP_SACK_CHUNK_TYPE   0x03
#define SCTP_SHUTDOWN_ACK_CHUNK_TYPE   0x08

Referenced by yyparse().

#define SCTP_SHUTDOWN_CHUNK_TYPE   0x07
#define SCTP_SHUTDOWN_COMPLETE_CHUNK_T_BIT   0x01

Referenced by yyparse().

#define SCTP_SHUTDOWN_COMPLETE_CHUNK_TYPE   0x0e

Referenced by yyparse().

#define SCTP_STATUS   0x00000100
#define SCTP_STREAM_RESET_INCOMING   0x00000001
#define SCTP_STREAM_RESET_OUTGOING   0x00000002
#define SCTP_UNORDERED   1
#define SPP_DSCP   0x00000200
#define SPP_HB_DEMAND   0x00000004
#define SPP_HB_DISABLE   0x00000002
#define SPP_HB_ENABLE   0x00000001
#define SPP_HB_TIME_IS_ZERO   0x00000080
#define SPP_IPV4_TOS   SPP_DSCP
#define SPP_IPV6_FLOWLABEL   0x00000100
#define SPP_PMTUD_DISABLE   0x00000010
#define SPP_PMTUD_ENABLE   0x00000008
#define TCPOLEN_MAXSEG   4

Referenced by yyparse().

#define TCPOLEN_SACK_PERMITTED   2

Referenced by yyparse().

#define TCPOLEN_TIMESTAMP   10

Referenced by yyparse().

#define TCPOLEN_WINDOW   3

Referenced by yyparse().

#define TCPOPT_EOL   0
#define TCPOPT_EXP   254 /* Experimental */
#define TCPOPT_MAXSEG   2

Referenced by setOptionValues(), and yyparse().

#define TCPOPT_NOP   1
#define TCPOPT_SACK   5
#define TCPOPT_SACK_PERMITTED   4
#define TCPOPT_WINDOW   3
#define TUN_DRIVER_DEFAULT_MTU   1500 /* default MTU for tun device */

Enumeration Type Documentation

Enumerator
DIRECTION_INVALID 
DIRECTION_INBOUND 
DIRECTION_OUTBOUND 
183  {
185  DIRECTION_INBOUND, /* packet coming into the kernel under test */
186  DIRECTION_OUTBOUND, /* packet leaving the kernel under test */
187 };
Definition: PacketDrillUtils.h:184
Definition: PacketDrillUtils.h:186
Definition: PacketDrillUtils.h:185
enum event_t
Enumerator
INVALID_EVENT 
PACKET_EVENT 
SYSCALL_EVENT 
COMMAND_EVENT 
NUM_EVENT_TYPES 
225  {
226  INVALID_EVENT = 0,
227  PACKET_EVENT,
231 };
Definition: PacketDrillUtils.h:227
Definition: PacketDrillUtils.h:230
Definition: PacketDrillUtils.h:228
Definition: PacketDrillUtils.h:226
Definition: PacketDrillUtils.h:229
Enumerator
ABSOLUTE_TIME 
RELATIVE_TIME 
ANY_TIME 
ABSOLUTE_RANGE_TIME 
RELATIVE_RANGE_TIME 
NUM_TIME_TYPES 
234  {
235  ABSOLUTE_TIME = 0,
237  ANY_TIME,
241 };
Definition: PacketDrillUtils.h:240
Definition: PacketDrillUtils.h:239
Definition: PacketDrillUtils.h:235
Definition: PacketDrillUtils.h:238
Definition: PacketDrillUtils.h:236
Definition: PacketDrillUtils.h:237
Enumerator
EXPR_NONE 
EXPR_ELLIPSIS 
EXPR_INTEGER 
EXPR_LINGER 
EXPR_WORD 
EXPR_STRING 
EXPR_SOCKET_ADDRESS_IPV4 
EXPR_SOCKET_ADDRESS_IPV6 
EXPR_BINARY 
EXPR_LIST 
EXPR_SCTP_RTOINFO 
EXPR_SCTP_INITMSG 
EXPR_SCTP_ASSOCVAL 
EXPR_SCTP_SACKINFO 
EXPR_SCTP_PEER_ADDR_PARAMS 
EXPR_SCTP_SNDRCVINFO 
EXPR_SCTP_RESET_STREAMS 
EXPR_SCTP_STATUS 
EXPR_SCTP_ASSOCPARAMS 
EXPR_SCTP_ADD_STREAMS 
NUM_EXPR_TYPES 
244  {
245  EXPR_NONE,
246  EXPR_ELLIPSIS, /* ... but no value */
247  EXPR_INTEGER, /* integer in 'num' */
248  EXPR_LINGER, /* struct linger for SO_LINGER */
249  EXPR_WORD, /* unquoted word in 'string' */
250  EXPR_STRING, /* double-quoted string in 'string' */
251  EXPR_SOCKET_ADDRESS_IPV4, /* sockaddr_in in 'socket_address_ipv4' */
252  EXPR_SOCKET_ADDRESS_IPV6, /* sockaddr_in6 in 'socket_address_ipv6' */
253  EXPR_BINARY, /* binary expression, 2 sub-expressions */
254  EXPR_LIST, /* list of expressions */
255  EXPR_SCTP_RTOINFO, /* struct sctp_rtoinfo for SCTP_RTOINFO */
256  EXPR_SCTP_INITMSG, /* struct sctp_initmsg for SCTP_INITMSG */
257  EXPR_SCTP_ASSOCVAL, /* struct sctp_assoc_value */
258  EXPR_SCTP_SACKINFO, /* struct sctp_sack_info for SCTP_DELAYED_SACK */
259  EXPR_SCTP_PEER_ADDR_PARAMS, /* struct for sctp_paddrparams for SCTP_PEER_ADDR_PARAMS */
263  EXPR_SCTP_ASSOCPARAMS, /* struct sctp_assocparams for SCTP_ASSOCINFO */
265 
267 };
Definition: PacketDrillUtils.h:258
Definition: PacketDrillUtils.h:246
Definition: PacketDrillUtils.h:247
Definition: PacketDrillUtils.h:249
Definition: PacketDrillUtils.h:263
Definition: PacketDrillUtils.h:260
Definition: PacketDrillUtils.h:257
Definition: PacketDrillUtils.h:259
Definition: PacketDrillUtils.h:262
Definition: PacketDrillUtils.h:264
Definition: PacketDrillUtils.h:245
Definition: PacketDrillUtils.h:261
Definition: PacketDrillUtils.h:253
Definition: PacketDrillUtils.h:251
Definition: PacketDrillUtils.h:255
Definition: PacketDrillUtils.h:252
Definition: PacketDrillUtils.h:266
Definition: PacketDrillUtils.h:254
Definition: PacketDrillUtils.h:250
Definition: PacketDrillUtils.h:248
Definition: PacketDrillUtils.h:256
Enumerator
IP_VERSION_4 
IP_VERSION_4_MAPPED_6 
IP_VERSION_6 
270  {
271  /* Native IPv4, with AF_INET sockets and IPv4 addresses. */
272  IP_VERSION_4 = 0,
273 
274  /* IPv4-Mapped IPv6 addresses: (see RFC 4291 sec. 2.5.5.2) we
275  * use AF_INET6 sockets but all connect(), bind(), and
276  * accept() calls are for IPv4 addresses mapped into IPv6
277  * address space. So all interface addresses and packets on
278  * the wire are IPv4.
279  */
281 
282  /* Native IPv6, with AF_INET6 sockets and IPv6 addresses. */
283  IP_VERSION_6 = 2,
284 };
Definition: PacketDrillUtils.h:272
Definition: PacketDrillUtils.h:280
Definition: PacketDrillUtils.h:283
enum status_t
Enumerator
STATUS_OK 
STATUS_ERR 
STATUS_WARN 
286  {
287  STATUS_OK = 0,
288  STATUS_ERR = -1,
289  STATUS_WARN = -2, /* a non-fatal error or warning */
290 };
Definition: PacketDrillUtils.h:288
Definition: PacketDrillUtils.h:289
Definition: PacketDrillUtils.h:287

Function Documentation

void parse_and_finalize_config ( struct invocation invocation)

Referenced by yyparse().

242 {
243  invocation->config->parseScriptOptions(invocation->script->getOptionList());
244 }
PacketDrillConfig * config
Definition: PacketDrillUtils.h:338
cQueue * getOptionList()
Definition: PacketDrillUtils.h:622
void parseScriptOptions(cQueue *options)
Definition: PacketDrillUtils.cc:104
PacketDrillScript * script
Definition: PacketDrillUtils.h:339
int parse_script ( PacketDrillConfig config,
PacketDrillScript script,
struct invocation callback_invocation 
)

Referenced by PacketDrillScript::parseScriptAndSetConfig().

206  {
207  /* This bison-generated parser is not multi-thread safe, so we
208  * have a lock to prevent more than one thread using the
209  * parser at the same time. This is useful in the wire server
210  * context, where in general we may have more than one test
211  * thread running at the same time.
212  */
213 
214 #if YYDEBUG
215  yydebug = 1;
216 #endif
217 
218  /* Now parse the script from our buffer. */
219  yyin = fopen(script->getScriptPath(), "r");
220  if (!yyin)
221  printf("fopen: parse error opening script buffer");
222  current_script_path = config->getScriptPath();
223  in_config = config;
224  out_script = script;
225  invocation = callback_invocation;
226 
227  /* We have to reset the line number here since the wire server
228  * can do more than one yyparse().
229  */
230  yylineno = 1;
231  int result = yyparse(); /* invoke bison-generated parser */
232  current_script_path = NULL;
233  if (fclose(yyin))
234  printf("fclose: error closing script buffer");
235 
236  /* Unlock parser. */
237 
238  return result ? -1 : 0;
239 }
int yyparse(void)
Definition: parser.cc:2212
FILE * yyin
const char * getScriptPath()
Definition: PacketDrillUtils.h:620
Definition: PacketDrillUtils.h:337
int yylineno
const char * getScriptPath() const
Definition: PacketDrillUtils.h:456
struct int_symbol* platform_symbols ( void  )

Referenced by PacketDrillExpression::symbolToInt().

85 {
87 }
struct int_symbol platform_symbols_table[]
Definition: PacketDrillUtils.cc:35