Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
74221764
Commit
74221764
authored
Aug 09, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pscketsk: Add loss and timestamp sockoptions
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
d29feb91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
packet-sock.proto
protobuf/packet-sock.proto
+2
-0
sk-packet.c
sk-packet.c
+16
-0
No files found.
protobuf/packet-sock.proto
View file @
74221764
...
...
@@ -16,4 +16,6 @@ message packet_sock_entry {
required
bool
aux_data
=
10
;
required
bool
orig_dev
=
11
;
required
bool
vnet_hdr
=
12
;
required
bool
loss
=
13
;
required
uint32
timestamp
=
14
;
}
sk-packet.c
View file @
74221764
...
...
@@ -59,6 +59,9 @@ static int dump_one_packet_fd(int lfd, u32 id, const struct fd_parms *p)
if
(
dump_opt
(
lfd
,
SOL_PACKET
,
PACKET_RESERVE
,
&
psk
.
reserve
))
return
-
1
;
if
(
dump_opt
(
lfd
,
SOL_PACKET
,
PACKET_TIMESTAMP
,
&
psk
.
timestamp
))
return
-
1
;
if
(
dump_opt
(
lfd
,
SOL_PACKET
,
PACKET_AUXDATA
,
&
yes
))
return
-
1
;
psk
.
aux_data
=
(
yes
?
true
:
false
);
...
...
@@ -71,6 +74,10 @@ static int dump_one_packet_fd(int lfd, u32 id, const struct fd_parms *p)
return
1
;
psk
.
vnet_hdr
=
(
yes
?
true
:
false
);
if
(
dump_opt
(
lfd
,
SOL_PACKET
,
PACKET_LOSS
,
&
yes
))
return
1
;
psk
.
loss
=
(
yes
?
true
:
false
);
return
pb_write_one
(
fdset_fd
(
glob_fdset
,
CR_FD_PACKETSK
),
&
psk
,
PB_PACKETSK
);
}
...
...
@@ -118,6 +125,9 @@ static int open_packet_sk(struct file_desc *d)
if
(
restore_opt
(
sk
,
SOL_PACKET
,
PACKET_RESERVE
,
&
pse
->
reserve
))
goto
err_cl
;
if
(
restore_opt
(
sk
,
SOL_PACKET
,
PACKET_TIMESTAMP
,
&
pse
->
timestamp
))
goto
err_cl
;
if
(
pse
->
aux_data
)
{
yes
=
1
;
if
(
restore_opt
(
sk
,
SOL_PACKET
,
PACKET_AUXDATA
,
&
yes
))
...
...
@@ -136,6 +146,12 @@ static int open_packet_sk(struct file_desc *d)
goto
err_cl
;
}
if
(
pse
->
loss
)
{
yes
=
1
;
if
(
restore_opt
(
sk
,
SOL_PACKET
,
PACKET_LOSS
,
&
yes
))
goto
err_cl
;
}
if
(
rst_file_params
(
sk
,
pse
->
fown
,
pse
->
flags
))
goto
err_cl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment