|
NetBurner 3.5.6
PDF Version |
A NetBurner TCP/IP Stack example demonstrating IPv4 multihoming capabilities.
This application demonstrates how to implement multiple IP addresses on a single NetBurner device using the Multihome functionality. The device will respond to requests from multiple network interfaces simultaneously:
Before building and running this application, you must enable multihome support:
The application example includes a predef-overload.h file that automatically enables:
MULTIHOME functionalityNUM_MULTI_INTERFACES)The file utilizes the NetBurner overload feature by locating the file at: \MultiHome\overload\nbrtos\include\predef-overload.h
This way NetBurner system file predef.h does not need to be mofified. See the OverloadDirectory example or the Overload section of this manual for more information.
Alternatively, you can modify the NetBurner predef.h system file as described below:
\nburn\nbrtos\include\predef.hMULTIHOME definitionThe application starts an HTTP server that provides IP address information. Access the web interface using any of the configured IP addresses to view:
The application continuously outputs IP address information to the debug serial port every 5 seconds, showing:
main.cpp: Main application logic and web server implementationReadMe.txt: Original documentation (Doxygen format)predef-overload.h: Compiler definitions for multihome supportUserMain(): Main application entry pointWebDisplayIpSettings(): Web page handler for IP address displayAddInterface(): Adds the static multihome interfaceDhcpIb: Interface block for DHCP interfaceStaticIb: Interface block for AutoIP interface MultiHome1Ib: Interface block for static multihome interfaceThe static interface is configured with:
Ensure your network topology can accommodate this address range if you plan to access the static interface.
The application includes a compile-time check to ensure multihome support is enabled. If MULTIHOME is not defined, compilation will fail with an informative error message directing you to enable the feature in the system configuration.