NetBurner 3.5.6
PDF Version |
Callback functions to add custom Ethernet handlers and pass Ethernet frames at the bottom of the TCP/IP stack. More...
Typedefs | |
typedef int(* | netDoRXFunc) (PoolPtr pp, uint16_t ocount, int if_num) |
Function pointer type for custom network receive handlers. | |
Functions | |
netDoRXFunc | SetCustomNetDoRX (netDoRXFunc customFunc) |
Register a custom Ethernet frame handler. | |
netDoRXFunc | ClearCustomNetDoRX () |
Remove the currently registered custom Ethernet handler. | |
int | NetDoRX (PoolPtr pp, uint16_t ocount, int if_num) |
Main entry point for Ethernet frames into the TCP/IP stack. | |
Variables | |
netDoRXFunc | CustomNetDoRX |
Global pointer to the currently registered custom receive handler. | |
Callback functions to add custom Ethernet handlers and pass Ethernet frames at the bottom of the TCP/IP stack.
#include< netrx.h>
This module provides the infrastructure for inserting custom Ethernet frame handlers into the network receive path. Custom handlers run before the standard TCP/IP processing and can filter, modify, or consume frames.
Common use cases include:
typedef int(* netDoRXFunc) (PoolPtr pp, uint16_t ocount, int if_num) |
#include <netrx.h>
Function pointer type for custom network receive handlers.
This typedef defines the signature for custom Ethernet frame processing functions. Functions of this type are called for each received Ethernet frame before standard TCP/IP processing occurs.
The handler function should:
pp | Pointer to PoolBuffer containing the received Ethernet frame. The buffer contains the complete frame including Ethernet header. |
ocount | Total number of octets (bytes) in the received frame, including all headers and payload. |
if_num | Network interface index that received the frame. Zero-based index identifying which physical interface the frame arrived on. |
|
inline |
#include <netrx.h>
Remove the currently registered custom Ethernet handler.
Clears the custom Ethernet frame handler by setting it to NULL. After calling this function, all received frames will go directly to standard TCP/IP processing without any custom pre-processing.
This is a convenience function equivalent to calling SetCustomNetDoRX(NULL).
int NetDoRX | ( | PoolPtr | pp, |
uint16_t | ocount, | ||
int | if_num ) |
#include <netrx.h>
Main entry point for Ethernet frames into the TCP/IP stack.
This function is the primary entry point for all received Ethernet frames into the NetBurner TCP/IP stack. It is called by the network driver when a frame has been received and is ready for processing.
The function performs the following operations:
pp | Pointer to PoolBuffer containing the complete Ethernet frame. The buffer includes the Ethernet header and all subsequent data. The buffer is released by this function unless an error occurs. |
ocount | Number of octets (bytes) in the Ethernet frame, including the Ethernet header. This is the total frame size as received from the network interface. |
if_num | Zero-based index of the network interface that received the frame. This identifies which physical network interface (Ethernet port) the frame arrived on. Used for multi-interface routing decisions. |
|
inline |
#include <netrx.h>
Register a custom Ethernet frame handler.
Installs a custom handler function that will be called for every received Ethernet frame before standard TCP/IP processing. Only one custom handler can be active at a time; calling this function replaces any previously registered handler.
The custom handler is invoked in the network receive interrupt context and should:
customFunc | Pointer to the custom netDoRXFunc handler to register. Pass NULL to clear the custom handler. |
|
extern |
#include <netrx.h>
Global pointer to the currently registered custom receive handler.
This external variable holds the function pointer to the active custom network receive handler. If NULL, no custom handler is registered and all frames go directly to standard TCP/IP processing.