Network Component  Version 7.13.1
MDK Middleware for IPv4 and IPv6 Networking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
NetIP4: IP4 Core

Events generated by the Network - IPv4 Core functions. More...

Functions

__STATIC_INLINE void EvrNetIP4_InitCore (uint16_t if_id)
 Event on IP4 core initialize (Op) More...
 
__STATIC_INLINE void EvrNetIP4_ReceiveFrame (uint16_t if_id, uint32_t length)
 Event on IP4 receive frame (Op) More...
 
__STATIC_INLINE void EvrNetIP4_FrameTooShort (uint16_t if_id, uint32_t length, uint32_t min_length)
 Event on IP4 receive frame too short (Error) More...
 
__STATIC_INLINE void EvrNetIP4_InvalidIpVersion (uint16_t if_id, uint8_t ip_version)
 Event on IP4 invalid protocol version (Error) More...
 
__STATIC_INLINE void EvrNetIP4_ShowFrameHeader (const void *ip4_header)
 Event on IP4 display frame header (Detail) More...
 
__STATIC_INLINE void EvrNetIP4_SourceIpAddressInvalid (uint16_t if_id, const uint8_t *ip4_addr)
 Event on IP4 source IP address invalid (Error) More...
 
__STATIC_INLINE void EvrNetIP4_WrongMulticastProtocol (uint16_t if_id, uint8_t ip4_protocol)
 Event on IP4 wrong multicast protocol type (Error) More...
 
__STATIC_INLINE void EvrNetIP4_WrongBroadcastProtocol (uint16_t if_id, uint8_t ip4_protocol)
 Event on IP4 wrong broadcast protocol type (Error) More...
 
__STATIC_INLINE void EvrNetIP4_WrongDestinationAddress (uint16_t if_id, const uint8_t *ip4_addr)
 Event on IP4 wrong destination address (Op) More...
 
__STATIC_INLINE void EvrNetIP4_ChecksumFailed (uint16_t if_id, uint32_t length)
 Event on IP4 header checksum check failed (Error) More...
 
__STATIC_INLINE void EvrNetIP4_FragmentDfFlagSet (uint16_t if_id, uint16_t frag)
 Event on IP4 receive fragmented frame with DF-flag set (Error) More...
 
__STATIC_INLINE void EvrNetIP4_FragmentationNotEnabled (uint16_t if_id)
 Event on IP4 receive fragmented frame (Error) More...
 
__STATIC_INLINE void EvrNetIP4_SendFrame (uint16_t if_id, uint8_t ip4_protocol, uint32_t length)
 Event on IP4 send frame (Op) More...
 
__STATIC_INLINE void EvrNetIP4_ProtocolUnknown (uint16_t if_id, uint8_t ip4_protocol)
 Event on IP4 unknown protocol type in sending frame (Error) More...
 
__STATIC_INLINE void EvrNetIP4_DestinationAddressNull (uint16_t if_id)
 Event on IP4 destination address not provided (Error) More...
 
__STATIC_INLINE void EvrNetIP4_SetDefaultInterface (uint16_t if_id)
 Event on IP4 set default interface for internet access (Op) More...
 
__STATIC_INLINE void EvrNetIP4_UninitCore (void)
 Event on IP4 core de-initialize (Op) More...
 

Description

Events generated by the Network - IPv4 Core functions.

The Network IPv4 Core functions generate events that report events in the network core of Internet Protocol version 4 and help in troubleshooting.

Function Documentation

__STATIC_INLINE void EvrNetIP4_ChecksumFailed ( uint16_t  if_id,
uint32_t  length 
)

Event on IP4 header checksum check failed (Error)

Parameters
if_idnetwork interface identifier
lengthheader length in bytes

The event ChecksumFailed is created when the network library has checked the checksum on the received IPv4 frame header and the verification failed. The IP frame is therefore discarded.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • len: length of the IPv4 frame header in bytes.
__STATIC_INLINE void EvrNetIP4_DestinationAddressNull ( uint16_t  if_id)

