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
eaf9ad24
Commit
eaf9ad24
authored
9 years ago
by
Michael Tüxen
Browse files
Options
Downloads
Patches
Plain Diff
Add parser for I-DATA chunks.
parent
3f8db1c9
No related branches found
Branches containing commit
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
+3
-0
3 additions, 0 deletions
gtests/net/packetdrill/lexer.l
gtests/net/packetdrill/parser.y
+100
-3
100 additions, 3 deletions
gtests/net/packetdrill/parser.y
with
103 additions
and
3 deletions
gtests/net/packetdrill/lexer.l
+
3
−
0
View file @
eaf9ad24
...
...
@@ -236,6 +236,7 @@ COOKIE_ACK return COOKIE_ACK;
ECNE return ECNE;
CWR return CWR;
SHUTDOWN_COMPLETE return SHUTDOWN_COMPLETE;
I-DATA return I_DATA;
PAD return PAD;
type return TYPE;
flgs return FLAGS;
...
...
@@ -247,7 +248,9 @@ os return OS;
tsn return TSN;
sid return SID;
ssn return SSN;
mid return MID;
ppid return PPID;
fsn return FSN;
cum_tsn return CUM_TSN;
gaps return GAPS;
dups return DUPS;
...
...
This diff is collapsed.
Click to expand it.
gtests/net/packetdrill/parser.y
+
100
−
3
View file @
eaf9ad24
...
...
@@ -512,9 +512,9 @@ static struct tcp_option *new_tcp_fast_open_option(const char *cookie_string,
%token <reserved> SSTAT_PRIMARY;
%token <reserved> CHUNK DATA INIT INIT_ACK HEARTBEAT HEARTBEAT_ACK ABORT
%token <reserved> SHUTDOWN SHUTDOWN_ACK ERROR COOKIE_ECHO COOKIE_ACK ECNE CWR
%token <reserved> SHUTDOWN_COMPLETE PAD
%token <reserved> SHUTDOWN_COMPLETE
I_DATA
PAD
%token <reserved> TYPE FLAGS LEN
%token <reserved> TAG A_RWND OS IS TSN SID SSN
PPID
CUM_TSN GAPS DUPS
%token <reserved> TAG A_RWND OS IS TSN SID SSN
MID PPID FSN
CUM_TSN GAPS DUPS
%token <reserved> PARAMETER HEARTBEAT_INFORMATION IPV4_ADDRESS IPV6_ADDRESS
%token <reserved> STATE_COOKIE UNRECOGNIZED_PARAMETER COOKIE_PRESERVATIVE
%token <reserved> HOSTNAME_ADDRESS SUPPORTED_ADDRESS_TYPES ECN_CAPABLE
...
...
@@ -582,6 +582,7 @@ static struct tcp_option *new_tcp_fast_open_option(const char *cookie_string,
%type <chunk_list_item> sctp_cookie_echo_chunk_spec sctp_cookie_ack_chunk_spec
%type <chunk_list_item> sctp_ecne_chunk_spec sctp_cwr_chunk_spec
%type <chunk_list_item> sctp_shutdown_complete_chunk_spec
%type <chunk_list_item> sctp_i_data_chunk_spec
%type <chunk_list_item> sctp_pad_chunk_spec
%type <parameter_list> opt_parameter_list_spec sctp_parameter_list_spec
%type <parameter_list_item> sctp_parameter_spec
...
...
@@ -614,8 +615,9 @@ static struct tcp_option *new_tcp_fast_open_option(const char *cookie_string,
%type <cause_list_item> sctp_protocol_violation_cause_spec
%type <integer> opt_chunk_type opt_parameter_type opt_cause_code
%type <integer> opt_flags opt_data_flags opt_abort_flags
%type <integer> opt_shutdown_complete_flags opt_len
%type <integer> opt_shutdown_complete_flags
opt_i_data_flags
opt_len
%type <integer> opt_tag opt_a_rwnd opt_os opt_is opt_tsn opt_sid opt_ssn
%type <integer> opt_mid opt_fsn
%type <integer> opt_cum_tsn opt_ppid
%type <byte_list> opt_val opt_info byte_list
%type <byte_list_item> byte
...
...
@@ -832,6 +834,7 @@ sctp_chunk_spec
| sctp_ecne_chunk_spec { $$ = $1; }
| sctp_cwr_chunk_spec { $$ = $1; }
| sctp_shutdown_complete_chunk_spec { $$ = $1; }
| sctp_i_data_chunk_spec { $$ = $1; }
| sctp_pad_chunk_spec { $$ = $1; }
;
...
...
@@ -1044,6 +1047,64 @@ opt_shutdown_complete_flags
}
;
opt_i_data_flags
: FLAGS '=' ELLIPSIS { $$ = -1; }
| FLAGS '=' HEX_INTEGER {
if (!is_valid_u8($3)) {
semantic_error("flags value out of range");
}
$$ = $3;
}
| FLAGS '=' INTEGER {
if (!is_valid_u8($3)) {
semantic_error("flags value out of range");
}
$$ = $3;
}
| FLAGS '=' WORD {
u64 flags;
char *c;
flags = 0;
for (c = $3; *c != '\0'; c++) {
switch (*c) {
case 'I':
if (flags & SCTP_I_DATA_CHUNK_I_BIT) {
semantic_error("I-bit specified multiple times");
} else {
flags |= SCTP_I_DATA_CHUNK_I_BIT;
}
break;
case 'U':
if (flags & SCTP_I_DATA_CHUNK_U_BIT) {
semantic_error("U-bit specified multiple times");
} else {
flags |= SCTP_I_DATA_CHUNK_U_BIT;
}
break;
case 'B':
if (flags & SCTP_I_DATA_CHUNK_B_BIT) {
semantic_error("B-bit specified multiple times");
} else {
flags |= SCTP_I_DATA_CHUNK_B_BIT;
}
break;
case 'E':
if (flags & SCTP_I_DATA_CHUNK_E_BIT) {
semantic_error("E-bit specified multiple times");
} else {
flags |= SCTP_I_DATA_CHUNK_E_BIT;
}
break;
default:
semantic_error("Only expecting IUBE as flags");
break;
}
}
$$ = flags;
}
;
opt_tag
: TAG '=' ELLIPSIS { $$ = -1; }
| TAG '=' INTEGER {
...
...
@@ -1114,6 +1175,16 @@ opt_ssn
}
;
opt_mid
: MID '=' ELLIPSIS { $$ = -1; }
| MID '=' INTEGER {
if (!is_valid_u32($3)) {
semantic_error("mid value out of range");
}
$$ = $3;
}
;
opt_ppid
: PPID '=' ELLIPSIS { $$ = -1; }
| PPID '=' INTEGER {
...
...
@@ -1124,6 +1195,16 @@ opt_ppid
}
;
opt_fsn
: FSN '=' ELLIPSIS { $$ = -1; }
| FSN '=' INTEGER {
if (!is_valid_u32($3)) {
semantic_error("fsn value out of range");
}
$$ = $3;
}
;
opt_cum_tsn
: CUM_TSN '=' ELLIPSIS { $$ = -1; }
| CUM_TSN '=' INTEGER {
...
...
@@ -1289,6 +1370,22 @@ sctp_shutdown_complete_chunk_spec
$$ = sctp_shutdown_complete_chunk_new($3);
}
sctp_i_data_chunk_spec
: I_DATA '[' opt_i_data_flags ',' opt_len ',' opt_tsn ',' opt_sid ',' opt_mid ',' opt_ppid ']' {
if (($5 != -1) &&
(!is_valid_u16($5) || ($5 < sizeof(struct sctp_i_data_chunk)))) {
semantic_error("length value out of range");
}
$$ = sctp_i_data_chunk_new($3, $5, $7, $9, 0, $11, $13, -1);
}
| I_DATA '[' opt_i_data_flags ',' opt_len ',' opt_tsn ',' opt_sid ',' opt_mid ',' opt_fsn ']' {
if (($5 != -1) &&
(!is_valid_u16($5) || ($5 < sizeof(struct sctp_i_data_chunk)))) {
semantic_error("length value out of range");
}
$$ = sctp_i_data_chunk_new($3, $5, $7, $9, 0, $11, -1, $13);
}
sctp_pad_chunk_spec
: PAD '[' opt_flags ',' opt_len ',' VAL '=' ELLIPSIS ']' {
if (($5 != -1) &&
...
...
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