Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
af02fa81
Commit
af02fa81
authored
Aug 05, 2014
by
Philip Withnall
Committed by
Olivier Crête
Aug 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pseudotcp: Put TCP options in an enum
This tidies things up a little. No functional changes.
parent
7ad14b88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
agent/pseudotcp.c
agent/pseudotcp.c
+19
-6
No files found.
agent/pseudotcp.c
View file @
af02fa81
...
...
@@ -160,10 +160,13 @@ const guint16 PACKET_MAXIMUMS[] = {
#define DEFAULT_RCV_BUF_SIZE (60 * 1024)
#define DEFAULT_SND_BUF_SIZE (90 * 1024)
#define TCP_OPT_EOL 0 // End of list.
#define TCP_OPT_NOOP 1 // No-op.
#define TCP_OPT_MSS 2 // Maximum segment size.
#define TCP_OPT_WND_SCALE 3 // Window scale factor.
/* NOTE: This must fit in 8 bits. This is used on the wire. */
typedef
enum
{
TCP_OPT_EOL
=
0
,
/* end of list */
TCP_OPT_NOOP
=
1
,
/* no-op */
TCP_OPT_MSS
=
2
,
/* maximum segment size */
TCP_OPT_WND_SCALE
=
3
,
/* window scale factor */
}
TcpOption
;
/*
...
...
@@ -1749,11 +1752,13 @@ static void
apply_option
(
PseudoTcpSocket
*
self
,
guint8
kind
,
const
guint8
*
data
,
guint32
len
)
{
if
(
kind
==
TCP_OPT_MSS
)
{
switch
(
kind
)
{
case
TCP_OPT_MSS
:
DEBUG
(
PSEUDO_TCP_DEBUG_NORMAL
,
"Peer specified MSS option which is not supported."
);
// TODO: Implement.
}
else
if
(
kind
==
TCP_OPT_WND_SCALE
)
{
break
;
case
TCP_OPT_WND_SCALE
:
// Window scale factor.
// http://www.ietf.org/rfc/rfc1323.txt
if
(
len
!=
1
)
{
...
...
@@ -1761,6 +1766,14 @@ apply_option (PseudoTcpSocket *self, guint8 kind, const guint8 *data,
return
;
}
apply_window_scale_option
(
self
,
data
[
0
]);
break
;
case
TCP_OPT_EOL
:
case
TCP_OPT_NOOP
:
/* Nothing to do. */
break
;
default:
DEBUG
(
PSEUDO_TCP_DEBUG_NORMAL
,
"Invalid TCP option %u"
,
kind
);
break
;
}
}
...
...
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