Event on IP4 destination address not provided (Error)

Parameters
if_idnetwork interface identifier

The event DestinationAddressNull is created when the internal send_frame function wants to send the IPv4 frame and finds out, that the destination address is not specified. The IP header can not be created and therefore the frame is not sent.

Value in the Event Recorder shows:

  • netif: network interface identifier.
__STATIC_INLINE void EvrNetIP4_FragmentationNotEnabled ( uint16_t  if_id)

Event on IP4 receive fragmented frame (Error)

Parameters
if_idnetwork interface identifier

The event FragmentationNotEnabled is created when the network library receives the IP frame fragment, but the IP fragmentation is disabled in the network configuration. The IP frame is therefore discarded.

Value in the Event Recorder shows:

  • netif: network interface identifier.
__STATIC_INLINE void EvrNetIP4_FragmentDfFlagSet ( uint16_t  if_id,
uint16_t  frag 
)

Event on IP4 receive fragmented frame with DF-flag set (Error)

Parameters
if_idnetwork interface identifier
fragIP flags and fragment offset

The event FragmentDfFlagSet is created when the network library has checked the IP flags and fragment offset and found the inconsistency. The IP flag Dont Fragment was set in the frame fragment. The IP frame is therefore discarded.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • flags: IP flags.
  • frag_offs: fragment offset.
__STATIC_INLINE void EvrNetIP4_FrameTooShort ( uint16_t  if_id,
uint32_t  length,
uint32_t  min_length 
)

Event on IP4 receive frame too short (Error)

Parameters
if_idnetwork interface identifier
lengthframe length in bytes
min_lengthminimum length of the frame

The event FrameTooShort is created when the network library receives the IPv4 frame that is too short. The frame is discarded.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • len: length of the received frame in bytes.
  • min: minimum valid frame length in bytes.
__STATIC_INLINE void EvrNetIP4_InitCore ( uint16_t  if_id)

Event on IP4 core initialize (Op)

Parameters
if_idnetwork interface identifier

The event InitCore is created when the IPv4 core is initialized, that is, when the function netInitialize is executed. It also informs you of the default network interface assigned to access the Internet.

Value in the Event Recorder shows:

  • default: default network interface for internet access.
__STATIC_INLINE void EvrNetIP4_InvalidIpVersion ( uint16_t  if_id,
uint8_t  ip_version 
)

Event on IP4 invalid protocol version (Error)

Parameters
if_idnetwork interface identifier
ip_versionIP protocol version value

The event InvalidIpVersion is created when the network library receives an IPv4 frame that has an unrecognized IP version encoded in the IPv4 header. The IP version should be 4, all other values are invalid. The frame is therefore discarded.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • ver: received IP protocol version.
__STATIC_INLINE void EvrNetIP4_ProtocolUnknown ( uint16_t  if_id,
uint8_t  ip4_protocol 
)

Event on IP4 unknown protocol type in sending frame (Error)

Parameters
if_idnetwork interface identifier
ip4_protocolunknown IPv4 protocol type value

The event ProtocolUnknown is created when the network library wants to send the IPv4 frame, but the provided IPv4 protocol type is not supported. The frame is therefore not sent.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • proto: unknown protocol type.
__STATIC_INLINE void EvrNetIP4_ReceiveFrame ( uint16_t  if_id,
uint32_t  length 
)

Event on IP4 receive frame (Op)

Parameters
if_idnetwork interface identifier
lengthframe length in bytes

The event ReceiveFrame is created when the network library receives the IPv4 frame. The frame can come from any interface.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • len: length of the received IPv4 frame in bytes.
__STATIC_INLINE void EvrNetIP4_SendFrame ( uint16_t  if_id,
uint8_t  ip4_protocol,
uint32_t  length 
)

Event on IP4 send frame (Op)

Parameters
if_idnetwork interface identifier
ip4_protocolIPv4 protocol type
  • 1: ICMP
  • 2: IGMP
  • 6: TCP
  • 17: UDP
