NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Enumerations
a
b
c
d
f
i
k
l
n
p
q
r
s
t
u
v
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Enumerations
_
a
c
e
r
s
t
v
+
Enumerator
a
c
d
e
f
h
i
l
m
n
p
r
s
u
v
w
+
Related Functions
a
b
c
d
e
f
g
i
k
l
m
n
o
p
s
v
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
+
Functions
b
c
d
e
f
g
h
m
o
p
r
s
t
u
v
w
+
Variables
a
b
c
d
e
f
g
i
k
l
m
n
p
r
s
t
+
Typedefs
b
c
d
e
i
m
p
s
u
w
Enumerations
Enumerator
+
Macros
_
a
b
d
e
i
l
m
n
o
p
r
s
t
u
v
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
udp-protocol.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#include "
udp-protocol.hpp
"
27
28
namespace
nfd
{
29
namespace
udp {
30
31
ssize_t
32
computeMtu
(
const
Endpoint
& localEndpoint)
33
{
34
size_t
mtu = 0;
35
if
(localEndpoint.address().is_v4()) {
// IPv4
36
mtu = std::numeric_limits<uint16_t>::max();
// maximum Total Length
37
mtu -=
sizeof
(uint32_t) * ((1 << 4) - 1);
// maximum Internet Header Length
38
}
39
else
{
// IPv6
40
mtu = std::numeric_limits<uint16_t>::max();
// maximum Payload Length
41
}
42
mtu -=
sizeof
(uint16_t) * 4;
// size of UDP header
43
return
mtu;
44
}
45
46
}
// namespace udp
47
}
// namespace nfd
nfd::udp::computeMtu
ssize_t computeMtu(const Endpoint &localEndpoint)
computes maximum payload size in a UDP packet
Definition:
udp-protocol.cpp:32
udp-protocol.hpp
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:39
nfd::udp::Endpoint
boost::asio::ip::udp::endpoint Endpoint
Definition:
udp-protocol.hpp:34
ndnSIM
NFD
daemon
face
udp-protocol.cpp
Generated on Fri May 6 2022 12:34:13 for ndnSIM by
1.8.13