Choco OS  V.0.16.9.0
Join to the chocolate world
PACKED Struct Reference

stores IPv6 address More...

#include <oc_net.h>

Data Fields

uint64_t LowPart
 Low 8 bytes of the IPv6 address.
 
uint64_t HighPart
 High 8 bytes of the IPv6 address.
 
uint32_t Version:4
 4 bits, that contain the version, that specified if it's an IPv4 or IPv6 packet More...
 
uint32_t IHL:4
 4 bits, that contain Internet Header Length, which is the length of the header in multiples of 4 (number of words - NOT BYTES!!!)
 
uint32_t QoS:8
 Quality of Service or Type of Service - describes the priority of the packet
 
uint32_t Length:16
 Length of the packet in bytes.
 
uint32_t ID:16
 ID value for reconstruction the packet from segments.
 
uint32_t FragmentOffset:13
 Field to identify position of fragment within original packet.
 
uint32_t MF:1
 More Fragments - whether more fragments of a packet follow
 
uint32_t DF:1
 Don't Fragment - packet can be fragmented or not
 
uint32_t Reserved:1
 This is always 0.
 
uint32_t TTL:8
 Time to live - number of hops the packet is allowed to pass before it dies. More...
 
uint32_t Protocol:8
 Contains selected protocol (TCP/UDP/ICMP,etc). More...
 
uint32_t Checksum:16
 Header checksum - number used for errors detection.
 
oC_Net_Ipv4_t SourceIp
 Source IP address.
 
oC_Net_Ipv4_t DestinationIp
 Destination IP address.
 
uint32_t TrafficClass:8
 The bits of this field hold two values. More...
 
uint32_t FlowLabel:20
 Originally created for tracking, now it's only a hint for routers and switches. More...
 
uint32_t PayloadLength:16
 Size of the payload in octets (bytes)
 
uint32_t NextHeader:8
 Specifies the type of the next header in the packet (TCP/UDP,etc)
 
uint32_t HopLimit:8
 The same as TTL from the IPv4 header - time of packet's live. More...
 
oC_Net_Ipv6_t Source
 Source IP address.
 
oC_Net_Ipv6_t Destination
 Destination IP address.
 
oC_Net_Ipv4PacketHeader_t Header
 Header of the IPv4 packet.
 
uint8_t Data [IPv4_MAXIMUM_DATA_LENGTH]
 Data of the packet. More...
 
oC_Net_Ipv6PacketHeader_t Header
 Header of the IPv6 packet.
 
uint32_t Operation:8
 Specifies type of the message. More...
 
uint32_t HardwareType:8
 Hardware Type - specifies type of the hardware used in the local network. More...
 
uint32_t HardwareAddressLength:8
 Length of the hardware address in bytes.
 
uint32_t Hops:8
 Set to 0 by a client when transmitting a request and used by relay agents to control the forwarding of BOOT and/or DHCP messages.
 
uint32_t XID
 Transaction ID Generated by the client to allow it to match up the request with replies received from DHCP servers
 
uint32_t Secs:16
 Seconds - In BOOTP this field was vaguely defined and not always used. More...
 
uint32_t Flags:16
 Flags of the message, look at oC_Dhcp_Flags_t type for more.
 
uint32_t CIAddr
 Client IP Address - If a client has IP address and it is valid (while BOUND, RENEWING or REBINDING states) it has to fill this field by it, otherwise it should be set to 0. More...
 
uint32_t YIAddr
 Your IP Address - the server fills it as the proposed IP address for the client
 
uint32_t SIAddr
 Server IP Address - the server fills it with its own address, that should be used for the states after DISCOVER
 
uint32_t GIAddr
 Gateway IP Address - a router IP
 
uint8_t CHAddr [16]
 Client Hardware Address - the hardware address of the client used for identification and communication
 
char SName [64]
 Server Name - The server can optionally put its name in this field
 
char File [128]
 Boot Filename - Optionally used by the client to request a particular type of boot file in a DISCOVER message
 
uint32_t MagicCookie
 Magic cookie - set to oC_DHCP_MAGIC_COOKIE (0x63825363) to identify the information as vendor independent option fields
 