lengthframe length

The event SendFrame is created when the internal send_frame function wants to send the IPv4 frame. The IP header is constructed and the frame is sent to the transfer interface.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • proto: IP protocol type (ICMP, IGMP, TCP, UDP).
  • len: length of the IPv4 frame payload.
__STATIC_INLINE void EvrNetIP4_SetDefaultInterface ( uint16_t  if_id)

Event on IP4 set default interface for internet access (Op)

Parameters
if_idnetwork interface identifier

The event SetDefaultInterface is created when the system wants to change the network interface used to access the internet. This usually happens when the netIF_SetDefault function is executed.

Value in the Event Recorder shows:

  • netif: network interface identifier.
__STATIC_INLINE void EvrNetIP4_ShowFrameHeader ( const void *  ip4_header)

Event on IP4 display frame header (Detail)

Parameters
ip4_headerpointer to IPv4 frame header of 20 bytes
  • VerHlen (1 byte)
  • Tos (1 byte)
  • Len (2 bytes)
  • Id (2 bytes)
  • FragOffs (2 bytes)
  • Ttl (1 byte)
  • Proto (1 byte)
  • Chksum (2 bytes)
  • SrcAddr (4 bytes)
  • DstAddr (4 bytes)

The event ShowFrameHeader is created when the network library wants to display detailed information about the IPv4 header.

Value in the Event Recorder shows:

  • dst: destination IP address.
  • src: source IP address.
  • proto: protocol type (ICMP, IGMP, TCP, UDP).
  • id: identification number.
  • frag: IP flags and fragment offset.
  • len: length of the received frame in bytes.
__STATIC_INLINE void EvrNetIP4_SourceIpAddressInvalid ( uint16_t  if_id,
const uint8_t *  ip4_addr 
)

Event on IP4 source IP address invalid (Error)

Parameters
if_idnetwork interface identifier
ip4_addrpointer to IPv4 address

The event SourceIpAddressInvalid is created when the network library receives an IPv4 frame that has an invalid source address. The IP frame is therefore discarded.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • ip: received source IP address.
__STATIC_INLINE void EvrNetIP4_UninitCore ( void  )

Event on IP4 core de-initialize (Op)

The event UninitCore is created when the function netUninitialize is executed.

Value in the Event Recorder shows:

  • ip4
__STATIC_INLINE void EvrNetIP4_WrongBroadcastProtocol ( uint16_t  if_id,
uint8_t  ip4_protocol 
)

Event on IP4 wrong broadcast protocol type (Error)

Parameters
if_idnetwork interface identifier
ip4_protocolwrong protocol type value
Remarks
Only UDP subnet broadcast frames are allowed.

The event WrongBroadcastProtocol is created when the network library receives an IPv4 directed broadcast frame that has an invalid protocol type. The IP frame is therefore discarded.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • proto: received protocol type (IGMP, ICMP, TCP).
__STATIC_INLINE void EvrNetIP4_WrongDestinationAddress ( uint16_t  if_id,
const uint8_t *  ip4_addr 
)

Event on IP4 wrong destination address (Op)

Parameters
if_idnetwork interface identifier
ip4_addrpointer to IPv4 destination address

The event WrongDestinationAddress is created when the network library receives an IPv4 frame that has an invalid destination address. The IP frame is therefore discarded.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • ip: received destination IP address.
__STATIC_INLINE void EvrNetIP4_WrongMulticastProtocol ( uint16_t  if_id,
uint8_t  ip4_protocol 
)

Event on IP4 wrong multicast protocol type (Error)

Parameters
if_idnetwork interface identifier
ip4_protocolwrong protocol type value
Remarks
Only UDP and IGMP multicast frames are allowed.

The event WrongMulticastProtocol is created when the network library receives an IPv4 multicast frame that has an invalid protocol type. The IP frame is therefore discarded.

Value in the Event Recorder shows:

  • netif: network interface identifier.
  • proto: received protocol type (ICMP, TCP).