MOD54417-Multi-Interface example

Discussion to talk about software related topics only.
Post Reply
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

MOD54417-Multi-Interface example

Post by dciliske »

There appears to have been a little bit of confusion with regards to how to work with the new MOD54417 that I'd like to be able to clear up. To that end, I've put together an example which has some information and how to do get started with some useful things with the dual interfaces.

First up, the example has a nice overview of the network initialization for the MOD54417 I'll copy below:

Code: Select all

/*******************************************************************************
 * MOD54417 Network Operation Overview                                         *
 * ------------------------------------                                        *
 * The MOD54417's software drivers are designed to be fully transparent and    *
 * perform all necessary configurations using the same function calls as the   *
 * MOD54415. So, what are the relevant function calls and what do they do      *
 * differently between the MOD54415 and the MOD54417?                          *
 *                                                                             *
 * Hardware Initialization                                                     *
 * ------------------------                                                    *
 * The hardware initialization for the network stack ocurrs in                 *
 * InitializeStack(). At the bottom, this function breaks out of the main      *
 * system library when it calls AddEthernetInterface(). Inside this call, there*
 * is a check that determines if the software is running on a MOD54415 or a    *
 * MOD54417. If it is running on a MOD54417 it then checks to see if it should *
 * be running in switched mode or independent mode. By the time the function   *
 * returns, the network hardware is configured accordingly and the interface(s)*
 * are added to the stack (if the device is in switched mode, only one         *
 * interface is created, due to the nature of the switch). Add2ndEthernet()    *
 * should never be called in normal application development. If the module     *
 * should switch between switched and independent modes, the config record     *
 * must be updated and then the module be reset.                               *
 *                                                                             *
 * Network Configurations                                                      *
 * -----------------------                                                     *
 * When the ethernet interfaces are operating in independent mode, the second  *
 * ethernet interface will get its configuration from ConfigRecord number      *
 * CONFIG_IF_ID_ETHERNET2. It will appear under IPSetup. In most ways, the     *
 * second interface will behave as the first, with a few minor exceptions.     *
 *                                                                             *
 * 1. The link status functions will now operate on the driver objects.        *
 *    Example:  EtherLink() becomes enet0.EtherLink() or enet1.EtherLink()     *
 * 2. All the calls with Ethernet* (EthernetIP, EthernetIpMask, EthernetIpGate,*
 *    EthernetDNS) will need to need to be changed to work with the            *
 *    NetInterface functions for querying the different addresses, or obtaining*
 *    the InterfaceBlock for the correct interface. These can be obtained by   *
 *    the oppropriate call as follows:                                         *
 *       InterfaceBlock *pifb = GetInterFaceBlock( enet0.myInterfaceNumber );  *
 *    Once you have the block, the you can then set the individual addresses.  *
 *                                                                             *
 * GetDHCPAddressIfNecessary                                                   *
 * --------------------------                                                  *
 * GetDHCPAddressIfNecessary has been modified in the default case. The default*
 * argument is -1. When this value is passed, GetDHCPAddressIfNecessary will   *
 * start DHCP negotiations on all network interfaces that do not already have  *
 * either, a valid IP address, a DHCP object associated, or an AutoIP object   *
 * associated.                                                                 *
 *******************************************************************************/
Second, we've added a couple new comphtml tags to support multi interface websites segregating authority; they are 'IFNUM' and 'NODIRECT'. These will not be available until the next release however. The behavior of these tags are:
  • IFNUM creates a whitelist based discrimination for web requests based on the interface that the request comes from.
    Without a IFNUM tag the page is available to all interfaces. If any IFNUM tag is present, it is only available to those interfaces which
    are listed in seperate tags.
  • NODIRECT disables serving a page entirely to direct web requests. It allows for the creation of sub-template pages, only available
    to dynamic code functions to serve up with the SendData command.
Finally, I'm attaching the source as well as an image to see how it will work (due to the lack of current support for the new tags).

-Dan
Attachments
MOD54417-Multi-Intf_APP.s19
(535.1 KiB) Downloaded 602 times
MOD54417-Multi-Intf.zip
(90.99 KiB) Downloaded 593 times
Dan Ciliske
Project Engineer
Netburner, Inc
cwm
Posts: 3
Joined: Thu Sep 10, 2015 7:11 am

Re: MOD54417-Multi-Interface example

Post by cwm »

The project will not build when I import it into NBEclipse. There are a few missing/undeclared methods.
i.e SendData(), fdprintf(), GetValidConfig()

Edit:

I am using NBEclipse 2.6.3
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD54417-Multi-Interface example

Post by dciliske »

In the words of Adam Savage: "Well, there's your problem."

Support for the MOD54417 wasn't added until 2.6.8. The multiinteface example was added after that.

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
cwm
Posts: 3
Joined: Thu Sep 10, 2015 7:11 am

Re: MOD54417-Multi-Interface example

Post by cwm »

Well after a couple of days of struggling with this, thank you for making it so simple.

We are working with a customer that provided us with this older version of the NBEclipse. Is there a publicly accessible list of all the NBEclipse, so we can see what all the capabilities that each version has?
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: MOD54417-Multi-Interface example

Post by pbreed »

This forum is for users to share experiences.
It IS NOT NetBurners primary support method.

For that go to support.netburner.com....

If your license key has already been registered for support
(Likely if given to you by someone else.)

If they did not uninstall the tools they gave you a copy of its a
violation of our tools license, each license key is supposed to be used by a single developer.
Our dev kits and licenses are entirely reasonable in cost so this should not really be a burden.

You can purchase a 1yr support upgrade here : http://www.netburnerstore.com/developme ... rt_s/5.htm
Post Reply