ns3::Ipv4Header Class Reference
Packet header for IPv4.
More...
#include <ipv4-header.h>
List of all members.
Detailed Description
Packet header for IPv4.
Member Function Documentation
virtual uint32_t ns3::Ipv4Header::Deserialize |
( |
Buffer::Iterator |
start |
) |
[virtual] |
- Parameters:
-
| start | an iterator which points to where the header should written. |
- Returns:
- the number of bytes read.
This method is used by
Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.
Implements ns3::Header.
Ipv4Address ns3::Ipv4Header::GetDestination |
( |
void |
|
) |
const |
- Returns:
- the destination address of this packet
uint16_t ns3::Ipv4Header::GetFragmentOffset |
( |
void |
|
) |
const |
- Returns:
- the offset of this fragment.
uint16_t ns3::Ipv4Header::GetIdentification |
( |
void |
|
) |
const |
- Returns:
- the identification field of this packet.
virtual TypeId ns3::Ipv4Header::GetInstanceTypeId |
( |
void |
|
) |
const [virtual] |
uint16_t ns3::Ipv4Header::GetPayloadSize |
( |
void |
|
) |
const |
- Returns:
- the size of the payload in bytes
uint8_t ns3::Ipv4Header::GetProtocol |
( |
void |
|
) |
const |
- Returns:
- the protocol field of this packet
virtual uint32_t ns3::Ipv4Header::GetSerializedSize |
( |
void |
|
) |
const [virtual] |
- Returns:
- the expected size of the header.
This method is used by
Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.
Implements ns3::Header.
- Returns:
- the source address of this packet
uint8_t ns3::Ipv4Header::GetTos |
( |
void |
|
) |
const |
- Returns:
- the TOS field of this packet.
uint8_t ns3::Ipv4Header::GetTtl |
( |
void |
|
) |
const |
- Returns:
- the TTL field of this packet
static TypeId ns3::Ipv4Header::GetTypeId |
( |
void |
|
) |
[static] |
This method returns the TypeId associated to ns3::Ipv4Header.
No Attributes defined for this type.
No TraceSources defined for this type.
Reimplemented from ns3::Header.
bool ns3::Ipv4Header::IsChecksumOk |
( |
void |
|
) |
const |
- Returns:
- true if the ipv4 checksum is correct, false otherwise.
If Ipv4Header::EnableChecksums has not been called prior to deserializing this header, this method will always return true.
bool ns3::Ipv4Header::IsDontFragment |
( |
void |
|
) |
const |
- Returns:
- true if this is this packet can be fragmented.
bool ns3::Ipv4Header::IsLastFragment |
( |
void |
|
) |
const |
- Returns:
- true if this is the last fragment of a packet, false otherwise.
virtual void ns3::Ipv4Header::Print |
( |
std::ostream & |
os |
) |
const [virtual] |
This method is used by Packet::Print to print the content of a trailer as ascii data to a c++ output stream. Although the trailer is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5
Implements ns3::Header.
virtual void ns3::Ipv4Header::Serialize |
( |
Buffer::Iterator |
start |
) |
const [virtual] |
- Parameters:
-
| start | an iterator which points to where the header should be written. |
This method is used by
Packet::AddHeader to store a header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.
Implements ns3::Header.
void ns3::Ipv4Header::SetDestination |
( |
Ipv4Address |
destination |
) |
|
- Parameters:
-
| destination | the destination of this packet. |
void ns3::Ipv4Header::SetDontFragment |
( |
void |
|
) |
|
Don't fragment this packet: if you need to anyway, drop it.
void ns3::Ipv4Header::SetFragmentOffset |
( |
uint16_t |
offset |
) |
|
- Parameters:
-
| offset | the ipv4 fragment offset |
void ns3::Ipv4Header::SetIdentification |
( |
uint16_t |
identification |
) |
|
- Parameters:
-
| identification | the Identification field of IPv4 packets. |
By default, set to zero.
void ns3::Ipv4Header::SetLastFragment |
( |
void |
|
) |
|
This packet is the last packet of a fragmented ipv4 packet.
void ns3::Ipv4Header::SetMayFragment |
( |
void |
|
) |
|
If you need to fragment this packet, you can do it.
void ns3::Ipv4Header::SetMoreFragments |
( |
void |
|
) |
|
This packet is not the last packet of a fragmented ipv4 packet.
void ns3::Ipv4Header::SetPayloadSize |
( |
uint16_t |
size |
) |
|
- Parameters:
-
| size | the size of the payload in bytes |
void ns3::Ipv4Header::SetProtocol |
( |
uint8_t |
num |
) |
|
- Parameters:
-
| num | the ipv4 protocol field |
- Parameters:
-
| source | the source of this packet |
void ns3::Ipv4Header::SetTos |
( |
uint8_t |
tos |
) |
|
- Parameters:
-
| tos | the 8 bits of Ipv4 TOS. |
void ns3::Ipv4Header::SetTtl |
( |
uint8_t |
ttl |
) |
|
The documentation for this class was generated from the following files:
- src/node/ipv4-header.h
- doc/introspected-doxygen.h