pull/61/head
Kurt Wachowski 2023-08-02 13:52:52 +00:00
parent 237bed1b72
commit 41d6927496
1 changed files with 496 additions and 287 deletions

View File

@ -2,6 +2,7 @@
#define __NETWORKID_H_
#include <stdint.h>
typedef uint16_t neonetid_t;
typedef uint8_t neonettype_t;
@ -12,258 +13,265 @@ typedef uint8_t neonettype_t;
namespace icsneo {
class Network {
public:
enum class NetID : neonetid_t {
Device = 0,
HSCAN = 1,
MSCAN = 2,
SWCAN = 3,
LSFTCAN = 4,
FordSCP = 5,
J1708 = 6,
Aux = 7,
J1850VPW = 8,
ISO9141 = 9,
ISOPIC = 10,
Main51 = 11,
RED = 12,
SCI = 13,
ISO9141_2 = 14,
ISO14230 = 15,
LIN = 16,
OP_Ethernet1 = 17,
OP_Ethernet2 = 18,
OP_Ethernet3 = 19,
class Network {
static constexpr uint16_t OFFSET_PLASMA_SLAVE1 = 100;
static constexpr uint16_t OFFSET_PLASMA_SLAVE2 = 200;
static constexpr uint16_t COUNT_PLASMA_SLAVE = 51;
static constexpr uint16_t OFFSET_PLASMA_SLAVE1_RANGE2 = 4608;
static constexpr uint16_t OFFSET_PLASMA_SLAVE2_RANGE2 = 8704;
static constexpr uint16_t OFFSET_PLASMA_SLAVE3_RANGE2 = 12800;
// START Device Command Returns
// When we send a command, the device returns on one of these, depending on command
RED_EXT_MEMORYREAD = 20,
RED_INT_MEMORYREAD = 21,
RED_DFLASH_READ = 22,
NeoMemorySDRead = 23, // Response from NeoMemory (MemoryTypeSD)
CAN_ERRBITS = 24,
NeoMemoryWriteDone = 25,
RED_WAVE_CAN1_LOGICAL = 26,
RED_WAVE_CAN2_LOGICAL = 27,
RED_WAVE_LIN1_LOGICAL = 28,
RED_WAVE_LIN2_LOGICAL = 29,
RED_WAVE_LIN1_ANALOG = 30,
RED_WAVE_LIN2_ANALOG = 31,
RED_WAVE_MISC_ANALOG = 32,
RED_WAVE_MISCDIO2_LOGICAL = 33,
RED_NETWORK_COM_ENABLE_EX = 34,
RED_NEOVI_NETWORK = 35,
RED_READ_BAUD_SETTINGS = 36,
RED_OLDFORMAT = 37,
RED_SCOPE_CAPTURE = 38,
RED_HARDWARE_EXCEP = 39,
RED_GET_RTC = 40,
// END Device Command Returns
public:
enum class NetID : neonetid_t {
Device = 0,
HSCAN = 1,
MSCAN = 2,
SWCAN = 3,
LSFTCAN = 4,
FordSCP = 5,
J1708 = 6,
Aux = 7,
J1850VPW = 8,
ISO9141 = 9,
ISOPIC = 10,
Main51 = 11,
RED = 12,
SCI = 13,
ISO9141_2 = 14,
ISO14230 = 15,
LIN = 16,
OP_Ethernet1 = 17,
OP_Ethernet2 = 18,
OP_Ethernet3 = 19,
ISO9141_3 = 41,
HSCAN2 = 42,
HSCAN3 = 44,
OP_Ethernet4 = 45,
OP_Ethernet5 = 46,
ISO9141_4 = 47,
LIN2 = 48,
LIN3 = 49,
LIN4 = 50,
// MOST = 51, Old and unused
RED_App_Error = 52,
CGI = 53,
Reset_Status = 54,
FB_Status = 55,
App_Signal_Status = 56,
Read_Datalink_Cm_Tx_Msg = 57,
Read_Datalink_Cm_Rx_Msg = 58,
Logging_Overflow = 59,
ReadSettings = 60,
HSCAN4 = 61,
HSCAN5 = 62,
RS232 = 63,
UART = 64,
UART2 = 65,
UART3 = 66,
UART4 = 67,
SWCAN2 = 68,
Ethernet_DAQ = 69,
Data_To_Host = 70,
TextAPI_To_Host = 71,
SPI1 = 72,
OP_Ethernet6 = 73,
Red_VBat = 74,
OP_Ethernet7 = 75,
OP_Ethernet8 = 76,
OP_Ethernet9 = 77,
OP_Ethernet10 = 78,
OP_Ethernet11 = 79,
FlexRay1a = 80,
FlexRay1b = 81,
FlexRay2a = 82,
FlexRay2b = 83,
LIN5 = 84,
FlexRay = 85,
FlexRay2 = 86,
OP_Ethernet12 = 87,
I2C = 88,
MOST25 = 90,
MOST50 = 91,
MOST150 = 92,
Ethernet = 93,
GMFSA = 94,
TCP = 95,
HSCAN6 = 96,
HSCAN7 = 97,
LIN6 = 98,
LSFTCAN2 = 99,
LogicalDiskInfo = 187,
WiVICommand = 221,
ScriptStatus = 224,
EthPHYControl = 239,
ExtendedCommand = 240,
ExtendedData = 242,
FlexRayControl = 243,
CoreMiniPreLoad = 244,
HW_COM_Latency_Test = 512,
DeviceStatus = 513,
UDP = 514,
ForwardedMessage = 516,
I2C2 = 517,
I2C3 = 518,
I2C4 = 519,
Ethernet2 = 520,
A2B1 = 522,
A2B2 = 523,
Ethernet3 = 524,
WBMS = 532,
DWCAN9 = 534,
DWCAN10 = 535,
DWCAN11 = 536,
DWCAN12 = 537,
DWCAN13 = 538,
DWCAN14 = 539,
DWCAN15 = 540,
DWCAN16 = 541,
LIN7 = 542,
LIN8 = 543,
SPI2 = 544,
MDIO1 = 545,
MDIO2 = 546,
MDIO3 = 547,
MDIO4 = 548,
MDIO5 = 549,
MDIO6 = 550,
MDIO7 = 551,
MDIO8 = 552,
Any = 0xfffe, // Never actually set as type, but used as flag for filtering
Invalid = 0xffff
};
enum class Type : neonettype_t {
Invalid = 0,
Internal = 1, // Used for statuses that don't actually need to be transferred to the client application
CAN = 2,
LIN = 3,
FlexRay = 4,
MOST = 5,
Ethernet = 6,
LSFTCAN = 7,
SWCAN = 8,
ISO9141 = 9,
I2C = 10,
A2B = 11,
SPI = 12,
MDIO = 13,
Any = 0xFE, // Never actually set as type, but used as flag for filtering
Other = 0xFF
};
enum class CoreMini : uint8_t {
HSCAN = 0,
MSCAN = 1,
LIN = 2,
LIN2 = 3,
Virtual = 4,
HSCAN2 = 5,
LSFTCAN = 6,
SWCAN = 7,
HSCAN3 = 8,
CGI = 9,
J1850VPW = 10,
LIN3 = 11,
LIN4 = 12,
J1708 = 13,
HSCAN4 = 14,
HSCAN5 = 15,
KLine1 = 16,
KLine2 = 17,
KLine3 = 18,
KLine4 = 19,
FlexRay1a = 20,
UART = 21,
UART2 = 22,
LIN5 = 23,
MOST25 = 24,
MOST50 = 25,
FlexRay1b = 26,
SWCAN2 = 27,
EthernetDAQ = 28,
Ethernet = 29,
FlexRay2a = 30,
FlexRay2b = 31,
HSCAN6 = 32,
HSCAN7 = 33,
LIN6 = 34,
LSFTCAN2 = 35,
OP_Ethernet1 = 36,
OP_Ethernet2 = 37,
OP_Ethernet3 = 38,
OP_Ethernet4 = 39,
OP_Ethernet5 = 40,
OP_Ethernet6 = 41,
OP_Ethernet7 = 42,
OP_Ethernet8 = 43,
OP_Ethernet9 = 44,
OP_Ethernet10 = 45,
OP_Ethernet11 = 46,
OP_Ethernet12 = 47,
TCPVirtual = 48,
UDPVirtual = 49,
FlexRay1 = 50,
FlexRay2 = 51,
ForwardedMessage = 52,
I2C1 = 53,
I2C2 = 54,
I2C3 = 55,
I2C4 = 56,
Ethernet2 = 57,
A2B1 = 58,
A2B2 = 59,
Ethernet3 = 60,
WBMS = 61,
DWCAN9 = 62,
DWCAN10 = 63,
DWCAN11 = 64,
DWCAN12 = 65,
DWCAN13 = 66,
DWCAN14 = 67,
DWCAN15 = 68,
DWCAN16 = 69,
LIN7 = 70,
LIN8 = 71,
SPI1 = 72,
SPI2 = 73,
MDIO1 = 75,
MDIO2 = 76,
MDIO3 = 77,
MDIO4 = 78,
MDIO5 = 79,
MDIO6 = 80,
MDIO7 = 81,
MDIO8 = 82,
};
static const char* GetTypeString(Type type) {
switch(type) {
// START Device Command Returns
// When we send a command, the device returns on one of these, depending on command
RED_EXT_MEMORYREAD = 20,
RED_INT_MEMORYREAD = 21,
RED_DFLASH_READ = 22,
NeoMemorySDRead = 23, // Response from NeoMemory (MemoryTypeSD)
CAN_ERRBITS = 24,
NeoMemoryWriteDone = 25,
RED_WAVE_CAN1_LOGICAL = 26,
RED_WAVE_CAN2_LOGICAL = 27,
RED_WAVE_LIN1_LOGICAL = 28,
RED_WAVE_LIN2_LOGICAL = 29,
RED_WAVE_LIN1_ANALOG = 30,
RED_WAVE_LIN2_ANALOG = 31,
RED_WAVE_MISC_ANALOG = 32,
RED_WAVE_MISCDIO2_LOGICAL = 33,
RED_NETWORK_COM_ENABLE_EX = 34,
RED_NEOVI_NETWORK = 35,
RED_READ_BAUD_SETTINGS = 36,
RED_OLDFORMAT = 37,
RED_SCOPE_CAPTURE = 38,
RED_HARDWARE_EXCEP = 39,
RED_GET_RTC = 40,
// END Device Command Returns
ISO9141_3 = 41,
HSCAN2 = 42,
HSCAN3 = 44,
OP_Ethernet4 = 45,
OP_Ethernet5 = 46,
ISO9141_4 = 47,
LIN2 = 48,
LIN3 = 49,
LIN4 = 50,
// MOST = 51, Old and unused
RED_App_Error = 52,
CGI = 53,
Reset_Status = 54,
FB_Status = 55,
App_Signal_Status = 56,
Read_Datalink_Cm_Tx_Msg = 57,
Read_Datalink_Cm_Rx_Msg = 58,
Logging_Overflow = 59,
ReadSettings = 60,
HSCAN4 = 61,
HSCAN5 = 62,
RS232 = 63,
UART = 64,
UART2 = 65,
UART3 = 66,
UART4 = 67,
SWCAN2 = 68,
Ethernet_DAQ = 69,
Data_To_Host = 70,
TextAPI_To_Host = 71,
SPI1 = 72,
OP_Ethernet6 = 73,
Red_VBat = 74,
OP_Ethernet7 = 75,
OP_Ethernet8 = 76,
OP_Ethernet9 = 77,
OP_Ethernet10 = 78,
OP_Ethernet11 = 79,
FlexRay1a = 80,
FlexRay1b = 81,
FlexRay2a = 82,
FlexRay2b = 83,
LIN5 = 84,
FlexRay = 85,
FlexRay2 = 86,
OP_Ethernet12 = 87,
I2C = 88,
MOST25 = 90,
MOST50 = 91,
MOST150 = 92,
Ethernet = 93,
GMFSA = 94,
TCP = 95,
HSCAN6 = 96,
HSCAN7 = 97,
LIN6 = 98,
LSFTCAN2 = 99,
LogicalDiskInfo = 187,
WiVICommand = 221,
ScriptStatus = 224,
EthPHYControl = 239,
ExtendedCommand = 240,
ExtendedData = 242,
FlexRayControl = 243,
CoreMiniPreLoad = 244,
HW_COM_Latency_Test = 512,
DeviceStatus = 513,
UDP = 514,
ForwardedMessage = 516,
I2C2 = 517,
I2C3 = 518,
I2C4 = 519,
Ethernet2 = 520,
A2B1 = 522,
A2B2 = 523,
Ethernet3 = 524,
WBMS = 532,
DWCAN9 = 534,
DWCAN10 = 535,
DWCAN11 = 536,
DWCAN12 = 537,
DWCAN13 = 538,
DWCAN14 = 539,
DWCAN15 = 540,
DWCAN16 = 541,
LIN7 = 542,
LIN8 = 543,
SPI2 = 544,
MDIO1 = 545,
MDIO2 = 546,
MDIO3 = 547,
MDIO4 = 548,
MDIO5 = 549,
MDIO6 = 550,
MDIO7 = 551,
MDIO8 = 552,
Any = 0xfffe, // Never actually set as type, but used as flag for filtering
Invalid = 0xffff
};
enum class Type : neonettype_t {
Invalid = 0,
Internal = 1, // Used for statuses that don't actually need to be transferred to the client application
CAN = 2,
LIN = 3,
FlexRay = 4,
MOST = 5,
Ethernet = 6,
LSFTCAN = 7,
SWCAN = 8,
ISO9141 = 9,
I2C = 10,
A2B = 11,
SPI = 12,
MDIO = 13,
Any = 0xFE, // Never actually set as type, but used as flag for filtering
Other = 0xFF
};
enum class CoreMini : uint8_t {
HSCAN = 0,
MSCAN = 1,
LIN = 2,
LIN2 = 3,
Virtual = 4,
HSCAN2 = 5,
LSFTCAN = 6,
SWCAN = 7,
HSCAN3 = 8,
CGI = 9,
J1850VPW = 10,
LIN3 = 11,
LIN4 = 12,
J1708 = 13,
HSCAN4 = 14,
HSCAN5 = 15,
KLine1 = 16,
KLine2 = 17,
KLine3 = 18,
KLine4 = 19,
FlexRay1a = 20,
UART = 21,
UART2 = 22,
LIN5 = 23,
MOST25 = 24,
MOST50 = 25,
FlexRay1b = 26,
SWCAN2 = 27,
EthernetDAQ = 28,
Ethernet = 29,
FlexRay2a = 30,
FlexRay2b = 31,
HSCAN6 = 32,
HSCAN7 = 33,
LIN6 = 34,
LSFTCAN2 = 35,
OP_Ethernet1 = 36,
OP_Ethernet2 = 37,
OP_Ethernet3 = 38,
OP_Ethernet4 = 39,
OP_Ethernet5 = 40,
OP_Ethernet6 = 41,
OP_Ethernet7 = 42,
OP_Ethernet8 = 43,
OP_Ethernet9 = 44,
OP_Ethernet10 = 45,
OP_Ethernet11 = 46,
OP_Ethernet12 = 47,
TCPVirtual = 48,
UDPVirtual = 49,
FlexRay1 = 50,
FlexRay2 = 51,
ForwardedMessage = 52,
I2C1 = 53,
I2C2 = 54,
I2C3 = 55,
I2C4 = 56,
Ethernet2 = 57,
A2B1 = 58,
A2B2 = 59,
Ethernet3 = 60,
WBMS = 61,
DWCAN9 = 62,
DWCAN10 = 63,
DWCAN11 = 64,
DWCAN12 = 65,
DWCAN13 = 66,
DWCAN14 = 67,
DWCAN15 = 68,
DWCAN16 = 69,
LIN7 = 70,
LIN8 = 71,
SPI1 = 72,
SPI2 = 73,
MDIO1 = 75,
MDIO2 = 76,
MDIO3 = 77,
MDIO4 = 78,
MDIO5 = 79,
MDIO6 = 80,
MDIO7 = 81,
MDIO8 = 82,
};
static const char* GetTypeString(Type type) {
switch (type) {
case Type::CAN:
return "CAN";
case Type::LIN:
@ -295,10 +303,202 @@ public:
case Type::Invalid:
default:
return "Invalid Type";
}
}
}
static Type GetTypeOfNetID(NetID netid) {
switch(netid) {
enum class VnetId : uint8_t {
None = 0,
VNET_A = 1,
VNET_B = 2,
};
/**
* So if you are passing in the offset from OFFSET_PLASMA_SLAVE1 or
* the offset from OFFSET_PLASMA_SLAVE2, return the vnet agnostic
* netid so caller can commonize handlers without caring about WHICH slave.
*/
static NetID OffsetToSimpleNetworkId(uint16_t offset)
{
switch (offset)
{
default:
case 0:
return NetID::Device;
case 1:
return NetID::HSCAN;
case 2:
return NetID::MSCAN;
case 3:
return NetID::SWCAN;
case 4:
return NetID::LSFTCAN;
case 5:
return NetID::FordSCP;
case 6:
return NetID::J1708;
case 7:
return NetID::Aux;
case 8:
return NetID::J1850VPW;
case 9:
return NetID::ISO9141;
case 10:
return NetID::ISOPIC;
case 11:
return NetID::Main51;
case 12:
return NetID::RED;
case 13:
return NetID::SCI;
case 14:
return NetID::ISO9141_2;
case 15:
return NetID::ISO14230;
case 16:
return NetID::LIN;
case 17:
return NetID::ISO9141_3;
case 18:
return NetID::HSCAN2;
case 19:
return NetID::HSCAN3;
case 20:
return NetID::ISO9141_4;
case 21:
return NetID::LIN2;
case 22:
return NetID::LIN3;
case 23:
return NetID::LIN4;
//case 24:
// return NetID::MOST; // Deprecated
case 25:
return NetID::CGI;
case 26:
return NetID::I2C;
case 27:
return NetID::SPI1;
case 28:
return NetID::FlexRay1a;
case 29:
return NetID::MOST25;
case 30:
return NetID::MOST50;
case 31:
return NetID::MOST150;
case 32:
return NetID::HSCAN4;
case 33:
return NetID::HSCAN5;
case 34:
return NetID::RS232;
case 35:
return NetID::UART;
case 36:
return NetID::UART2;
case 37:
return NetID::UART3;
case 38:
return NetID::UART4;
case 39:
return NetID::SWCAN2;
case 40:
return NetID::FlexRay1b;
case 41:
return NetID::FlexRay2a;
case 42:
return NetID::FlexRay2b;
case 43:
return NetID::LIN5;
case 44:
return NetID::Ethernet;
case 45:
return NetID::Ethernet_DAQ;
case 46:
return NetID::RED_App_Error;
case 47:
return NetID::HSCAN6;
case 48:
return NetID::HSCAN7;
case 49:
return NetID::LIN6;
case 50:
return NetID::LSFTCAN2;
}
}
static bool Within(neonetid_t value, neonetid_t min, neonetid_t max)
{
return ((min <= value) && (value < max));
}
static bool IdIsSlaveARange1(neonetid_t fullNetid)
{
return Within(fullNetid, OFFSET_PLASMA_SLAVE1, OFFSET_PLASMA_SLAVE1 + COUNT_PLASMA_SLAVE);
}
static bool IdIsSlaveARange2(neonetid_t fullNetid)
{
return Within(fullNetid, OFFSET_PLASMA_SLAVE1_RANGE2, OFFSET_PLASMA_SLAVE2_RANGE2);
}
static bool IdIsSlaveBRange1(neonetid_t fullNetid)
{
return Within(fullNetid, OFFSET_PLASMA_SLAVE2, OFFSET_PLASMA_SLAVE2 + COUNT_PLASMA_SLAVE);
}
static bool IdIsSlaveBRange2(neonetid_t fullNetid)
{
return Within(fullNetid, OFFSET_PLASMA_SLAVE2_RANGE2, OFFSET_PLASMA_SLAVE3_RANGE2);
}
static std::pair<VnetId, NetID> GetVnetAgnosticNetid(neonetid_t fullNetid)
{
VnetId vnetId = VnetId::None;
NetID netId;
if (fullNetid < OFFSET_PLASMA_SLAVE1)
{
netId = static_cast<NetID>(fullNetid);
}
else if (IdIsSlaveARange1(fullNetid))
{
netId = OffsetToSimpleNetworkId(fullNetid - OFFSET_PLASMA_SLAVE1);
vnetId = VnetId::VNET_A;
}
else if (IdIsSlaveARange2(fullNetid))
{
netId = static_cast<NetID>((fullNetid - OFFSET_PLASMA_SLAVE1_RANGE2));
vnetId = VnetId::VNET_A;
}
else if (IdIsSlaveBRange1(fullNetid))
{
netId = OffsetToSimpleNetworkId(fullNetid - OFFSET_PLASMA_SLAVE2);
vnetId = VnetId::VNET_B;
}
else if (IdIsSlaveBRange2(fullNetid))
{
netId = static_cast<NetID>((fullNetid - OFFSET_PLASMA_SLAVE2_RANGE2));
vnetId = VnetId::VNET_B;
}
else
{
netId = static_cast<NetID>(fullNetid);
}
return std::make_pair(vnetId, netId);
}
static const char* GetVnetIdString(VnetId vnetId)
{
switch (vnetId)
{
case VnetId::None:
return "None";
case VnetId::VNET_A:
return "VNET A";
case VnetId::VNET_B:
return "VNET B";
}
return "Invalid VNET ID";
}
static Type GetTypeOfNetID(NetID netid) {
const auto [vnetId, commonNetId] = GetVnetAgnosticNetid((neonetid_t)netid);
(void)vnetId;
switch (commonNetId) {
case NetID::HSCAN:
case NetID::MSCAN:
case NetID::HSCAN2:
@ -408,10 +608,13 @@ public:
return Type::MDIO;
default:
return Type::Other;
}
}
}
static const char* GetNetIDString(NetID netid) {
switch(netid) {
static const char* GetNetIDString(NetID netid) {
const auto [vnetId, commonNetId] = GetVnetAgnosticNetid((neonetid_t)netid);
(void)vnetId;
switch (commonNetId) {
case NetID::Device:
return "neoVI";
case NetID::HSCAN:
@ -687,11 +890,11 @@ public:
case NetID::Any:
case NetID::Invalid:
break;
}
return "Invalid Network";
}
return "Invalid Network";
}
static std::optional<CoreMini> GetCoreMiniNetworkFromNetID(NetID netid) {
switch(netid) {
static std::optional<CoreMini> GetCoreMiniNetworkFromNetID(NetID netid) {
switch (netid) {
case NetID::HSCAN:
return CoreMini::HSCAN;
case NetID::MSCAN:
@ -858,10 +1061,10 @@ public:
return CoreMini::MDIO8;
default:
return std::nullopt;
}
}
}
static NetID GetNetIDFromCoreMiniNetwork(CoreMini cm) {
switch(cm) {
static NetID GetNetIDFromCoreMiniNetwork(CoreMini cm) {
switch (cm) {
case CoreMini::HSCAN:
return NetID::HSCAN;
case CoreMini::MSCAN:
@ -1026,33 +1229,39 @@ public:
return NetID::MDIO7;
case CoreMini::MDIO8:
return NetID::MDIO8;
}
return NetID::Invalid; // Should be unreachable, the compiler should warn about new CoreMini IDs
}
return NetID::Invalid; // Should be unreachable, the compiler should warn about new CoreMini IDs
}
Network() { setValue(NetID::Invalid); }
Network(neonetid_t netid) { setValue((NetID)netid); }
Network(NetID netid) { setValue(netid); }
Network(CoreMini cm) { setValue(GetNetIDFromCoreMiniNetwork(cm)); }
NetID getNetID() const { return value; }
Type getType() const { return type; }
std::optional<CoreMini> getCoreMini() const { return GetCoreMiniNetworkFromNetID(getNetID()); }
friend std::ostream& operator<<(std::ostream& os, const Network& network) {
os << GetNetIDString(network.getNetID());
return os;
}
friend bool operator==(const Network& net1, const Network& net2) { return net1.getNetID() == net2.getNetID(); }
friend bool operator!=(const Network& net1, const Network& net2) { return !(net1 == net2); }
Network() { setValue(NetID::Invalid); }
Network(neonetid_t netid) { setValue(static_cast<NetID>(netid)); }
Network(NetID netid) { setValue(netid); }
Network(CoreMini cm) { setValue(GetNetIDFromCoreMiniNetwork(cm)); }
NetID getNetID() const { return value; }
Type getType() const { return type; }
VnetId getVnetId() const { return vnetId; }
std::optional<CoreMini> getCoreMini() const { return GetCoreMiniNetworkFromNetID(getNetID()); }
friend std::ostream& operator<<(std::ostream& os, const Network& network) {
os << GetNetIDString(network.getNetID());
return os;
}
friend bool operator==(const Network& net1, const Network& net2) { return net1.getNetID() == net2.getNetID(); }
friend bool operator!=(const Network& net1, const Network& net2) { return !(net1 == net2); }
private:
NetID value; // Always use setValue so that value and type stay in sync
Type type;
void setValue(NetID id) {
value = id;
type = GetTypeOfNetID(value);
}
};
private:
NetID value; // Always use setValue so that value and type stay in sync
Type type;
NetID commonNetId;
VnetId vnetId;
void setValue(NetID id) {
value = id;
type = GetTypeOfNetID(value);
const auto vnetIdInfo = GetVnetAgnosticNetid((neonetid_t)id);
vnetId = vnetIdInfo.first;
commonNetId = vnetIdInfo.second;
}
};
}