Skip to content
Snippets Groups Projects
Commit 9b9196f6 authored by hoelscher's avatar hoelscher
Browse files

Remove #ifdef for expressions for sctp, because they are platform independent

parent 92cad578
No related branches found
No related tags found
No related merge requests found
...@@ -2556,15 +2556,11 @@ srto_min ...@@ -2556,15 +2556,11 @@ srto_min
sctp_rtoinfo sctp_rtoinfo
: '{' srto_initial ',' srto_max ',' srto_min '}' { : '{' srto_initial ',' srto_max ',' srto_min '}' {
#ifdef SCTP_RTOINFO
$$ = new_expression(EXPR_SCTP_RTOINFO); $$ = new_expression(EXPR_SCTP_RTOINFO);
$$->value.sctp_rtoinfo = calloc(1, sizeof(struct sctp_rtoinfo_expr)); $$->value.sctp_rtoinfo = calloc(1, sizeof(struct sctp_rtoinfo_expr));
$$->value.sctp_rtoinfo->srto_initial = $2; $$->value.sctp_rtoinfo->srto_initial = $2;
$$->value.sctp_rtoinfo->srto_max = $4; $$->value.sctp_rtoinfo->srto_max = $4;
$$->value.sctp_rtoinfo->srto_min = $6; $$->value.sctp_rtoinfo->srto_min = $6;
#else
$$ = NULL;
#endif
} }
; ;
...@@ -2665,14 +2661,10 @@ sack_freq ...@@ -2665,14 +2661,10 @@ sack_freq
sctp_sackinfo sctp_sackinfo
: '{' sack_delay ',' sack_freq '}' { : '{' sack_delay ',' sack_freq '}' {
#ifdef SCTP_DELAYED_SACK
$$ = new_expression(EXPR_SCTP_SACKINFO); $$ = new_expression(EXPR_SCTP_SACKINFO);
$$->value.sctp_sack_info = calloc(1, sizeof(struct sctp_sack_info_expr)); $$->value.sctp_sack_info = calloc(1, sizeof(struct sctp_sack_info_expr));
$$->value.sctp_sack_info->sack_delay = $2; $$->value.sctp_sack_info->sack_delay = $2;
$$->value.sctp_sack_info->sack_freq = $4; $$->value.sctp_sack_info->sack_freq = $4;
#else
$$ = NULL;
#endif
} }
; ;
...@@ -2958,7 +2950,6 @@ sasoc_cookie_life ...@@ -2958,7 +2950,6 @@ sasoc_cookie_life
sctp_assocparams sctp_assocparams
: '{' sasoc_asocmaxrxt ',' sasoc_number_peer_destinations ',' sasoc_peer_rwnd ',' sasoc_local_rwnd ',' sasoc_cookie_life '}' { : '{' sasoc_asocmaxrxt ',' sasoc_number_peer_destinations ',' sasoc_peer_rwnd ',' sasoc_local_rwnd ',' sasoc_cookie_life '}' {
#ifdef SCTP_ASSOCINFO
$$ = new_expression(EXPR_SCTP_ASSOCPARAMS); $$ = new_expression(EXPR_SCTP_ASSOCPARAMS);
$$->value.sctp_assocparams = calloc(1, sizeof(struct sctp_assocparams_expr)); $$->value.sctp_assocparams = calloc(1, sizeof(struct sctp_assocparams_expr));
$$->value.sctp_assocparams->sasoc_asocmaxrxt = $2; $$->value.sctp_assocparams->sasoc_asocmaxrxt = $2;
...@@ -2966,9 +2957,6 @@ sctp_assocparams ...@@ -2966,9 +2957,6 @@ sctp_assocparams
$$->value.sctp_assocparams->sasoc_peer_rwnd = $6; $$->value.sctp_assocparams->sasoc_peer_rwnd = $6;
$$->value.sctp_assocparams->sasoc_local_rwnd = $8; $$->value.sctp_assocparams->sasoc_local_rwnd = $8;
$$->value.sctp_assocparams->sasoc_cookie_life = $10; $$->value.sctp_assocparams->sasoc_cookie_life = $10;
#elif
$$ = NULL;
#endif
} }
; ;
...@@ -2997,29 +2985,21 @@ se_on ...@@ -2997,29 +2985,21 @@ se_on
sctp_event sctp_event
: '{' se_type ',' se_on '}' { : '{' se_type ',' se_on '}' {
#ifdef SCTP_EVENT
$$ = new_expression(EXPR_SCTP_EVENT); $$ = new_expression(EXPR_SCTP_EVENT);
$$->value.sctp_event = calloc(1, sizeof(struct sctp_event_expr)); $$->value.sctp_event = calloc(1, sizeof(struct sctp_event_expr));
$$->value.sctp_event->se_type = $2; $$->value.sctp_event->se_type = $2;
$$->value.sctp_event->se_on = $4; $$->value.sctp_event->se_on = $4;
#elif
$$ = NULL;
#endif
} }
; ;
sctp_setadaptation sctp_setadaptation
: '{' SSB_ADAPTATION_IND '=' INTEGER '}' { : '{' SSB_ADAPTATION_IND '=' INTEGER '}' {
#ifdef SCTP_ADAPTATION_LAYER
$$ = new_expression(EXPR_SCTP_SETADAPTATION); $$ = new_expression(EXPR_SCTP_SETADAPTATION);
$$->value.sctp_setadaptation = calloc(1, sizeof(struct sctp_setadaptation)); $$->value.sctp_setadaptation = calloc(1, sizeof(struct sctp_setadaptation));
if (!is_valid_u32($4)) { if (!is_valid_u32($4)) {
semantic_error("ssb_adaptation_ind out of range"); semantic_error("ssb_adaptation_ind out of range");
} }
$$->value.sctp_setadaptation->ssb_adaptation_ind = new_integer_expression($4, "%u"); $$->value.sctp_setadaptation->ssb_adaptation_ind = new_integer_expression($4, "%u");
#elif
$$ = NULL;
#endif
} }
; ;
......
...@@ -65,38 +65,17 @@ struct expression_type_entry expression_type_table[] = { ...@@ -65,38 +65,17 @@ struct expression_type_entry expression_type_table[] = {
{ EXPR_IOVEC, "iovec" }, { EXPR_IOVEC, "iovec" },
{ EXPR_MSGHDR, "msghdr" }, { EXPR_MSGHDR, "msghdr" },
{ EXPR_POLLFD, "pollfd" }, { EXPR_POLLFD, "pollfd" },
#ifdef SCTP_RTOINFO
{ EXPR_SCTP_RTOINFO, "sctp_rtoinfo"}, { EXPR_SCTP_RTOINFO, "sctp_rtoinfo"},
#endif
#ifdef SCTP_INITMSG
{ EXPR_SCTP_INITMSG, "sctp_initmsg"}, { EXPR_SCTP_INITMSG, "sctp_initmsg"},
#endif
#if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED)
{ EXPR_SCTP_ASSOC_VALUE, "sctp_assoc_value"}, { EXPR_SCTP_ASSOC_VALUE, "sctp_assoc_value"},
#endif
#ifdef SCTP_DELAYED_SACK
{ EXPR_SCTP_SACKINFO, "sctp_sackinfo"}, { EXPR_SCTP_SACKINFO, "sctp_sackinfo"},
#endif
#ifdef SCTP_STATUS
{ EXPR_SCTP_STATUS, "sctp_status"}, { EXPR_SCTP_STATUS, "sctp_status"},
{ EXPR_SCTP_PADDRINFO, "sctp_paddrinfo"}, { EXPR_SCTP_PADDRINFO, "sctp_paddrinfo"},
#endif { EXPR_SCTP_PEER_ADDR_PARAMS,"sctp_peer_addr_params"},
#ifdef SCTP_PEER_ADDR_PARAMS
{ EXPR_SCTP_PEER_ADDR_PARAMS, "sctp_peer_addr_params"},
#endif
#ifdef SCTP_SS_VALUE
{ EXPR_SCTP_STREAM_VALUE, "sctp_stream_value"}, { EXPR_SCTP_STREAM_VALUE, "sctp_stream_value"},
#endif
#ifdef SCTP_ASSOCINFO
{ EXPR_SCTP_ASSOCPARAMS, "sctp_assocparams"}, { EXPR_SCTP_ASSOCPARAMS, "sctp_assocparams"},
#endif
#ifdef SCTP_EVENT
{ EXPR_SCTP_EVENT, "sctp_event" }, { EXPR_SCTP_EVENT, "sctp_event" },
#endif
#ifdef SCTP_ADAPTATION_LAYER
{ EXPR_SCTP_SETADAPTATION, "sctp_setadaptation"}, { EXPR_SCTP_SETADAPTATION, "sctp_setadaptation"},
#endif
{ NUM_EXPR_TYPES, NULL} { NUM_EXPR_TYPES, NULL}
}; };
...@@ -308,21 +287,16 @@ void free_expression(struct expression *expression) ...@@ -308,21 +287,16 @@ void free_expression(struct expression *expression)
free_expression(expression->value.linger->l_onoff); free_expression(expression->value.linger->l_onoff);
free_expression(expression->value.linger->l_linger); free_expression(expression->value.linger->l_linger);
break; break;
#ifdef SCTP_RTOINFO
case EXPR_SCTP_RTOINFO: case EXPR_SCTP_RTOINFO:
assert(expression->value.sctp_rtoinfo); assert(expression->value.sctp_rtoinfo);
free_expression(expression->value.sctp_rtoinfo->srto_initial); free_expression(expression->value.sctp_rtoinfo->srto_initial);
free_expression(expression->value.sctp_rtoinfo->srto_max); free_expression(expression->value.sctp_rtoinfo->srto_max);
free_expression(expression->value.sctp_rtoinfo->srto_min); free_expression(expression->value.sctp_rtoinfo->srto_min);
break; break;
#endif
#if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED)
case EXPR_SCTP_ASSOC_VALUE: case EXPR_SCTP_ASSOC_VALUE:
assert(expression->value.sctp_assoc_value); assert(expression->value.sctp_assoc_value);
free_expression(expression->value.sctp_assoc_value->assoc_value); free_expression(expression->value.sctp_assoc_value->assoc_value);
break; break;
#endif
#ifdef SCTP_INITMSG
case EXPR_SCTP_INITMSG: case EXPR_SCTP_INITMSG:
assert(expression->value.sctp_initmsg); assert(expression->value.sctp_initmsg);
free_expression(expression->value.sctp_initmsg->sinit_num_ostreams); free_expression(expression->value.sctp_initmsg->sinit_num_ostreams);
...@@ -330,15 +304,11 @@ void free_expression(struct expression *expression) ...@@ -330,15 +304,11 @@ void free_expression(struct expression *expression)
free_expression(expression->value.sctp_initmsg->sinit_max_attempts); free_expression(expression->value.sctp_initmsg->sinit_max_attempts);
free_expression(expression->value.sctp_initmsg->sinit_max_init_timeo); free_expression(expression->value.sctp_initmsg->sinit_max_init_timeo);
break; break;
#endif
#ifdef SCTP_DELAYED_SACK
case EXPR_SCTP_SACKINFO: case EXPR_SCTP_SACKINFO:
assert(expression->value.sctp_sack_info); assert(expression->value.sctp_sack_info);
free_expression(expression->value.sctp_sack_info->sack_delay); free_expression(expression->value.sctp_sack_info->sack_delay);
free_expression(expression->value.sctp_sack_info->sack_freq); free_expression(expression->value.sctp_sack_info->sack_freq);
break; break;
#endif
#ifdef SCTP_STATUS
case EXPR_SCTP_PADDRINFO: case EXPR_SCTP_PADDRINFO:
assert(expression->value.sctp_paddrinfo); assert(expression->value.sctp_paddrinfo);
free_expression(expression->value.sctp_paddrinfo->spinfo_address); free_expression(expression->value.sctp_paddrinfo->spinfo_address);
...@@ -359,8 +329,6 @@ void free_expression(struct expression *expression) ...@@ -359,8 +329,6 @@ void free_expression(struct expression *expression)
free_expression(expression->value.sctp_status->sstat_fragmentation_point); free_expression(expression->value.sctp_status->sstat_fragmentation_point);
free_expression(expression->value.sctp_status->sstat_primary); free_expression(expression->value.sctp_status->sstat_primary);
break; break;
#endif
#ifdef SCTP_PEER_ADDR_PARAMS
case EXPR_SCTP_PEER_ADDR_PARAMS: case EXPR_SCTP_PEER_ADDR_PARAMS:
assert(expression->value.sctp_paddrparams); assert(expression->value.sctp_paddrparams);
free_expression(expression->value.sctp_paddrparams->spp_address); free_expression(expression->value.sctp_paddrparams->spp_address);
...@@ -371,15 +339,11 @@ void free_expression(struct expression *expression) ...@@ -371,15 +339,11 @@ void free_expression(struct expression *expression)
free_expression(expression->value.sctp_paddrparams->spp_ipv6_flowlabel); free_expression(expression->value.sctp_paddrparams->spp_ipv6_flowlabel);
free_expression(expression->value.sctp_paddrparams->spp_dscp); free_expression(expression->value.sctp_paddrparams->spp_dscp);
break; break;
#endif
#ifdef SCTP_SS_VALUE
case EXPR_SCTP_STREAM_VALUE: case EXPR_SCTP_STREAM_VALUE:
assert(expression->value.sctp_stream_value); assert(expression->value.sctp_stream_value);
free_expression(expression->value.sctp_stream_value->stream_id); free_expression(expression->value.sctp_stream_value->stream_id);
free_expression(expression->value.sctp_stream_value->stream_value); free_expression(expression->value.sctp_stream_value->stream_value);
break; break;
#endif
#ifdef SCTP_ASSOCINFO
case EXPR_SCTP_ASSOCPARAMS: case EXPR_SCTP_ASSOCPARAMS:
free_expression(expression->value.sctp_assocparams->sasoc_asocmaxrxt); free_expression(expression->value.sctp_assocparams->sasoc_asocmaxrxt);
free_expression(expression->value.sctp_assocparams->sasoc_number_peer_destinations); free_expression(expression->value.sctp_assocparams->sasoc_number_peer_destinations);
...@@ -387,18 +351,13 @@ void free_expression(struct expression *expression) ...@@ -387,18 +351,13 @@ void free_expression(struct expression *expression)
free_expression(expression->value.sctp_assocparams->sasoc_local_rwnd); free_expression(expression->value.sctp_assocparams->sasoc_local_rwnd);
free_expression(expression->value.sctp_assocparams->sasoc_cookie_life); free_expression(expression->value.sctp_assocparams->sasoc_cookie_life);
break; break;
#endif
#ifdef SCTP_EVENT
case EXPR_SCTP_EVENT: case EXPR_SCTP_EVENT:
free_expression(expression->value.sctp_event->se_type); free_expression(expression->value.sctp_event->se_type);
free_expression(expression->value.sctp_event->se_on); free_expression(expression->value.sctp_event->se_on);
break; break;
#endif
#ifdef SCTP_ADAPTATION_LAYER
case EXPR_SCTP_SETADAPTATION: case EXPR_SCTP_SETADAPTATION:
free_expression(expression->value.sctp_setadaptation->ssb_adaptation_ind); free_expression(expression->value.sctp_setadaptation->ssb_adaptation_ind);
break; break;
#endif
case EXPR_WORD: case EXPR_WORD:
assert(expression->value.string); assert(expression->value.string);
free(expression->value.string); free(expression->value.string);
...@@ -584,7 +543,6 @@ static int evaluate_pollfd_expression(struct expression *in, ...@@ -584,7 +543,6 @@ static int evaluate_pollfd_expression(struct expression *in,
return STATUS_OK; return STATUS_OK;
} }
#ifdef SCTP_RTOINFO
static int evaluate_sctp_rtoinfo_expression(struct expression *in, static int evaluate_sctp_rtoinfo_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -616,9 +574,7 @@ static int evaluate_sctp_rtoinfo_expression(struct expression *in, ...@@ -616,9 +574,7 @@ static int evaluate_sctp_rtoinfo_expression(struct expression *in,
return STATUS_OK; return STATUS_OK;
} }
#endif
#ifdef SCTP_INITMSG
static int evaluate_sctp_initmsg_expression(struct expression *in, static int evaluate_sctp_initmsg_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -653,9 +609,7 @@ static int evaluate_sctp_initmsg_expression(struct expression *in, ...@@ -653,9 +609,7 @@ static int evaluate_sctp_initmsg_expression(struct expression *in,
return STATUS_ERR; return STATUS_ERR;
return STATUS_OK; return STATUS_OK;
} }
#endif
#if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED)
static int evaluate_sctp_assoc_value_expression(struct expression *in, static int evaluate_sctp_assoc_value_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -679,9 +633,7 @@ static int evaluate_sctp_assoc_value_expression(struct expression *in, ...@@ -679,9 +633,7 @@ static int evaluate_sctp_assoc_value_expression(struct expression *in,
return STATUS_OK; return STATUS_OK;
} }
#endif
#ifdef SCTP_DELAYED_SACK
static int evaluate_sctp_sack_info_expression(struct expression *in, static int evaluate_sctp_sack_info_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -709,9 +661,7 @@ static int evaluate_sctp_sack_info_expression(struct expression *in, ...@@ -709,9 +661,7 @@ static int evaluate_sctp_sack_info_expression(struct expression *in,
return STATUS_OK; return STATUS_OK;
} }
#endif
#ifdef SCTP_STATUS
static int evaluate_sctp_paddrinfo_expression(struct expression *in, static int evaluate_sctp_paddrinfo_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -806,9 +756,7 @@ static int evaluate_sctp_status_expression(struct expression *in, ...@@ -806,9 +756,7 @@ static int evaluate_sctp_status_expression(struct expression *in,
return STATUS_ERR; return STATUS_ERR;
return STATUS_OK; return STATUS_OK;
} }
#endif
#ifdef SCTP_PEER_ADDR_PARAMS
static int evaluate_sctp_peer_addr_param_expression(struct expression *in, static int evaluate_sctp_peer_addr_param_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -855,9 +803,7 @@ static int evaluate_sctp_peer_addr_param_expression(struct expression *in, ...@@ -855,9 +803,7 @@ static int evaluate_sctp_peer_addr_param_expression(struct expression *in,
return STATUS_ERR; return STATUS_ERR;
return STATUS_OK; return STATUS_OK;
} }
#endif
#ifdef SCTP_SS_VALUE
static int evaluate_sctp_stream_value_expression(struct expression *in, static int evaluate_sctp_stream_value_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -885,9 +831,7 @@ static int evaluate_sctp_stream_value_expression(struct expression *in, ...@@ -885,9 +831,7 @@ static int evaluate_sctp_stream_value_expression(struct expression *in,
return STATUS_OK; return STATUS_OK;
} }
#endif
#ifdef SCTP_EVENT
static int evaluate_sctp_event_expression(struct expression *in, static int evaluate_sctp_event_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -915,9 +859,7 @@ static int evaluate_sctp_event_expression(struct expression *in, ...@@ -915,9 +859,7 @@ static int evaluate_sctp_event_expression(struct expression *in,
return STATUS_OK; return STATUS_OK;
} }
#endif
#ifdef SCTP_ASSOCINFO
static int evaluate_sctp_accocparams_expression(struct expression *in, static int evaluate_sctp_accocparams_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -957,9 +899,7 @@ static int evaluate_sctp_accocparams_expression(struct expression *in, ...@@ -957,9 +899,7 @@ static int evaluate_sctp_accocparams_expression(struct expression *in,
return STATUS_OK; return STATUS_OK;
} }
#endif
#ifdef SCTP_ADAPTATION_LAYER
static int evaluate_sctp_setadaptation_expression(struct expression *in, static int evaluate_sctp_setadaptation_expression(struct expression *in,
struct expression *out, struct expression *out,
char **error) char **error)
...@@ -983,7 +923,6 @@ static int evaluate_sctp_setadaptation_expression(struct expression *in, ...@@ -983,7 +923,6 @@ static int evaluate_sctp_setadaptation_expression(struct expression *in,
return STATUS_OK; return STATUS_OK;
} }
#endif
static int evaluate(struct expression *in, static int evaluate(struct expression *in,
struct expression **out_ptr, char **error) struct expression **out_ptr, char **error)
...@@ -1008,59 +947,39 @@ static int evaluate(struct expression *in, ...@@ -1008,59 +947,39 @@ static int evaluate(struct expression *in,
memcpy(&out->value.linger, &in->value.linger, memcpy(&out->value.linger, &in->value.linger,
sizeof(in->value.linger)); sizeof(in->value.linger));
break; break;
#ifdef SCTP_RTOINFO
case EXPR_SCTP_RTOINFO: case EXPR_SCTP_RTOINFO:
evaluate_sctp_rtoinfo_expression(in, out, error); result = evaluate_sctp_rtoinfo_expression(in, out, error);
break; break;
#endif
#ifdef SCTP_ASSOCINFO
case EXPR_SCTP_ASSOCPARAMS: case EXPR_SCTP_ASSOCPARAMS:
evaluate_sctp_accocparams_expression(in, out, error); result = evaluate_sctp_accocparams_expression(in, out, error);
break; break;
#endif
#ifdef SCTP_INITMSG
case EXPR_SCTP_INITMSG: case EXPR_SCTP_INITMSG:
evaluate_sctp_initmsg_expression(in, out, error); result = evaluate_sctp_initmsg_expression(in, out, error);
break; break;
#endif
#if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED)
case EXPR_SCTP_ASSOC_VALUE: case EXPR_SCTP_ASSOC_VALUE:
evaluate_sctp_assoc_value_expression(in, out, error); result = evaluate_sctp_assoc_value_expression(in, out, error);
break; break;
#endif
#ifdef SCTP_DELAYED_SACK
case EXPR_SCTP_SACKINFO: case EXPR_SCTP_SACKINFO:
evaluate_sctp_sack_info_expression(in, out, error); result = evaluate_sctp_sack_info_expression(in, out, error);
break; break;
#endif
#ifdef SCTP_STATUS
case EXPR_SCTP_PADDRINFO: case EXPR_SCTP_PADDRINFO:
evaluate_sctp_paddrinfo_expression(in, out, error); result = evaluate_sctp_paddrinfo_expression(in, out, error);
break; break;
case EXPR_SCTP_STATUS: case EXPR_SCTP_STATUS:
result = evaluate_sctp_status_expression(in, out, error); result = evaluate_sctp_status_expression(in, out, error);
break; break;
#endif
#ifdef SCTP_PEER_ADDR_PARAMS
case EXPR_SCTP_PEER_ADDR_PARAMS: case EXPR_SCTP_PEER_ADDR_PARAMS:
result = evaluate_sctp_peer_addr_param_expression(in, out, error); result = evaluate_sctp_peer_addr_param_expression(in, out, error);
break; break;
#endif
#ifdef SCTP_SS_VALUE
case EXPR_SCTP_STREAM_VALUE: case EXPR_SCTP_STREAM_VALUE:
evaluate_sctp_stream_value_expression(in, out, error); result = evaluate_sctp_stream_value_expression(in, out, error);
break; break;
#endif
#ifdef SCTP_EVENT
case EXPR_SCTP_EVENT: case EXPR_SCTP_EVENT:
result = evaluate_sctp_event_expression(in, out, error); result = evaluate_sctp_event_expression(in, out, error);
break; break;
#endif
#ifdef SCTP_ADAPTATION_LAYER
case EXPR_SCTP_SETADAPTATION: case EXPR_SCTP_SETADAPTATION:
result = evaluate_sctp_setadaptation_expression(in, out, error); result = evaluate_sctp_setadaptation_expression(in, out, error);
break; break;
#endif
case EXPR_WORD: case EXPR_WORD:
out->type = EXPR_INTEGER; out->type = EXPR_INTEGER;
if (symbol_to_int(in->value.string, if (symbol_to_int(in->value.string,
......
...@@ -45,38 +45,17 @@ enum expression_t { ...@@ -45,38 +45,17 @@ enum expression_t {
EXPR_IOVEC, /* expression tree for an iovec struct */ EXPR_IOVEC, /* expression tree for an iovec struct */
EXPR_MSGHDR, /* expression tree for a msghdr struct */ EXPR_MSGHDR, /* expression tree for a msghdr struct */
EXPR_POLLFD, /* expression tree for a pollfd struct */ EXPR_POLLFD, /* expression tree for a pollfd struct */
#ifdef SCTP_RTOINFO
EXPR_SCTP_RTOINFO, /* struct sctp_rtoinfo for SCTP_RTOINFO */ EXPR_SCTP_RTOINFO, /* struct sctp_rtoinfo for SCTP_RTOINFO */
#endif
#ifdef SCTP_INITMSG
EXPR_SCTP_INITMSG, /* struct sctp_initmsg for SCTP_INITMSG */ EXPR_SCTP_INITMSG, /* struct sctp_initmsg for SCTP_INITMSG */
#endif
#if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED)
EXPR_SCTP_ASSOC_VALUE, /* struct sctp_assoc_value */ EXPR_SCTP_ASSOC_VALUE, /* struct sctp_assoc_value */
#endif
#ifdef SCTP_DELAYED_SACK
EXPR_SCTP_SACKINFO, /* struct sctp_sack_info_expr for EXPR_SCTP_SACKINFO, /* struct sctp_sack_info_expr for
* SCTP_DELAYED_SACK */
#endif
#ifdef SCTP_STATUS
EXPR_SCTP_STATUS, /* struct sctp_status for SCTP_STATUS */ EXPR_SCTP_STATUS, /* struct sctp_status for SCTP_STATUS */
EXPR_SCTP_PADDRINFO, EXPR_SCTP_PADDRINFO,
#endif
#ifdef SCTP_SS_VALUE
EXPR_SCTP_STREAM_VALUE, /* struct sctp_stream_value for SCTP_SS_VALUE */ EXPR_SCTP_STREAM_VALUE, /* struct sctp_stream_value for SCTP_SS_VALUE */
#endif
#ifdef SCTP_PEER_ADDR_PARAMS
EXPR_SCTP_PEER_ADDR_PARAMS, /* struct for sctp_paddrparams for SCTP_PEER_ADDR_PARAMS */ EXPR_SCTP_PEER_ADDR_PARAMS, /* struct for sctp_paddrparams for SCTP_PEER_ADDR_PARAMS */
#endif
#ifdef SCTP_ASSOCINFO
EXPR_SCTP_ASSOCPARAMS, /* struct sctp_assocparams for SCTP_ASSOCINFO */ EXPR_SCTP_ASSOCPARAMS, /* struct sctp_assocparams for SCTP_ASSOCINFO */
#endif
#ifdef SCTP_EVENT
EXPR_SCTP_EVENT, /* struct sctp_event to for SCTP_EVENT */ EXPR_SCTP_EVENT, /* struct sctp_event to for SCTP_EVENT */
#endif
#ifdef SCTP_ADAPTATION_LAYER
EXPR_SCTP_SETADAPTATION, /* struct sctp_setadaptation for SCTP_ADATTATION_LAYER */ EXPR_SCTP_SETADAPTATION, /* struct sctp_setadaptation for SCTP_ADATTATION_LAYER */
#endif
NUM_EXPR_TYPES, NUM_EXPR_TYPES,
}; };
/* Convert an expression type to a human-readable string */ /* Convert an expression type to a human-readable string */
...@@ -96,38 +75,17 @@ struct expression { ...@@ -96,38 +75,17 @@ struct expression {
struct iovec_expr *iovec; struct iovec_expr *iovec;
struct msghdr_expr *msghdr; struct msghdr_expr *msghdr;
struct pollfd_expr *pollfd; struct pollfd_expr *pollfd;
#ifdef SCTP_RTOINFO
struct sctp_rtoinfo_expr *sctp_rtoinfo; struct sctp_rtoinfo_expr *sctp_rtoinfo;
#endif
#ifdef SCTP_INITMSG
struct sctp_initmsg_expr *sctp_initmsg; struct sctp_initmsg_expr *sctp_initmsg;
#endif
#if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED)
struct sctp_assoc_value_expr *sctp_assoc_value; struct sctp_assoc_value_expr *sctp_assoc_value;
#endif
#ifdef SCTP_DELAYED_SACK
struct sctp_sack_info_expr *sctp_sack_info; struct sctp_sack_info_expr *sctp_sack_info;
#endif
#ifdef SCTP_STATUS
struct sctp_status_expr *sctp_status; struct sctp_status_expr *sctp_status;
struct sctp_paddrinfo_expr *sctp_paddrinfo; struct sctp_paddrinfo_expr *sctp_paddrinfo;
#endif
#ifdef SCTP_PEER_ADDR_PARAMS
struct sctp_paddrparams_expr *sctp_paddrparams; struct sctp_paddrparams_expr *sctp_paddrparams;
#endif
#ifdef SCTP_SS_VALUE
struct sctp_stream_value_expr *sctp_stream_value; struct sctp_stream_value_expr *sctp_stream_value;
#endif
#ifdef SCTP_ASSOCINFO
struct sctp_assocparams_expr *sctp_assocparams; struct sctp_assocparams_expr *sctp_assocparams;
#endif
#ifdef SCTP_EVENT
struct sctp_event_expr *sctp_event; struct sctp_event_expr *sctp_event;
#endif
#ifdef SCTP_ADAPTATION_LAYER
struct sctp_setadaptation_expr *sctp_setadaptation; struct sctp_setadaptation_expr *sctp_setadaptation;
#endif
} value; } value;
const char *format; /* the printf format for printing the value */ const char *format; /* the printf format for printing the value */
}; };
...@@ -175,15 +133,12 @@ struct linger_expr { ...@@ -175,15 +133,12 @@ struct linger_expr {
struct expression *l_linger; struct expression *l_linger;
}; };
/* Parse tree for a sctp_rtoinfo struct in a [gs]etsockopt syscall. */ /* Parse tree for a sctp_rtoinfo struct in a [gs]etsockopt syscall. */
#ifdef SCTP_RTOINFO
struct sctp_rtoinfo_expr { struct sctp_rtoinfo_expr {
struct expression *srto_initial; struct expression *srto_initial;
struct expression *srto_max; struct expression *srto_max;
struct expression *srto_min; struct expression *srto_min;
}; };
#endif
#ifdef SCTP_INITMSG
/* Parse tree for a sctp_initmsg struct in a [gs]etsockopt syscall. */ /* Parse tree for a sctp_initmsg struct in a [gs]etsockopt syscall. */
struct sctp_initmsg_expr { struct sctp_initmsg_expr {
struct expression *sinit_num_ostreams; struct expression *sinit_num_ostreams;
...@@ -191,32 +146,25 @@ struct sctp_initmsg_expr { ...@@ -191,32 +146,25 @@ struct sctp_initmsg_expr {
struct expression *sinit_max_attempts; struct expression *sinit_max_attempts;
struct expression *sinit_max_init_timeo; struct expression *sinit_max_init_timeo;
}; };
#endif
#if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED)
/* Parse tree for a sctp_assoc_value struct in a [gs]etsockopt syscall. */ /* Parse tree for a sctp_assoc_value struct in a [gs]etsockopt syscall. */
struct sctp_assoc_value_expr { struct sctp_assoc_value_expr {
struct expression *assoc_value; struct expression *assoc_value;
}; };
#endif
#ifdef SCTP_SS_VALUE
/* Parse tree for a sctp_stream_value struct in a [gs]etsockopt syscall. */ /* Parse tree for a sctp_stream_value struct in a [gs]etsockopt syscall. */
struct sctp_stream_value_expr { struct sctp_stream_value_expr {
struct expression *stream_id; struct expression *stream_id;
struct expression *stream_value; struct expression *stream_value;
}; };
#endif
#ifdef SCTP_DELAYED_SACK
/* Parse tree for a sctp_sack_info struct in a [gs]etsockopt syscall. */ /* Parse tree for a sctp_sack_info struct in a [gs]etsockopt syscall. */
struct sctp_sack_info_expr { struct sctp_sack_info_expr {
struct expression *sack_delay; struct expression *sack_delay;
struct expression *sack_freq; struct expression *sack_freq;
}; };
#endif
/* Parse tree for a sctp_status struct in a [gs]etsockopt syscall. */ /* Parse tree for a sctp_status struct in a [gs]etsockopt syscall. */
#ifdef SCTP_STATUS
struct sctp_status_expr { struct sctp_status_expr {
struct expression *sstat_state; struct expression *sstat_state;
struct expression *sstat_rwnd; struct expression *sstat_rwnd;
...@@ -237,7 +185,6 @@ struct sctp_paddrinfo_expr { ...@@ -237,7 +185,6 @@ struct sctp_paddrinfo_expr {
struct expression *spinfo_rto; struct expression *spinfo_rto;
struct expression *spinfo_mtu; struct expression *spinfo_mtu;
}; };
#endif
/* Parse tree for a sctp_paddrparams struct in a [gs]etsockopt syscall. */ /* Parse tree for a sctp_paddrparams struct in a [gs]etsockopt syscall. */
struct sctp_paddrparams_expr { struct sctp_paddrparams_expr {
...@@ -250,7 +197,6 @@ struct sctp_paddrparams_expr { ...@@ -250,7 +197,6 @@ struct sctp_paddrparams_expr {
struct expression *spp_dscp; struct expression *spp_dscp;
}; };
#ifdef SCTP_ASSOCINFO
/* Parse tree for sctp_assocparams struct in [gs]etsockopt syscall. */ /* Parse tree for sctp_assocparams struct in [gs]etsockopt syscall. */
struct sctp_assocparams_expr { struct sctp_assocparams_expr {
struct expression *sasoc_asocmaxrxt; struct expression *sasoc_asocmaxrxt;
...@@ -259,22 +205,17 @@ struct sctp_assocparams_expr { ...@@ -259,22 +205,17 @@ struct sctp_assocparams_expr {
struct expression *sasoc_local_rwnd; struct expression *sasoc_local_rwnd;
struct expression *sasoc_cookie_life; struct expression *sasoc_cookie_life;
}; };
#endif
#ifdef SCTP_EVENT
/* Parse tree for sctp_event struct in [gs]etsockopt syscall. */ /* Parse tree for sctp_event struct in [gs]etsockopt syscall. */
struct sctp_event_expr { struct sctp_event_expr {
struct expression *se_type; struct expression *se_type;
struct expression *se_on; struct expression *se_on;
}; };
#endif
#ifdef SCTP_ADAPTATION_LAYER
/* Parse tree for sctp_setadaptation struct in [gs]etsockopt syscall. */ /* Parse tree for sctp_setadaptation struct in [gs]etsockopt syscall. */
struct sctp_setadaptation_expr { struct sctp_setadaptation_expr {
struct expression *ssb_adaptation_ind; struct expression *ssb_adaptation_ind;
}; };
#endif
/* The errno-related info from strace to summarize a system call error */ /* The errno-related info from strace to summarize a system call error */
struct errno_spec { struct errno_spec {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment