46#include <config_netobj.h>
47#include <config_obj.h>
48#include <dhcpclient.h>
49#include <discoveryservlet.h>
59#define ARP_PPP_INTERFACE (255)
99#define NB_MAC_NIC_INTERFACE (0x00)
100#define NB_MAC_NIC_SECOND_INTERFACE (0x80)
101#define NB_MAC_NIC_THIRD_INTERFACE (0x40)
102#define NB_MAC_NIC_FOURTH_INTERFACE (0xC0)
103#define NB_MAC_NIC_SECOND_INTERFACE_MASK \
104 (NB_MAC_NIC_INTERFACE | NB_MAC_NIC_SECOND_INTERFACE | NB_MAC_NIC_THIRD_INTERFACE | NB_MAC_NIC_FOURTH_INTERFACE)
105#define NB_MAC_OCTET_4 (3)
106#define NB_MAC_OCTET_5 (4)
107#define NB_MAC_OCTET_5_XOR (0x80)
139typedef void(ProcessPacketFunc)(
PoolPtr poolPtr, PEFRAME ethernetFramePtr, uint16_t checksum);
159typedef void(ProcessArpFunc)(
PoolPtr poolPtr, PEFRAME ethernetFramePtr);
179typedef void (*ProcessLLDPptr)(
PoolPtr poolPtr);
181extern ProcessLLDPptr pProcessLLDP;
199typedef BOOL(LinkActiveFunc)(void);
210#define INTF_CSUM_IP (0x01)
211#define INTF_CSUM_ICMP (0x02)
212#define INTF_CSUM_UDP (0x04)
213#define INTF_CSUM_TCP (0x08)
214#define INTF_CSUM_IP6 (0x10)
215#define INTF_CSUM_ICMP6 (0x20)
216#define INTF_CSUM_UDP6 (0x40)
217#define INTF_CSUM_TCP6 (0x80)
219#define INTF_CSUM_ALL4 (INTF_CSUM_IP | INTF_CSUM_ICMP | INTF_CSUM_UDP | INTF_CSUM_TCP)
220#define INTF_CSUM_ALL6 (INTF_CSUM_IP6 | INTF_CSUM_ICMP6 | INTF_CSUM_UDP6 | INTF_CSUM_TCP6)
310 virtual void send_func(
PoolPtr poolPtr) = 0;
311 virtual void kill_if();
388 bool ProcessIPConfigChange(uint16_t ticks_to_wait);
391 void SwapOldAndCurrentAddr();
393 virtual bool bNeedsArp() {
return true; };
394 void fdShowInterfaceValues(
int fd);
395 inline void ShowInterfaceValues() { fdShowInterfaceValues(1); };
396 void SetDefaultFlags();
404 void AddInterfaceToSnmpTree();
405 unsigned int EthifInOctets;
406 unsigned int EthifInUcastPkts;
407 unsigned int EthifInNUcastPkts;
408 unsigned int EthifInDiscards;
409 unsigned int EthifInErrors;
410 unsigned int EthifInUnknownProtos;
411 unsigned int EthifOutOctets;
412 unsigned int EthifOutUcastPkts;
413 unsigned int EthifOutNUcastPkts;
414 unsigned int EthifOutDiscards;
415 unsigned int EthifOutErrors;
427 EtherLikeInterface(
const char *name,
const char *desc = NULL) :
InterfaceBlock(name, desc)
437 EtherLikeInterface(
config_obj &owner,
const char *name,
const char *desc = NULL) :
InterfaceBlock(owner, name, desc)
447 virtual void Enable()
460int NetDoRX(
PoolPtr pp, uint16_t count,
int if_num);
472extern ProcessArpFunc *pArpFunc;
489typedef void(ProcessIp6Func)(
PoolPtr poolPtr);
491extern ProcessIp6Func *pIp6Func;
498extern ProcessPacketFunc *pPacketfunc;
526void TransmitBuffer(
PoolPtr poolPtr,
int interface);
545inline PEFRAME GetEframe(
PoolPtr pp)
547 return (PEFRAME)pp->
pData;
550inline PVLEFRAME GetVLEframe(
PoolPtr pp)
552 return (PVLEFRAME)pp->
pData;
686BOOL InitializeNetwork(ProcessPacketFunc *processPacketFuncPtr, ProcessArpFunc *processArpFuncPtr);
704void StopNetworks(
void);
779void UnWrapVlan(
PoolPtr pp,
int len);
DHCP client class.
Definition dhcpclient.h:71
Definition config_netobj.h:302
Definition config_netobj.h:384
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:244
uint16_t netMss
Network max segment size for this interface.
Definition netinterface.h:264
discover_servlet disco_servlet
The servlet that runs the NetBurner discovery server process.
Definition netinterface.h:268
config_int dhcp_discover_secs
Seconds to delay after boot before sending a DHCP Discover message.
Definition netinterface.h:253
uint8_t checksumOffload
Non-zero if hardware interface support offloading checksum calculation.
Definition netinterface.h:265
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:269
AutoIPClient AutoClient
AutoIP client object for this interface.
Definition netinterface.h:276
virtual void EnableMulticast(MACADR macAddress, BOOL addAddress)=0
Enable Multicast on this interface.
int32_t my_ifnum
This interface number.
Definition netinterface.h:263
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:250
DhcpObject dhcpClient
DHCP client support.
Definition netinterface.h:267
config_int vlan_tag_value
VLAN tag.
Definition netinterface.h:258
config_string device_name
Name of interface. Used to register for DNS and NetBIOS.
Definition netinterface.h:251
int GetInterfaceNumber()
Returns the Interface Number of the network interface.
Definition netinterface.h:375
IPADDR4 previous_addr
Previous IPv4 address.
Definition netinterface.h:271
config_string net_domain
Network Domain.
Definition netinterface.h:252
config_bool obfuscate_discovery
Obfuscate data instead of plain text.
Definition netinterface.h:256
config_int discovery_interval
How often to report to the NetBurner discover server.
Definition netinterface.h:255
I4Record ip4
IPv4 configuration for "this" interface, see config_netobj.h for details.
Definition netinterface.h:246
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:382
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:254
IPADDR4 previous_mask
Previous IPv4 mask.
Definition netinterface.h:272
bool bHaveSeenLink
True if a link has been present previously at least once.
Definition netinterface.h:266
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:248
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:262
config_bool supress_default_responses
Disable Ping and Echo (port 7)
Definition netinterface.h:257
IPADDR4 previous_gate
Previous IPv4 gateway.
Definition netinterface.h:273
Used to store and manipulate MAC addresses.
Definition nettypes.h:69
Configuration Variable for MACADR object type.
Definition config_obj.h:1859
Boolean Configuration Variable.
Definition config_obj.h:998
Signed 32-bit Integer Configuration Variable.
Definition config_obj.h:701
Base class used to create configuration objects.
Definition config_obj.h:321
String Configuration Variable.
Definition config_obj.h:1128
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