46#include <config_netobj.h>
47#include <config_obj.h>
48#include <dhcpclient.h>
49#include <discoveryservlet.h>
60#define ARP_PPP_INTERFACE (255)
100#define NB_MAC_NIC_INTERFACE (0x00)
101#define NB_MAC_NIC_SECOND_INTERFACE (0x80)
102#define NB_MAC_NIC_THIRD_INTERFACE (0x40)
103#define NB_MAC_NIC_FOURTH_INTERFACE (0xC0)
104#define NB_MAC_NIC_SECOND_INTERFACE_MASK \
105 (NB_MAC_NIC_INTERFACE | NB_MAC_NIC_SECOND_INTERFACE | NB_MAC_NIC_THIRD_INTERFACE | NB_MAC_NIC_FOURTH_INTERFACE)
106#define NB_MAC_OCTET_4 (3)
107#define NB_MAC_OCTET_5 (4)
108#define NB_MAC_OCTET_5_XOR (0x80)
140typedef void(ProcessPacketFunc)(
PoolPtr poolPtr, PEFRAME ethernetFramePtr, uint16_t checksum);
160typedef void(ProcessArpFunc)(
PoolPtr poolPtr, PEFRAME ethernetFramePtr);
180typedef void (*ProcessLLDPptr)(
PoolPtr poolPtr);
182extern ProcessLLDPptr pProcessLLDP;
200typedef BOOL(LinkActiveFunc)(void);
211#define INTF_CSUM_IP (0x01)
212#define INTF_CSUM_ICMP (0x02)
213#define INTF_CSUM_UDP (0x04)
214#define INTF_CSUM_TCP (0x08)
215#define INTF_CSUM_IP6 (0x10)
216#define INTF_CSUM_ICMP6 (0x20)
217#define INTF_CSUM_UDP6 (0x40)
218#define INTF_CSUM_TCP6 (0x80)
220#define INTF_CSUM_ALL4 (INTF_CSUM_IP | INTF_CSUM_ICMP | INTF_CSUM_UDP | INTF_CSUM_TCP)
221#define INTF_CSUM_ALL6 (INTF_CSUM_IP6 | INTF_CSUM_ICMP6 | INTF_CSUM_UDP6 | INTF_CSUM_TCP6)
311 virtual void send_func(
PoolPtr poolPtr) = 0;
312 virtual void kill_if();
389 bool ProcessIPConfigChange(uint16_t ticks_to_wait);
392 void SwapOldAndCurrentAddr();
394 virtual bool bNeedsArp() {
return true; };
395 void fdShowInterfaceValues(
int fd);
396 inline void ShowInterfaceValues() { fdShowInterfaceValues(1); };
397 void SetDefaultFlags();
413 EtherLikeInterface(
const char *name,
const char *desc = NULL) :
InterfaceBlock(name, desc)
423 EtherLikeInterface(
config_obj &owner,
const char *name,
const char *desc = NULL) :
InterfaceBlock(owner, name, desc)
433 virtual void Enable()
446int NetDoRX(
PoolPtr pp, uint16_t count,
int if_num);
458extern ProcessArpFunc *pArpFunc;
475typedef void(ProcessIp6Func)(
PoolPtr poolPtr);
477extern ProcessIp6Func *pIp6Func;
484extern ProcessPacketFunc *pPacketfunc;
512void TransmitBuffer(
PoolPtr poolPtr,
int interface);
531inline PEFRAME GetEframe(
PoolPtr pp)
533 return (PEFRAME)pp->
pData;
536inline PVLEFRAME GetVLEframe(
PoolPtr pp)
538 return (PVLEFRAME)pp->
pData;
672BOOL InitializeNetwork(ProcessPacketFunc *processPacketFuncPtr, ProcessArpFunc *processArpFuncPtr);
690void StopNetworks(
void);
765void UnWrapVlan(
PoolPtr pp,
int len);
DHCP client class.
Definition dhcpclient.h:71
Definition config_netobj.h:302
Definition config_netobj.h:382
Used to store and manipulate IPv4 addresses in dual stack mode.
Definition nettypes.h:225
Network interface configuration block class for interface control and configuration.
Definition netinterface.h:245
uint16_t netMss
Network max segment size for this interface.
Definition netinterface.h:265
discover_servlet disco_servlet
The servlet that runs the NetBurner discovery server process.
Definition netinterface.h:269
config_int dhcp_discover_secs
Seconds to delay after boot before sending a DHCP Discover message.
Definition netinterface.h:254
uint8_t checksumOffload
Non-zero if hardware interface support offloading checksum calculation.
Definition netinterface.h:266
virtual const char * GetInterfaceName()
Returns the interface name network interface.
virtual bool LinkDuplex()=0
Returns the full or half link duplex of the network interface.
void(* MCastLinkNotify)(InterfaceBlock *pBlock, bool bLink)
A funciton pointer called when link changes for multicast.
Definition netinterface.h:270
AutoIPClient AutoClient
AutoIP client object for this interface.
Definition netinterface.h:277
virtual void EnableMulticast(MACADR macAddress, BOOL addAddress)=0
Enable Multicast on this interface.
int32_t my_ifnum
This interface number.
Definition netinterface.h:264
virtual bool LinkActive()=0
Returns the link status of the network interface.
void RegisterInterface()
Register a network interface with system.
config_MACADR MAC
Interface MAC address. May be 0 or null for interfaces such as PPP.
Definition netinterface.h:251
DhcpObject dhcpClient
DHCP client support.
Definition netinterface.h:268
config_int vlan_tag_value
VLAN tag.
Definition netinterface.h:259
config_string device_name
Name of interface. Used to register for DNS and NetBIOS.
Definition netinterface.h:252
int GetInterfaceNumber()
Returns the Interface Number of the network interface.
Definition netinterface.h:376
IPADDR4 previous_addr
Previous IPv4 address.
Definition netinterface.h:272
config_string net_domain
Network Domain.
Definition netinterface.h:253
config_bool obfuscate_discovery
Obfuscate data instead of plain text.
Definition netinterface.h:257
config_int discovery_interval
How often to report to the NetBurner discover server.
Definition netinterface.h:256
I4Record ip4
IPv4 configuration for "this" interface, see config_netobj.h for details.
Definition netinterface.h:247
InterfaceBlock(const char *name, const char *desc=NULL)
Constructor with interface name and description.
bool IsRootInterface()
Returns true if this is the first interface in the interface list.
Definition netinterface.h:383
InterfaceBlock(config_obj &owner, const char *name, const char *desc=NULL)
Constructor with config_obj owner, interface name and description.
config_string discovery_server
NetBurner discover server name.
Definition netinterface.h:255
IPADDR4 previous_mask
Previous IPv4 mask.
Definition netinterface.h:273
bool bHaveSeenLink
True if a link has been present previously at least once.
Definition netinterface.h:267
virtual int LinkSpeed()=0
Returns the link speed of the network interface.
I6Record ip6
IPv6 configuration for "this" interface, see config_netobj.h for details.
Definition netinterface.h:249
void InterfaceLinkChange(bool link)
Change the link status of the network interface.
int32_t root_if
Root interface number. If multihomed, the interface would be a child of the root interface.
Definition netinterface.h:263
config_bool supress_default_responses
Disable Ping and Echo (port 7)
Definition netinterface.h:258
IPADDR4 previous_gate
Previous IPv4 gateway.
Definition netinterface.h:274
Used to store and manipulate MAC addresses.
Definition nettypes.h:69
Configuration Variable for MACADR object type.
Definition config_obj.h:1853
Boolean Configuration Variable.
Definition config_obj.h:997
Signed 32-bit Integer Configuration Variable.
Definition config_obj.h:700
Base class used to create configuration objects.
Definition config_obj.h:320
String Configuration Variable.
Definition config_obj.h:1127
const uint32_t fConfigHidden
Not visible to configuration web server display.
Definition config_obj.h:78
const uint32_t fConfigReadOnly
Variable is read-only.
Definition config_obj.h:76
int Removeinterface(int interface)
Remove a network interface from the system.
bool InterfaceLinkDuplex(int interface)
Returns the full or half link duplex of the specified network interface.
int32_t GetInterfaceForMyAddress4(IPADDR4 ip)
Returns the Interface Number of the specified network interface IPv4 address.
const char * InterfaceName(int interface)
Returns the interface name of the specified network interface.
int InterfaceLinkSpeed(int interface)
Returns the 10/100 link speed of the specified network interface.
int32_t GetFirstInterface(void)
Returns the Interface Number of the first registered network interface.
int32_t GetNextInterface(int lastInterface)
Returns the Interface Number of the next registered network interface.
int32_t GetInterfaceNumber(InterfaceBlock *pifb)
Returns the Interface Number of the specified network interface InterfaceBlock.
MACADR InterfaceMAC(int interface)
Returns the MAC address of the specified network interface.
void EnableMulticast(MACADR macAddress, int interface=0)
Enable Multicast on an existing interface.
bool GetInterfaceLink(int ifn)
Returns the network interface link status.
void DisableMulticast(MACADR macAddress, int interface=0)
Disable Multicast on an existing interface.
bool InterfaceLinkActive(int interface)
Returns the link status of the specified network interface.
InterfaceBlock * GetInterfaceBlock(int interface=0)
Get an InterfaceBlock control and configuration object.
IPADDR4 InterfaceDNS2(int interface)
Returns the second IPv4 DNS address of the specified network interface.
IPADDR4 InterfaceMASK(int interface)
Returns the IPv4 network mask of the specified network interface.
IPADDR4 InterfaceAutoIP(int interface)
Returns the IPv4 IP AutoIP address of the specified network interface.
bool HaveActiveNetwork(int interface=-1)
Returns the network routability of the specified network interface.
IPADDR4 InterfaceDNS(int interface)
Returns the IPv4 DNS address of the specified network interface.
IPADDR4 InterfaceIP(int interface)
Returns the IPv4 IP address of the specified network interface.
IPADDR4 InterfaceGate(int interface)
Returns the IPv4 gateway address of the specified network interface.
Main buffer structure for network and serial communication.
Definition buffers.h:90
uint8_t pData[ETHER_BUFFER_SIZE]
Buffer data payload (1548 bytes)
Definition buffers.h:104