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
0ed7b165
Commit
0ed7b165
authored
9 years ago
by
hoelscher
Browse files
Options
Downloads
Patches
Plain Diff
Modify codestyle
parent
9a4b2aee
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/parser.y
+14
-14
14 additions, 14 deletions
gtests/net/packetdrill/parser.y
gtests/net/packetdrill/run_system_call.c
+13
-10
13 additions, 10 deletions
gtests/net/packetdrill/run_system_call.c
with
27 additions
and
24 deletions
gtests/net/packetdrill/parser.y
+
14
−
14
View file @
0ed7b165
...
@@ -2277,34 +2277,34 @@ pollfd
...
@@ -2277,34 +2277,34 @@ pollfd
;
;
opt_revents
opt_revents
: { $$ = new_integer_expression(0, "%ld"
); }
: { $$ = new_integer_expression(0, "%ld"); }
| ',' REVENTS '=' expression { $$ = $4; }
| ',' REVENTS '=' expression { $$ = $4; }
;
;
l_onoff
l_onoff
: ONOFF '=' INTEGER {
: ONOFF '=' INTEGER {
if (!is_valid_s32($3)){
if (!is_valid_s32($3))
{
semantic_error("linger onoff out of range");
semantic_error("linger onoff out of range");
} else {
} else {
$$ = new_integer_expression(
$3, "%ld"
);
$$ = new_integer_expression($3, "%ld");
}
}
}
}
| ONOFF '=' ELLIPSIS { $$ = new_expression(
EXPR_ELLIPSIS
); }
| ONOFF '=' ELLIPSIS { $$ = new_expression(EXPR_ELLIPSIS); }
;
;
l_linger
l_linger
: LINGER '=' INTEGER {
: LINGER '=' INTEGER {
if (!is_valid_s32($3)){
if (!is_valid_s32($3))
{
semantic_error("linger out of range");
semantic_error("linger out of range");
}
}
$$ = new_integer_expression(
$3, "%ld");
$$ = new_integer_expression($3, "%ld");
}
}
| LINGER '=' ELLIPSIS { $$ = new_expression(
EXPR_ELLIPSIS
); }
| LINGER '=' ELLIPSIS { $$ = new_expression(EXPR_ELLIPSIS); }
;
;
linger
linger
: '{' l_onoff ',' l_linger '}' {
: '{' l_onoff ',' l_linger '}' {
$$ = new_expression(
EXPR_LINGER
);
$$ = new_expression(EXPR_LINGER);
$$->value.linger = (struct linger_expr*) calloc(1, sizeof(struct linger_expr));
$$->value.linger = (struct linger_expr*) calloc(1, sizeof(struct linger_expr));
$$->value.linger->l_onoff = $2;
$$->value.linger->l_onoff = $2;
$$->value.linger->l_linger = $4;
$$->value.linger->l_linger = $4;
...
@@ -2316,9 +2316,9 @@ srto_initial
...
@@ -2316,9 +2316,9 @@ srto_initial
if (!is_valid_u32($3)){
if (!is_valid_u32($3)){
semantic_error("srto_initial out of range");
semantic_error("srto_initial out of range");
}
}
$$ = new_integer_expression(
$3, "%u");
$$ = new_integer_expression($3, "%u");
}
}
| SRTO_INITIAL '=' ELLIPSIS { $$ = new_expression(
EXPR_ELLIPSIS
); }
| SRTO_INITIAL '=' ELLIPSIS { $$ = new_expression(EXPR_ELLIPSIS); }
;
;
srto_max
srto_max
...
@@ -2326,9 +2326,9 @@ srto_max
...
@@ -2326,9 +2326,9 @@ srto_max
if (!is_valid_u32($3)) {
if (!is_valid_u32($3)) {
semantic_error("srto_max out of range");
semantic_error("srto_max out of range");
}
}
$$ = new_integer_expression(
$3, "%u");
$$ = new_integer_expression($3, "%u");
}
}
| SRTO_MAX '=' ELLIPSIS { $$ = new_expression(
EXPR_ELLIPSIS
); }
| SRTO_MAX '=' ELLIPSIS { $$ = new_expression(EXPR_ELLIPSIS); }
;
;
srto_min
srto_min
...
@@ -2336,9 +2336,9 @@ srto_min
...
@@ -2336,9 +2336,9 @@ srto_min
if (!is_valid_u32($3)) {
if (!is_valid_u32($3)) {
semantic_error("srto_min out of range");
semantic_error("srto_min out of range");
}
}
$$ = new_integer_expression(
$3, "%u");
$$ = new_integer_expression($3, "%u");
}
}
| SRTO_MIN '=' ELLIPSIS { $$ = new_expression(
EXPR_ELLIPSIS
); }
| SRTO_MIN '=' ELLIPSIS { $$ = new_expression(EXPR_ELLIPSIS); }
;
;
sctp_rtoinfo
sctp_rtoinfo
...
...
This diff is collapsed.
Click to expand it.
gtests/net/packetdrill/run_system_call.c
+
13
−
10
View file @
0ed7b165
...
@@ -1586,7 +1586,7 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
...
@@ -1586,7 +1586,7 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
live_optlen
=
(
socklen_t
)
sizeof
(
struct
linger
);
live_optlen
=
(
socklen_t
)
sizeof
(
struct
linger
);
#ifdef SCTP_RTOINFO
#ifdef SCTP_RTOINFO
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_RTOINFO
)
{
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_RTOINFO
)
{
live_optval
=
c
alloc
(
1
,
sizeof
(
struct
sctp_rtoinfo
));
live_optval
=
m
alloc
(
sizeof
(
struct
sctp_rtoinfo
));
live_optlen
=
(
socklen_t
)
sizeof
(
struct
sctp_rtoinfo
);
live_optlen
=
(
socklen_t
)
sizeof
(
struct
sctp_rtoinfo
);
((
struct
sctp_rtoinfo
*
)
live_optval
)
->
srto_assoc_id
=
0
;
((
struct
sctp_rtoinfo
*
)
live_optval
)
->
srto_assoc_id
=
0
;
#endif
#endif
...
@@ -1764,7 +1764,7 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
...
@@ -1764,7 +1764,7 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
if
(
val_expression
==
NULL
)
if
(
val_expression
==
NULL
)
return
STATUS_ERR
;
return
STATUS_ERR
;
if
(
val_expression
->
type
==
EXPR_LINGER
)
{
if
(
val_expression
->
type
==
EXPR_LINGER
)
{
optval
=
malloc
(
sizeof
(
struct
linger
));
optval
=
malloc
(
sizeof
(
struct
linger
));
get_s32
(
val_expression
->
value
.
linger
->
l_onoff
,
get_s32
(
val_expression
->
value
.
linger
->
l_onoff
,
&
(((
struct
linger
*
)
optval
)
->
l_onoff
),
error
);
&
(((
struct
linger
*
)
optval
)
->
l_onoff
),
error
);
get_s32
(
val_expression
->
value
.
linger
->
l_linger
,
get_s32
(
val_expression
->
value
.
linger
->
l_linger
,
...
@@ -1777,17 +1777,20 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
...
@@ -1777,17 +1777,20 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
optval
=
&
optval_s32
;
optval
=
&
optval_s32
;
#ifdef SCTP_RTOINFO
#ifdef SCTP_RTOINFO
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_RTOINFO
)
{
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_RTOINFO
)
{
if
(
val_expression
->
value
.
sctp_rtoinfo
->
srto_initial
->
type
!=
EXPR_INTEGER
||
struct
sctp_rtoinfo
*
rtoinfo
;
val_expression
->
value
.
sctp_rtoinfo
->
srto_max
->
type
!=
EXPR_INTEGER
||
struct
sctp_rtoinfo_expr
*
expr_rtoinfo
=
val_expression
->
value
.
sctp_rtoinfo
;
val_expression
->
value
.
sctp_rtoinfo
->
srto_min
->
type
!=
EXPR_INTEGER
)
{
if
(
expr_rtoinfo
->
srto_initial
->
type
!=
EXPR_INTEGER
||
expr_rtoinfo
->
srto_max
->
type
!=
EXPR_INTEGER
||
expr_rtoinfo
->
srto_min
->
type
!=
EXPR_INTEGER
)
{
asprintf
(
error
,
"Bad setsockopt, bad inputtype for rtoinfo"
);
asprintf
(
error
,
"Bad setsockopt, bad inputtype for rtoinfo"
);
return
STATUS_ERR
;
return
STATUS_ERR
;
}
}
optval
=
malloc
(
sizeof
(
struct
sctp_rtoinfo
));
rtoinfo
=
malloc
(
sizeof
(
struct
sctp_rtoinfo
));
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_initial
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_initial
->
value
.
num
;
rtoinfo
->
srto_initial
=
expr_rtoinfo
->
srto_initial
->
value
.
num
;
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_max
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_max
->
value
.
num
;
rtoinfo
->
srto_max
=
expr_rtoinfo
->
srto_max
->
value
.
num
;
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_min
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_min
->
value
.
num
;
rtoinfo
->
srto_min
=
expr_rtoinfo
->
srto_min
->
value
.
num
;
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_assoc_id
=
0
;
rtoinfo
->
srto_assoc_id
=
0
;
optval
=
rtoinfo
;
#endif
#endif
#ifdef SCTP_INITMSG
#ifdef SCTP_INITMSG
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_INITMSG
)
{
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_INITMSG
)
{
...
...
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