NetBurner 3.5.6
PDF Version
ipv6_interface.h
Go to the documentation of this file.
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
17#ifndef IPV6_INTERFACE_H
18#define IPV6_INTERFACE_H
19
20#include <basictypes.h>
21#include <buffers.h>
22#include <ipv6/dhcpv6_internal.h>
23#include <ipv6/ipv6_addr.h>
24#include <ipv6/ipv6_frames.h>
25#include <nettimer.h>
26#include <nettypes.h>
27#include <utils.h>
28
36#define ADDR_ALL_NODES_LINK_LOCAL IPADDR6::AsciiToIp6("FF02::1")
37#define ADDR_ALL_ROUTERS_LINK_LOCAL IPADDR6::AsciiToIp6("FF02::2")
38#define ADDR_ALL_NB_LINK_LOCAL IPADDR6::AsciiToIp6("FF02::4e42")
39#define ADDR_UNICAST_LINK_LOCAL_PREFIX IPADDR6::AsciiToIp6("FE80::")
40#define ADDR_MLDV2_REPORTS IPADDR6::AsciiToIp6("FF02::16")
41
42#define IPV6_MULTICAST_NODE_LOCAL 0xFF01
43#define IPV6_MULTICAST_LINK_LOCAL 0xFF02
44#define IPV6_MULTICAST_REALM_LOCAL 0xFF03
45#define IPV6_MULTICAST_ADMIN_LOCAL 0xFF04
46#define IPV6_MULTICAST_SITE_LOCAL 0xFF05
47#define IPV6_MULTICAST_ORG_LOCAL 0xFF08
48#define IPV6_MULTICAST_GLOBAL 0xFF0E
51struct IP6FRAME;
52struct ICMP6_ND_ADVERT;
53
69{
71 IP6FRAME *pIPf;
72 uint8_t *pData;
73 uint16_t nDataLen;
74 uint8_t *pLargeData;
75
80
84 void release();
85
92 uint8_t WalkNextHeader(int *pError_offset = NULL);
93
101 bool DestOptHasError(puint8_t pData, int *pError_offset);
102
110 bool HopByHopParseHasError(puint8_t pData, int *pError_offset);
111
119 bool RouterHeaderParseHasError(puint8_t pData, int *pError_offset);
120
127
132 {
133 root_pp = NULL;
134 pIPf = NULL;
135 pData = NULL;
136 nDataLen = 0;
137 pLargeData = 0;
138 }
139
145 inline puint8_t GetDataPointer()
146 {
147 if (pLargeData) return pLargeData;
148 if (root_pp) return root_pp->pData;
149 return NULL;
150 }
151
157 inline EFRAME *GetEframe()
158 {
159 if (pLargeData) return (EFRAME *)pLargeData;
160 if (root_pp) return (EFRAME *)root_pp->pData;
161 return NULL;
162 }
163};
166// forward declarations
167struct IPV6_ROOT_EL;
168struct IPV6_PREFIX;
169struct IPV6_ROUTER;
170struct IPV6_DNS;
171struct IPV6_NEIGHBOR;
172struct IPV6_DEST;
174class IPv6Interface;
175class UDPPacket;
176class TcpCarrierPacket;
177struct socket_struct;
178typedef socket_struct SOCKET;
179typedef SOCKET *PSOCKET;
180
205
241
249{
250 const char *m_name;
255
262
269
277 IPV6_ROOT_EL *Find(const IPADDR6 &ip, bool age);
278
285
290
297 void Attach(IPv6Interface &Interface, const char *name);
298
305
312
316 void Show();
317};
318
319struct IPV6_PREFIX;
320
327{
328 uint8_t m_ServerID[CLIENT_LONG_SERVID];
329 uint32_t m_IAID;
330 uint32_t m_renewTick;
331 uint32_t m_rebindTick;
332
337
343 virtual bool AgeStillValidTest();
344
348 virtual void ShowItem();
349
357
363 inline uint32_t GetDhcpRenewTime() { return m_renewTick; }
364
370 inline uint32_t GetDhcpRebindTime() { return m_rebindTick; }
371};
372
377{
382
388 virtual bool AgeStillValidTest();
389
393 virtual void ShowItem();
394};
411{
415 uint32_t m_Life_In_Secs;
416 uint16_t m_PathMTU;
417
424
431
436
441
446
452 virtual bool AgeStillValidTest();
453
457 virtual void ShowItem();
458};
459
472
486
493{
501 uint8_t PrefixLen;
503 bool bOnLink;
504
511 {
512 return (IPV6_PREFIX*)m_pNext;
513 }
514
519
524
529
536 bool OnLink(const IPADDR6 &ip);
537
543 bool Prefered();
544
551
555 virtual void ShowItem();
556
563 {
564 if (pDHCPD) return eDHCP;
565 if (pRouter) return eRouter;
566 if (m_IPAddress.IsLinkLocal()) return eLinkLocal;
567 if ((bValidForInterface) && (bOnLink)) return eStatic;
568 return eUnknown;
569 }
570
576 inline uint32_t RemainingValidTime()
577 {
578 uint32_t lastt = time_established_in_secs;
579 if (pRouter) lastt = pRouter->m_SecsLastAdvertise;
580 if (time_to_lose_valid_in_secs_from_establish == 0xffffffff) return 0xffffffff;
581 return time_to_lose_valid_in_secs_from_establish - (Secs - lastt);
582 };
583
590
600
606 virtual bool AgeStillValidTest();
607
614
619};
620
632
633inline bool ThisCheck(void * p) {return p!=0; }
634
635
636
642struct IPV6_DEST : public IPV6_ROOT_EL
643{
645 uint16_t m_PathMTU;
649
656 {
657 if (ThisCheck(this))
658 return (IPV6_DEST *)m_pNext;
659 else
660 return NULL;
661 }
662
667
673 virtual bool AgeStillValidTest();
674
678 virtual void ShowItem();
679};
695struct IPV6_DNS : public IPV6_ROOT_EL
696{
700
707 {
708 return (IPV6_DNS *)m_pNext;
709 }
710
716 virtual bool AgeStillValidTest();
717
721 virtual void ShowItem();
722
727
732};
756
757
764{
770
774
779
786 {
787 if (ThisCheck(this))
788 return (IPV6_NEIGHBOR *)m_pNext;
789 else
790 return NULL;
791 }
792
797
801 void Discard();
802
810 bool ProcessAdvert(IPv6FrameProcessingStruct &p6proc, ICMP6_ND_ADVERT *pRsp);
811
816
822 void Send_ND_Solicit(bool multicast);
823
832
838 virtual bool AgeStillValidTest();
839
846
853
860
867
874
878 virtual void ShowItem();
879};
888class IPv6Interface : public TimeOutElement
889{
890 int m_ifnum;
891 MACADR m_myMac;
892 uint32_t m_LastFragCheckSec;
893 uint32_t m_LastRouterSolSec;
894 uint32_t m_RouterSolCount;
895 uint32_t m_LastMLDRepSec;
896 bool m_solicitSendLinkLayer;
897 NB::V6::DHCPv6::DHCPClient *m_pDhcpClient;
898
899 OS_CRIT NDCrit;
900 IPV6_ROOT_EL_CONTAINER Prefixes;
901 IPV6_ROOT_EL_CONTAINER Destinations;
902 IPV6_ROOT_EL_CONTAINER Neighbors;
903 IPV6_ROOT_EL_CONTAINER Routers;
904 IPV6_ROOT_EL_CONTAINER DnsList;
905 IPV6_ROOT_EL_CONTAINER DHCPServers;
906
907 volatile PoolPtr m_pp_FragmentParts;
908 virtual void TimeElementEvent();
909 OS_FIFO m_PingFifo;
910
911 // Private allocation methods
912 IPV6_PREFIX *PrefixAlloc(const IPADDR6 &ip);
913 IPV6_DEST *DestAlloc(const IPADDR6 &ip);
914 IPV6_ROUTER *RouterAlloc(const IPADDR6 &ip);
915 IPV6_NEIGHBOR *NeighborAlloc(const IPADDR6 &ip);
916 IPV6_DNS *DnsAlloc(const IPADDR6 &ip, bool front = false);
917 IPV6_DHCPD *DHCPDAlloc(const IPADDR6 &ip);
918
919 // Private lookup methods
920 inline IPV6_PREFIX *FindPrefix(const IPADDR6 &ip, bool age = false) { return (IPV6_PREFIX *)Prefixes.Find(ip, age); };
921 inline IPV6_DEST *FindDest(const IPADDR6 &ip, bool age = false) { return (IPV6_DEST *)Destinations.Find(ip, age); };
922 inline IPV6_ROUTER *FindRouter(const IPADDR6 &ip, bool age = false) { return (IPV6_ROUTER *)Routers.Find(ip, age); };
923 inline IPV6_DHCPD *FindDHCPD(const IPADDR6 &ip, bool age = false) { return (IPV6_DHCPD *)DHCPServers.Find(ip, age); };
924 inline IPV6_NEIGHBOR *FindNeighbor(const IPADDR6 &ip, bool age = false) { return (IPV6_NEIGHBOR *)Neighbors.Find(ip, age); };
925 IPV6_NEIGHBOR *FindCreateNeighbor(const IPADDR6 &ip);
926 inline IPV6_PREFIX *FindIA_Addr(IPV6_DHCPD *dhcpd, IPV6_PREFIX *prefix = NULL)
927 {
928 if (prefix == NULL) { prefix = FirstPrefix(); }
929 return dhcpd->FindIA_Addr(prefix);
930 }
931
932 IPV6_DNS *FindDNS(const IPADDR6 &ip, bool age = false, IPV6_DHCPD *pDhcp = NULL);
933 IPV6_DNS *FindDNSByDHCPD(IPV6_DHCPD *pDhcp, IPV6_DNS *pEl);
934
935 // Interface parameters
936 uint16_t CurHopLimit;
937 uint32_t BaseReachableTime_Ticks;
938 uint32_t ReachableTime_Ticks;
939 uint32_t ND_RetranmistTimer_Ticks;
940
941 uint32_t CalcRandomReachable();
942
943 IPADDR6 RoundRobinRouterIP;
944 eRouteOutResult RouteOut(IPv6FrameProcessingStruct &p6proc, IPV6_DEST *dest = NULL);
945
946 uint16_t m_MultiCastMtu;
947 uint16_t m_DefMTU;
948 uint8_t m_DefHopCount;
949 volatile bool bHadLink;
950 volatile int m_bStill_Need_To_Process_DupDiscovery_Ticks;
951 volatile bool m_bNeighborTicks;
952
953 // Static interface list management
954 static IPv6Interface *gifList;
955 IPv6Interface *m_pNext;
956 static IPADDR6 NetBurnerMultiCast;
957
958 private:
959 // Private methods for internal processing
960 void StartND();
961 void SumIcmp(IPv6FrameProcessingStruct &p6proc);
962 void RootErrors(uint8_t typev, uint8_t code, uint32_t ptr, IPv6FrameProcessingStruct &p6proc);
963 void SendParameterProblem(IPv6FrameProcessingStruct &p6proc, int prob, int offset);
964 void SendTimeExceeded(PoolPtr pp);
965 void SendUnreachable(IPv6FrameProcessingStruct &p6proc);
966 void Tick();
967 bool Process_UDP(IPv6FrameProcessingStruct &p6proc);
968 bool Process_TCP(IPv6FrameProcessingStruct &p6proc);
969 bool Process_Fragment(IPv6FrameProcessingStruct &p6proc);
970 bool ProcessND_N_Solicit(IPv6FrameProcessingStruct &p6proc);
971 bool ProcessND_N_Advertise(IPv6FrameProcessingStruct &p6proc);
972 bool ProcessND_R_Advertise(IPv6FrameProcessingStruct &p6proc);
973 bool ProcessRouterOptions(IPV6_ROUTER *pRouter, IPv6FrameProcessingStruct &p6proc, int &rem, uint8_t *&pD);
974 bool ProcessND_Redirect(IPv6FrameProcessingStruct &p6proc);
975 bool ProcessPingRequest(IPv6FrameProcessingStruct &p6proc);
976 bool ProcessPingReply(IPv6FrameProcessingStruct &p6proc);
977 bool ProcessIcmpUnreach(IPv6FrameProcessingStruct &p6proc);
978 bool ProcessTooBig(IPv6FrameProcessingStruct &p6proc);
979 bool ProcessTimeExceeded(IPv6FrameProcessingStruct &p6proc);
980 bool ProcessParamProb(IPv6FrameProcessingStruct &p6proc);
981 bool ProcessIcmpV6(IPv6FrameProcessingStruct &p6proc);
982 bool ProcessV6(IPv6FrameProcessingStruct &p6proc);
983 void AddDefAddress(const IPADDR6 &ip);
984 void AddPrefix(const IPADDR6 &ip, int len, int expire);
985 bool ValidateIcmpPacket(IPv6FrameProcessingStruct &p6proc);
986 void SendRouterSolicit(bool sendLinkLayer);
987 void SendDUP_Discover(const IPADDR6 &ip);
988
989 IPADDR6 MyLinkLocalAddress()
990 {
992 return IPADDR6::NullIP();
993 };
994
995 // Friend declarations for internal access
996 friend struct IPV6_PREFIX;
997 friend struct IPV6_DEST;
998 friend struct IPV6_ROUTER;
999 friend struct IPV6_NEIGHBOR;
1000 friend struct IPV6_DNS;
1001 friend struct IPV6_DHCPD;
1002 friend class UDPPacket;
1003 friend class NB::V6::DHCPv6::DHCPClient;
1004 friend void RetransmitV6Packet(PoolPtr pp, PSOCKET ps);
1005 friend void TcpSendwSum6(PSOCKET ps, const IPADDR &IPto, TcpCarrierPacket &pkt, BOOL keep, uint32_t data_sum);
1006 friend void TcpSendwSumFrom6(const IPADDR &IPto, const IPADDR &IPfrom, TcpCarrierPacket &pkt, BOOL keep, uint32_t data_sum);
1007 friend void InitIPv6(int ifnum);
1008 friend int Ping6(const IPADDR6 &to, uint16_t id, uint16_t seq, uint16_t maxwaitticks, int size);
1009 friend int Ping6ViaInterface(IPADDR6 &to, uint16_t id, uint16_t seq, uint16_t wait, int interface, int size);
1010
1011 static void RootProcessV6(PoolPtr pp);
1012
1013 void MLDTick();
1014 bool ProcessICMPExtension(IPv6FrameProcessingStruct &p6proc);
1015 void JoinMulticastGroup(const IPADDR6 &addr);
1016 void LeaveMulticastGroup(const IPADDR6 &addr);
1017 void ReadyMLDBase(IPv6FrameProcessingStruct &p6proc, const IPADDR6 &recAddr);
1018 void LinkLocalIsNowValid();
1019 void ClearDHCPDInfo(IPV6_DHCPD *pDhcpd = NULL);
1020
1021 public:
1022 // Element access methods
1023 inline IPV6_PREFIX *FirstPrefix() { return (IPV6_PREFIX *)Prefixes.First(); };
1024 inline IPV6_DEST *FirstDest() { return (IPV6_DEST *)Destinations.First(); };
1025 inline IPV6_ROUTER *FirstRouter() { return (IPV6_ROUTER *)Routers.First(); };
1026 IPV6_ROUTER *FirstDefRouter();
1027 IPV6_DHCPD *FirstDHCPD() { return (IPV6_DHCPD *)DHCPServers.First(); };
1028 inline IPV6_NEIGHBOR *FirstNeighbor() { return (IPV6_NEIGHBOR *)Neighbors.First(); };
1029 inline IPV6_DNS *FirstDNS() { return (IPV6_DNS *)DnsList.First(); };
1030
1033
1040 uint16_t GetDestinationMTU(const IPADDR &ip);
1041
1051
1061
1071
1080
1089
1097
1103 int GetInterfaceNumber() { return m_ifnum; };
1104
1111
1117 inline bool HadLink() { return bHadLink; }
1118
1128 IPV6_PREFIX *AddStaticAddress(const IPADDR6 &ip, int PrefixLen);
1129
1139
1149
1159
1169
1178 bool RemoveStaticDNS(const IPADDR6 &ip);
1179
1185 void SetStaticDNS(IPADDR6 dns) { m_StaticDNS = dns; };
1186
1190 inline void StartDHCP_Solicit() { NB::V6::DHCPv6::DHCPClient::ProcessDHCPAvail(this, (uint8_t)RA_FLAG_MANAGED_IP); }
1191
1195 inline void StartDHCP_InfoReq() { NB::V6::DHCPv6::DHCPClient::ProcessDHCPAvail(this, (uint8_t)RA_FLAG_OTHER_AVAIL); }
1196
1206 bool IsMyAddress(const IPADDR6 &ip6, bool bMustBePrefered);
1207
1216 bool OnLink(const IPADDR6 &ip6);
1217
1226 bool HasRoute(const IPADDR6 &ip6);
1227
1233 void NotifyReachable(const IPADDR6 &ip6);
1234
1241
1248 {
1249 IPV6_PREFIX *pPrefix = FirstPrefix();
1250 if (pPrefix) return pPrefix->m_IPAddress;
1251 return IPADDR6::NullIP();
1252 };
1253
1261 {
1262 IPV6_PREFIX *pPrefix = FindPrefix(ip);
1263 if (pPrefix)
1264 {
1265 pPrefix = pPrefix->GetNext();
1266 if (pPrefix) return pPrefix->m_IPAddress;
1267 }
1268 return IPADDR6::NullIP();
1269 };
1270
1276 IPv6Interface(int ifnum);
1277
1288 int ping(const IPADDR6 &ip, uint16_t id, uint16_t seq, uint16_t wait, int siz);
1289
1297 int SendMLDRegistration(const IPADDR &regAddr, bool joinNotLeave = true);
1298
1304 void ShowInfo();
1305
1311 static void ShowAllInfo();
1312};
1313
1320
1321#endif
1322
NetBurner Buffers API.
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
Definition ipv6_addr.h:41
bool IsLinkLocal() const
Check if the IP address is the link-local address for the interface.
Definition ipv6_addr.h:175
static IPADDR6 NullIP()
Static function to return a null IPADDR6 object.
Main IPv6 interface management class.
Definition ipv6_interface.h:889
bool RemoveDefaultGateway(const IPADDR6 &ip)
Remove default gateway from interface.
bool IsMyAddress(const IPADDR6 &ip6, bool bMustBePrefered)
Check if IPv6 address belongs to this interface.
void NotifyUnreachable(const IPADDR6 &ip)
Notify that neighbor is unreachable.
void StartDHCP_Solicit()
Start DHCPv6 solicitation process.
Definition ipv6_interface.h:1190
IPADDR6 MySourceAddress(const IPADDR6 &ip)
Determine best source address for communicating with destination.
bool RemoveStaticDNS(const IPADDR6 &ip)
Remove static DNS server from interface.
IPADDR6 MyDNSAddress()
Get DNS server address for this interface.
IPADDR6 GetMyFirstAddress()
Get first configured IPv6 address.
Definition ipv6_interface.h:1247
static IPv6Interface * GetFirst_IP6_Interface()
Get first IPv6 interface in the system.
bool HadLink()
Check if interface has had link connectivity.
Definition ipv6_interface.h:1117
bool OnLink(const IPADDR6 &ip6)
Check if IPv6 address is on-link for this interface.
int SendMLDRegistration(const IPADDR &regAddr, bool joinNotLeave=true)
Send MLD registration message.
IPADDR6 GetMyNextAddress(const IPADDR6 &ip)
Get next IPv6 address after specified address.
Definition ipv6_interface.h:1260
void SetStaticDNS(IPADDR6 dns)
Set static DNS server address.
Definition ipv6_interface.h:1185
void ShowInfo()
Display IPv6 information for this interface.
uint16_t GetDestinationMTU(const IPADDR &ip)
Get destination MTU for specified address.
IPv6Interface(int ifnum)
Constructor for IPv6 interface.
bool RemoveStaticAddress(const IPADDR6 &ip)
Remove static IPv6 address from interface.
IPv6Interface * GetNext_IP6_Interface()
Get next IPv6 interface in the list.
void NotifyReachable(const IPADDR6 &ip6)
Notify that neighbor is reachable.
IPV6_ROUTER * AddDefaultGateway(const IPADDR6 &ip)
Add default gateway to interface.
IPADDR6 m_StaticDNS
Static DNS server address.
Definition ipv6_interface.h:1032
static IPv6Interface * GetInterfaceN(int n)
Get IPv6 interface by interface number.
friend int Ping6(const IPADDR6 &to, uint16_t id, uint16_t seq, uint16_t maxwaitticks, int size)
Send an IPv6 "ping" packet and wait the specified timeout for a response.
IPV6_DNS * AddStaticDNS(const IPADDR6 &ip)
Add static DNS server to interface.
IPV6_PREFIX * AddStaticAddress(const IPADDR6 &ip, int PrefixLen)
Add static IPv6 address to interface.
static IPv6Interface * GetInterfaceForSource(const IPADDR6 &ip)
Find interface that should be used as source for specified destination.
bool HasRoute(const IPADDR6 &ip6)
Check if there is a route to the specified IPv6 address.
void StartDHCP_InfoReq()
Start DHCPv6 information request process.
Definition ipv6_interface.h:1195
friend void InitIPv6(int ifnum)
int ping(const IPADDR6 &ip, uint16_t id, uint16_t seq, uint16_t wait, int siz)
Send IPv6 ping to specified address.
IPV6_PREFIX * m_pMyLinkLocal
Link-local address for this interface.
Definition ipv6_interface.h:1031
static IPv6Interface * GetInterfaceForDestination(const IPADDR6 &ip)
Find interface that can reach the specified destination.
int GetInterfaceNumber()
Get interface number.
Definition ipv6_interface.h:1103
static void ShowAllInfo()
Display IPv6 information for all interfaces.
Used to store and manipulate MAC addresses.
Definition nettypes.h:69
UDP Packet Class.
Definition udp.h:81
int Ping6ViaInterface(const IPADDR &to, uint16_t id, uint16_t seq, uint16_t wait, int interface, int size=32)
Send an IPv6 "ping" packet via a specific network interface.
void ShowIP6Counters()
Display IPv6 counters and statistics.
IPV6_ROOT_EL_TYPE
IPv6 root element types enumeration.
Definition ipv6_interface.h:195
@ IPV6_ROOT_TYPE_DHCPD
DHCPv6 server element.
Definition ipv6_interface.h:199
@ IPV6_ROOT_TYPE_EL_CONTAINER
Element container.
Definition ipv6_interface.h:197
@ IPV6_ROOT_TYPE_DNS
DNS server element.
Definition ipv6_interface.h:201
@ IPV6_ROOT_TYPE_DEST
Destination cache element.
Definition ipv6_interface.h:203
@ IPV6_ROOT_TYPE_PREFIX
Address prefix element.
Definition ipv6_interface.h:200
@ IPV6_ROOT_TYPE_EL
Base root element.
Definition ipv6_interface.h:196
@ IPV6_ROOT_TYPE_ROUTER
Router element.
Definition ipv6_interface.h:198
@ IPV6_ROOT_TYPE_NEIGHBOR
Neighbor cache element.
Definition ipv6_interface.h:202
eMY_NEIGHBOR_STATE
IPv6 neighbor states enumeration.
Definition ipv6_interface.h:749
@ eStale
More than ReachableTime since reachability was confirmed.
Definition ipv6_interface.h:752
@ eProbe
Actively probing neighbor reachability.
Definition ipv6_interface.h:754
@ eDelay
More than ReachableTime, packet sent, waiting for upper layer.
Definition ipv6_interface.h:753
@ eIncomplete
Address resolution in progress.
Definition ipv6_interface.h:750
@ eReachable
Reachability confirmed within ReachableTime.
Definition ipv6_interface.h:751
eMY_ADDR_STATE
IPv6 address states enumeration.
Definition ipv6_interface.h:466
ePrefixSource
IPv6 prefix source enumeration.
Definition ipv6_interface.h:479
eRouteOutResult
Route output result enumeration.
Definition ipv6_interface.h:627
@ eInvalid
Address is invalid.
Definition ipv6_interface.h:470
@ eValid_Depricated
Address is valid but deprecated.
Definition ipv6_interface.h:469
@ eTenative
Address is tentative (duplicate address detection in progress)
Definition ipv6_interface.h:467
@ eValid_Preferred
Address is valid and preferred.
Definition ipv6_interface.h:468
@ eRouter
From router advertisement.
Definition ipv6_interface.h:481
@ eDHCP
From DHCPv6.
Definition ipv6_interface.h:482
@ eStatic
Statically configured.
Definition ipv6_interface.h:483
@ eLinkLocal
Link-local address.
Definition ipv6_interface.h:480
@ eUnknown
Unknown source.
Definition ipv6_interface.h:484
@ eSent
Packet was sent successfully.
Definition ipv6_interface.h:628
@ eDoingND
Performing neighbor discovery.
Definition ipv6_interface.h:629
@ eNoRoute
No route available.
Definition ipv6_interface.h:630
NetBurner IPADDR6 Class.
NetBurner IPADDR4 Class. See the IPADDR4 Class page for complete documentation.
IPv6 destination cache element.
Definition ipv6_interface.h:643
uint16_t m_PathMTU
Path MTU to this destination.
Definition ipv6_interface.h:645
virtual bool AgeStillValidTest()
Check if destination is still valid.
virtual void ShowItem()
Display destination information.
bool m_bStaticRoute
True if this is a static route.
Definition ipv6_interface.h:648
int m_nLockCount
Reference count to prevent destruction.
Definition ipv6_interface.h:647
uint32_t m_nSecsLastUsed
Last time this destination was used.
Definition ipv6_interface.h:646
IPV6_DEST * GetNext()
Get next destination in list.
Definition ipv6_interface.h:655
void free_element()
Free resources for this destination.
IPV6_NEIGHBOR * m_pNeighbor
Associated neighbor entry.
Definition ipv6_interface.h:644
DHCPv6 server information element.
Definition ipv6_interface.h:327
virtual void ShowItem()
Display DHCP server information.
uint32_t GetDhcpRebindTime()
Get DHCP rebind time.
Definition ipv6_interface.h:370
void free_element()
Free resources for this DHCP server element.
uint32_t GetDhcpRenewTime()
Get DHCP renew time.
Definition ipv6_interface.h:363
IPV6_PREFIX * FindIA_Addr(IPV6_PREFIX *start)
Find associated IA address starting from given prefix.
uint32_t m_IAID
Identity Association Identifier.
Definition ipv6_interface.h:329
uint32_t m_renewTick
Tick when lease should be renewed.
Definition ipv6_interface.h:330
virtual bool AgeStillValidTest()
Check if DHCP lease is still valid.
uint8_t m_ServerID[CLIENT_LONG_SERVID]
Space to contain the ServerID of the leasing server.
Definition ipv6_interface.h:328
uint32_t m_rebindTick
Tick when lease should be rebound.
Definition ipv6_interface.h:331
IPv6 DNS server information element.
Definition ipv6_interface.h:696
virtual bool AgeStillValidTest()
Check if DNS server is still valid.
IPV6_DNS * GetNext()
Get next DNS server in list.
Definition ipv6_interface.h:706
IPV6_DHCPD * pDHCPD
DHCP server that provided this DNS server.
Definition ipv6_interface.h:699
virtual void ShowItem()
Display DNS server information.
uint32_t m_nSecsToBeValid
Seconds until this DNS entry expires.
Definition ipv6_interface.h:697
void CleanUpAndRemove()
Clean up and remove DNS server from lists.
IPV6_ROUTER * pRouter
Router that provided this DNS server.
Definition ipv6_interface.h:698
void free_element()
Free resources for this DNS server.
DHCPv6 Identity Association address element.
Definition ipv6_interface.h:377
void free_element()
Free resources for this IA address.
virtual void ShowItem()
Display IA address information.
virtual bool AgeStillValidTest()
Check if IA address is still valid.
IPv6 neighbor cache element.
Definition ipv6_interface.h:764
uint8_t m_SentNDCount
Number of neighbor solicitations sent.
Definition ipv6_interface.h:767
uint32_t m_TickTimeOfNextAction
When next action should be taken.
Definition ipv6_interface.h:768
IPV6_NEIGHBOR * GetNext()
Get next neighbor in list.
Definition ipv6_interface.h:785
void Send_ND_Solicit(bool multicast)
Send neighbor solicitation message.
void CoreSendPend(PoolPtr pp)
Queue packet for transmission when neighbor becomes reachable.
virtual bool AgeStillValidTest()
Check if neighbor is still valid.
eRouteOutResult Send(IPv6FrameProcessingStruct &p6proc, uint16_t mtu)
Attempt to send packet via this neighbor.
virtual void ShowItem()
Display neighbor information.
IPV6_ROUTER * m_pRouter
Associated router entry.
Definition ipv6_interface.h:771
PoolPtr m_pOutBound1
First pending outbound packet.
Definition ipv6_interface.h:772
void ProcessTick()
Process timer tick for neighbor discovery.
bool SendPending()
Send any pending packets.
eMY_NEIGHBOR_STATE GetState()
Get current neighbor state.
Definition ipv6_interface.h:859
bool ProcessAdvert(IPv6FrameProcessingStruct &p6proc, ICMP6_ND_ADVERT *pRsp)
Process neighbor advertisement message.
void free_element()
Free resources for this neighbor.
MACADR m_Macaddr
MAC address of this neighbor.
Definition ipv6_interface.h:765
bool StillValidToSend()
Check if neighbor is still valid for sending.
bool m_bActiveTimer
Whether timer processing is active.
Definition ipv6_interface.h:769
void Discard()
Discard pending packets and clean up.
PoolPtr m_pOutBound2
Second pending outbound packet.
Definition ipv6_interface.h:773
IPV6_NEIGHBOR()
Default constructor.
eMY_NEIGHBOR_STATE m_NeighborState
Current neighbor discovery state.
Definition ipv6_interface.h:766
void SetState(eMY_NEIGHBOR_STATE s)
Set neighbor discovery state.
IPv6 prefix and address management element.
Definition ipv6_interface.h:493
eMY_ADDR_STATE GetState()
Get current state of this address.
Definition ipv6_interface.h:550
uint8_t PrefixLen
Prefix length in bits.
Definition ipv6_interface.h:501
void CleanUpAndRemove()
Clean up and remove prefix from lists.
IPV6_ROUTER * pRouter
Router that established this prefix.
Definition ipv6_interface.h:499
bool bOnLink
On-link flag.
Definition ipv6_interface.h:503
virtual void ShowItem()
Display prefix information.
uint32_t GetRemainingDhcpLeaseTime()
Get remaining DHCP lease time.
Definition ipv6_interface.h:589
bool AgeStillPreferred()
Check if prefix is still preferred based on aging.
eMY_ADDR_STATE m_state
Current state of this address.
Definition ipv6_interface.h:494
bool OnLink(const IPADDR6 &ip)
Check if given IP address is on-link for this prefix.
uint32_t GetRemainingDhcpLeasePreferredTime()
Get remaining DHCP preferred time.
Definition ipv6_interface.h:596
void free_element()
Free resources for this prefix.
virtual bool AgeStillValidTest()
Check if prefix is still valid based on aging.
uint32_t time_to_lose_prefered_in_secs_from_establish
Preferred lifetime from establishment.
Definition ipv6_interface.h:495
void CheckTenative()
Check tentative state and perform duplicate address detection.
bool bValidForInterface
Valid for this interface.
Definition ipv6_interface.h:502
uint32_t RemainingValidTime()
Get remaining valid time for this prefix.
Definition ipv6_interface.h:576
uint32_t time_to_lose_valid_in_secs_from_establish
Valid lifetime from establishment.
Definition ipv6_interface.h:496
bool Prefered()
Check if this prefix is preferred.
IPV6_DHCPD * pDHCPD
DHCP server that established this prefix.
Definition ipv6_interface.h:500
IPV6_PREFIX * GetNext()
Get next prefix in list.
Definition ipv6_interface.h:510
ePrefixSource Source()
Get the source of this prefix.
Definition ipv6_interface.h:562
IPV6_PREFIX()
Default constructor.
uint32_t max_valid_time_seen
Maximum valid time seen (for IOL cleanup)
Definition ipv6_interface.h:498
uint32_t time_established_in_secs
When this prefix was established.
Definition ipv6_interface.h:497
Container for managing collections of IPv6 root elements.
Definition ipv6_interface.h:249
void Show()
Display all elements in container.
void Remove(IPV6_ROOT_EL *pEl)
Remove element from container.
void Attach(IPv6Interface &Interface, const char *name)
Attach container to an interface.
IPV6_ROOT_EL * Find(const IPADDR6 &ip, bool age)
Find element by IPv6 address.
void InsertBack(IPV6_ROOT_EL *pEl)
Insert element at the tail of the list.
IPv6Interface * m_pInterface
Interface that owns this container.
Definition ipv6_interface.h:253
void MoveToTop(IPV6_ROOT_EL *pEl)
Move element to top of list.
IPV6_ROOT_EL * m_pHead
Head of element list.
Definition ipv6_interface.h:251
IPV6_ROOT_EL * First()
Get first element in container.
void Insert(IPV6_ROOT_EL *pEl)
Insert element at the head of the list.
IPV6_ROOT_EL_CONTAINER()
Default constructor.
int m_nElements
Number of elements in container.
Definition ipv6_interface.h:254
IPV6_ROOT_EL * m_pTail
Tail of element list.
Definition ipv6_interface.h:252
const char * m_name
Name of this container.
Definition ipv6_interface.h:250
Base class for all IPv6 interface elements.
Definition ipv6_interface.h:213
virtual void free_element()
Free resources associated with this element.
IPV6_ROOT_EL * m_pNext
Next element in list.
Definition ipv6_interface.h:214
IPV6_ROOT_EL_CONTAINER * m_pContainer
Container that owns this element.
Definition ipv6_interface.h:216
IPV6_ROOT_EL * m_pPrev
Previous element in list.
Definition ipv6_interface.h:215
virtual ~IPV6_ROOT_EL()
Virtual destructor.
virtual void ShowItem()
Display information about this element.
IPADDR6 m_IPAddress
IPv6 address associated with this element.
Definition ipv6_interface.h:217
virtual bool AgeStillValidTest()
Test if this element is still valid based on aging.
IPv6 router information element.
Definition ipv6_interface.h:411
IPV6_ROUTER * GetNextValid()
Get next valid router in list.
uint16_t m_PathMTU
Path MTU for this router.
Definition ipv6_interface.h:416
void RemoveFromDefault()
Remove router from default router list.
IPV6_NEIGHBOR * m_pNeighbor
Associated neighbor entry.
Definition ipv6_interface.h:414
IPV6_ROUTER * GetNext()
Get next router in list.
void CleanUpAndRemove()
Clean up and remove router from lists.
virtual void ShowItem()
Display router information.
void free_element()
Free resources for this router.
uint32_t m_SecsLastAdvertise
Seconds since last router advertisement.
Definition ipv6_interface.h:413
virtual bool AgeStillValidTest()
Check if router is still valid.
uint32_t m_Life_In_Secs
Router lifetime in seconds.
Definition ipv6_interface.h:415
uint16_t m_CheckSumCache
Cached checksum value.
Definition ipv6_interface.h:412
IPv6 frame processing structure for packet analysis and header walking.
Definition ipv6_interface.h:69
puint8_t GetDataPointer()
Get pointer to frame data.
Definition ipv6_interface.h:145
bool RouterHeaderParseHasError(puint8_t pData, int *pError_offset)
Check routing header for errors.
EFRAME * GetEframe()
Get pointer to Ethernet frame.
Definition ipv6_interface.h:157
uint8_t WalkNextHeader(int *pError_offset=NULL)
Walk through IPv6 extension headers to the next header.
IPv6FrameProcessingStruct()
Default constructor.
Definition ipv6_interface.h:131
uint8_t * pData
Pointer to current data location.
Definition ipv6_interface.h:72
uint8_t * pLargeData
Used for fragments larger than 1500 bytes.
Definition ipv6_interface.h:74
void release()
Release buffer pool resources.
uint16_t nDataLen
Length of current data segment.
Definition ipv6_interface.h:73
void free_proc_struct()
Free the processing structure and associated resources.
bool HopByHopParseHasError(puint8_t pData, int *pError_offset)
Check hop-by-hop options header for errors.
bool DestOptHasError(puint8_t pData, int *pError_offset)
Check destination options header for errors.
IP6FRAME * pIPf
Pointer to IPv6 frame header.
Definition ipv6_interface.h:71
PoolPtr root_pp
Root buffer pool pointer.
Definition ipv6_interface.h:70
IPv6FrameProcessingStruct(PoolPtr pp)
Constructor with buffer pool.
An OS_CRIT object is used to establish critical sections of code that can only be run by one task at ...
Definition nbrtos.h:1110
Definition nbrtos.h:932
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
NetBurner Utilities API.