uint8_t Options [oC_DHCP_OPTIONS_BUFFER_SIZE]
 Additional options array.
 
uint16_t SourcePort
 This field identifies the sender's port when meaningful and should be assumed to be the port to reply to if needed. More...
 
uint16_t DestinationPort
 This field identifies the receiver's port and is required. More...
 
uint16_t Length
 A field that specifies the length in bytes of the UDP header and UDP data. More...
 
uint16_t Checksum
 The checksum field may be used for error-checking of the header and data. More...
 
oC_Udp_Header_t Header
 Header of the UDP packet.
 
uint16_t HTYPE
 Hardware type.
 
uint16_t PTYPE
 Protocol type.
 
uint8_t HLEN
 Hardware address length.
 
uint8_t PLEN
 Protocol address length.
 
uint16_t OPER
 Operation (1 is request, 2 is reply)
 
uint8_t AddressArray [4]
 Array with addresses.
 

Detailed Description

stores UDP datagram

pseudo UDP header required only for checksum calculation

stores UDP header

stores DHCP message

stores IPv6 packet

stores IPv4 packet

contains IPv6 packet header

contains IPv4 packet header

The type is for storing IP address in ver. 6

The type stores IPv4 packet header.

The type is for storing IPv6 packet header

The type is for storing packets in IPv4 format

The type is for storing packets in IPv6 format

The type is for storing DHCP message format.

Definition at line 142 of file oc_net.h.

Field Documentation

uint16_t Checksum

This field is optional in IPv4, and mandatory in IPv6.[6] The field carries all-zeros if unused

Definition at line 252 of file oc_udp.h.

uint32_t CIAddr

Definition at line 219 of file oc_dhcp.h.

uint8_t Data

First byte of the UDP packet data.

Definition at line 277 of file oc_net.h.

uint16_t DestinationPort

Similar to source port number, if the client is the destination host then the port number will likely be an ephemeral port number and if the destination host is the server then the port number will likely be a well-known port number

Definition at line 250 of file oc_udp.h.

uint32_t FlowLabel

Definition at line 253 of file oc_net.h.

uint32_t HardwareType

You can assign values from the oC_Dhcp_HardwareType_t type.

Definition at line 213 of file oc_dhcp.h.

uint32_t HopLimit

Definition at line 256 of file oc_net.h.

uint16_t Length

The minimum length is 8 bytes because that is the length of the header. The field size sets a theoretical limit of 65,535 bytes (8 byte header + 65,527 bytes of data) for a UDP datagram. The practical limit for the data length which is imposed by the underlying IPv4 protocol is 65,507 bytes

Definition at line 251 of file oc_udp.h.

uint32_t Operation

A value 1 indicates a request message, while a value 2 is a reply message. You can use oC_Dhcp_OperationCode_t type to assign this value

Definition at line 212 of file oc_dhcp.h.

uint32_t Protocol

You can use oC_Net_Protocol_t type to assign a value to this field

Definition at line 229 of file oc_net.h.

uint32_t Secs

For DHCP, it is defined as the number of seconds elapsed since a client began an attempt to acquire or renew a lease. This may be used by a busy DHCP server to prioritize replies when multiple client requests are outstanding.

Definition at line 217 of file oc_dhcp.h.

uint16_t SourcePort

If not used, then it should be zero. If the source host is the client, the port number is likely to be an ephemeral port number. If the source host is the server, the port number is likely to be a well-known port number

Definition at line 249 of file oc_udp.h.

uint32_t TrafficClass

The 6 most-significant bits are used for differentiated services, which is used to classify packets.[2][3] The remaining two bits are used for ECN;[4] priority values subdivide into ranges: traffic where the source provides congestion control and non-congestion control traffic.

Definition at line 252 of file oc_net.h.

uint32_t TTL

It is to prevent circuits in the network.

Definition at line 228 of file oc_net.h.

uint32_t Version

The constant 6 (0b0110)

Definition at line 219 of file oc_net.h.


The documentation for this struct was generated from the following files: