Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Packetdrill_tarr_ext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefan Gense
Packetdrill_tarr_ext
Commits
5f11dfda
Commit
5f11dfda
authored
9 years ago
by
hoelscher
Browse files
Options
Downloads
Patches
Plain Diff
add syntax in parser for sctp_authchunk and sctp_authkey
parent
a3ed6898
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gtests/net/packetdrill/lexer.l
+5
-0
5 additions, 0 deletions
gtests/net/packetdrill/lexer.l
gtests/net/packetdrill/parser.y
+49
-2
49 additions, 2 deletions
gtests/net/packetdrill/parser.y
with
54 additions
and
2 deletions
gtests/net/packetdrill/lexer.l
+
5
−
0
View file @
5f11dfda
...
...
@@ -389,6 +389,11 @@ gauth_number_of_chunks return GAUTH_NUMBER_OF_CHUNKS;
gauth_chunks return GAUTH_CHUNKS;
sspp_assoc_id return SSPP_ASSOC_ID;
sspp_addr return SSPP_ADDR;
sauth_chunk return SAUTH_CHUNK;
sca_assoc_id return SCA_ASSOC_ID;
sca_keynumber return SCA_KEYNUMBER;
sca_keylength return SCA_KEYLENGTH;
sca_key return SCA_KEY;
CHUNK return CHUNK;
DATA return DATA;
INIT return INIT;
...
...
This diff is collapsed.
Click to expand it.
gtests/net/packetdrill/parser.y
+
49
−
2
View file @
5f11dfda
...
...
@@ -565,7 +565,8 @@ static struct tcp_option *new_tcp_fast_open_option(const char *cookie_string,
%token <reserved> SSF_TYPE SSF_LENGTH SSF_FLAGS SSF_ERROR SSF_INFO SSF_ASSOC_ID SSF_DATA
%token <reserved> SAI_TYPE SAI_FLAGS SAI_LENGTH SAI_ADAPTATION_IND SAI_ASSOC_ID
%token <reserved> GAIDS_NUMBER_OF_IDS GAIDS_ASSOC_ID SSPP_ASSOC_ID SSPP_ADDR
%token <reserved> SN_TYPE SN_FLAGS SN_LENGTH
%token <reserved> SN_TYPE SN_FLAGS SN_LENGTH SAUTH_CHUNK
%token <reserved> SCA_ASSOC_ID SCA_KEYNUMBER SCA_KEYLENGTH SCA_KEY
%token <floating> FLOAT
%token <integer> INTEGER HEX_INTEGER
%token <string> WORD STRING BACK_QUOTED CODE IPV4_ADDR IPV6_ADDR
...
...
@@ -638,7 +639,7 @@ static struct tcp_option *new_tcp_fast_open_option(const char *cookie_string,
%type <expression> sctp_send_failed ssf_type ssf_length ssf_flags ssf_error ssf_info ssf_data
%type <expression> sctp_adaptation_event sai_type sai_flags sai_length sai_adaptation_ind
%type <expression> sctp_tlv sn_type sn_flags sn_length sctp_assoc_ids gaids_number_of_ids
%type <expression> sctp_setpeerprim
%type <expression> sctp_setpeerprim
sctp_authchunk sctp_authkey
%type <errno_info> opt_errno
%type <chunk_list> sctp_chunk_list_spec
%type <chunk_list_item> sctp_chunk_spec
...
...
@@ -2559,6 +2560,12 @@ expression
| sctp_setpeerprim {
$$ = $1;
}
| sctp_authchunk {
$$ = $1;
}
| sctp_authkey {
$$ = $1;
}
| null {
$$ = $1;
}
...
...
@@ -4833,6 +4840,46 @@ sctp_setpeerprim
$$->value.sctp_setpeerprim->sspp_addr = $4;
};
sctp_authchunk
: '{' SAUTH_CHUNK '=' INTEGER '}' {
$$ = new_expression(EXPR_SCTP_AUTHCHUNK);
$$->value.sctp_authchunk = calloc(1, sizeof(struct sctp_authchunk_expr));
if (!is_valid_u8($4)) {
semantic_error("sauth_chunk out of range");
}
$$->value.sctp_authchunk->sauth_chunk = new_integer_expression($4, "%hhu");
};
sctp_authkey
: '{' SCA_ASSOC_ID '=' sctp_assoc_id ',' SCA_KEYNUMBER '=' INTEGER ',' SCA_KEYLENGTH '=' INTEGER ',' SCA_KEY '=' array '}' {
$$ = new_expression(EXPR_SCTP_AUTHKEY);
$$->value.sctp_authkey = calloc(1, sizeof(struct sctp_authkey_expr));
$$->value.sctp_authkey->sca_assoc_id = $4;
if (!is_valid_u16($8)) {
semantic_error("sca_keynumber out of range");
}
$$->value.sctp_authkey->sca_keynumber = new_integer_expression($8, "%hu");
if (!is_valid_u16($12)) {
semantic_error("sca_keylength out of range");
}
$$->value.sctp_authkey->sca_keylength = new_integer_expression($12, "%hu");
$$->value.sctp_authkey->sca_key = $16;
}
| '{' SCA_KEYNUMBER '=' INTEGER ',' SCA_KEYLENGTH '=' INTEGER ',' SCA_KEY '=' array '}' {
$$ = new_expression(EXPR_SCTP_AUTHKEY);
$$->value.sctp_authkey = calloc(1, sizeof(struct sctp_authkey_expr));
$$->value.sctp_authkey->sca_assoc_id = new_expression(EXPR_ELLIPSIS);
if (!is_valid_u16($4)) {
semantic_error("sca_keynumber out of range");
}
$$->value.sctp_authkey->sca_keynumber = new_integer_expression($4, "%hu");
if (!is_valid_u16($8)) {
semantic_error("sca_keylength out of range");
}
$$->value.sctp_authkey->sca_keylength = new_integer_expression($8, "%hu");
$$->value.sctp_authkey->sca_key = $12;
};
opt_errno
: { $$ = NULL; }
| WORD note {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment