mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Auto formatting with AStyle
This commit is contained in:
parent
1d6a4d3ec8
commit
f627b64264
@ -1945,6 +1945,9 @@ void IPCIPv6Init(IPC* ipc)
|
||||
// The NDT is basically the same as ARP Table with some slight adjustments
|
||||
ipc->IPv6NeighborTable = NewList(IPCCmpArpTable);
|
||||
ipc->IPv6RouterAdvs = NewList(NULL);
|
||||
|
||||
ipc->IPv6ClientEUI = 0;
|
||||
ipc->IPv6ServerEUI = 0;
|
||||
}
|
||||
void IPCIPv6Free(IPC *ipc)
|
||||
{
|
||||
@ -2110,6 +2113,16 @@ void IPCIPv6FlushNDTEx(IPC* ipc, UINT64 now)
|
||||
}
|
||||
}
|
||||
|
||||
bool IPCIPv6CheckExistingLinkLocal(IPC *ipc, IP *addr)
|
||||
{
|
||||
HUB t, *h;
|
||||
IP_TABLE_ENTRY t, *e;
|
||||
t.Name = ipc->HubName;
|
||||
h = Search(ipc->Cedar->HubList, &t);
|
||||
|
||||
//h->IpTable
|
||||
}
|
||||
|
||||
// RA
|
||||
void IPCIPv6AddRouterPrefix(IPC *ipc, ICMPV6_OPTION_LIST *recvPrefix, UCHAR *macAddress, IP *ip)
|
||||
{
|
||||
@ -2202,6 +2215,13 @@ void IPCIPv6SendRouterSolicitation(IPC* ipc)
|
||||
// The processing should populate the received RAs by itself
|
||||
IPCProcessL3Events(ipc);
|
||||
}
|
||||
|
||||
// Populating the IPv6 Server EUI for IPV6CP
|
||||
if (LIST_NUM(ipc->IPv6RouterAdvs) > 0)
|
||||
{
|
||||
IPC_IPV6_ROUTER_ADVERTISEMENT *ra = LIST_DATA(ipc->IPv6RouterAdvs, 0);
|
||||
ipc->IPv6ServerEUI = READ_UINT64(&ra->RouterAddress.ipv6_addr[8]);
|
||||
}
|
||||
}
|
||||
|
||||
// Data flow
|
||||
|
@ -202,6 +202,7 @@ void IPCIPv6AssociateOnNDT(IPC* ipc, IP* ip, UCHAR* mac_address);
|
||||
void IPCIPv6AssociateOnNDTEx(IPC *ipc, IP *ip, UCHAR *mac_address, bool isNeighborAdv);
|
||||
void IPCIPv6FlushNDT(IPC *ipc);
|
||||
void IPCIPv6FlushNDTEx(IPC *ipc, UINT64 now);
|
||||
bool IPCIPv6CheckExistingLinkLocal(IPC *ipc, IP *addr);
|
||||
// RA
|
||||
void IPCIPv6AddRouterPrefix(IPC *ipc, ICMPV6_OPTION_LIST *recvPrefix, UCHAR *macAddress, IP *ip);
|
||||
bool IPCIPv6CheckUnicastFromRouterPrefix(IPC *ipc, IP *ip, IPC_IPV6_ROUTER_ADVERTISEMENT *matchedRA);
|
||||
|
@ -7818,39 +7818,105 @@ UINT IntToSubnetMask32(UINT i)
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0: ret = 0x00000000; break;
|
||||
case 1: ret = 0x80000000; break;
|
||||
case 2: ret = 0xC0000000; break;
|
||||
case 3: ret = 0xE0000000; break;
|
||||
case 4: ret = 0xF0000000; break;
|
||||
case 5: ret = 0xF8000000; break;
|
||||
case 6: ret = 0xFC000000; break;
|
||||
case 7: ret = 0xFE000000; break;
|
||||
case 8: ret = 0xFF000000; break;
|
||||
case 9: ret = 0xFF800000; break;
|
||||
case 10: ret = 0xFFC00000; break;
|
||||
case 11: ret = 0xFFE00000; break;
|
||||
case 12: ret = 0xFFF00000; break;
|
||||
case 13: ret = 0xFFF80000; break;
|
||||
case 14: ret = 0xFFFC0000; break;
|
||||
case 15: ret = 0xFFFE0000; break;
|
||||
case 16: ret = 0xFFFF0000; break;
|
||||
case 17: ret = 0xFFFF8000; break;
|
||||
case 18: ret = 0xFFFFC000; break;
|
||||
case 19: ret = 0xFFFFE000; break;
|
||||
case 20: ret = 0xFFFFF000; break;
|
||||
case 21: ret = 0xFFFFF800; break;
|
||||
case 22: ret = 0xFFFFFC00; break;
|
||||
case 23: ret = 0xFFFFFE00; break;
|
||||
case 24: ret = 0xFFFFFF00; break;
|
||||
case 25: ret = 0xFFFFFF80; break;
|
||||
case 26: ret = 0xFFFFFFC0; break;
|
||||
case 27: ret = 0xFFFFFFE0; break;
|
||||
case 28: ret = 0xFFFFFFF0; break;
|
||||
case 29: ret = 0xFFFFFFF8; break;
|
||||
case 30: ret = 0xFFFFFFFC; break;
|
||||
case 31: ret = 0xFFFFFFFE; break;
|
||||
case 32: ret = 0xFFFFFFFF; break;
|
||||
case 0:
|
||||
ret = 0x00000000;
|
||||
break;
|
||||
case 1:
|
||||
ret = 0x80000000;
|
||||
break;
|
||||
case 2:
|
||||
ret = 0xC0000000;
|
||||
break;
|
||||
case 3:
|
||||
ret = 0xE0000000;
|
||||
break;
|
||||
case 4:
|
||||
ret = 0xF0000000;
|
||||
break;
|
||||
case 5:
|
||||
ret = 0xF8000000;
|
||||
break;
|
||||
case 6:
|
||||
ret = 0xFC000000;
|
||||
break;
|
||||
case 7:
|
||||
ret = 0xFE000000;
|
||||
break;
|
||||
case 8:
|
||||
ret = 0xFF000000;
|
||||
break;
|
||||
case 9:
|
||||
ret = 0xFF800000;
|
||||
break;
|
||||
case 10:
|
||||
ret = 0xFFC00000;
|
||||
break;
|
||||
case 11:
|
||||
ret = 0xFFE00000;
|
||||
break;
|
||||
case 12:
|
||||
ret = 0xFFF00000;
|
||||
break;
|
||||
case 13:
|
||||
ret = 0xFFF80000;
|
||||
break;
|
||||
case 14:
|
||||
ret = 0xFFFC0000;
|
||||
break;
|
||||
case 15:
|
||||
ret = 0xFFFE0000;
|
||||
break;
|
||||
case 16:
|
||||
ret = 0xFFFF0000;
|
||||
break;
|
||||
case 17:
|
||||
ret = 0xFFFF8000;
|
||||
break;
|
||||
case 18:
|
||||
ret = 0xFFFFC000;
|
||||
break;
|
||||
case 19:
|
||||
ret = 0xFFFFE000;
|
||||
break;
|
||||
case 20:
|
||||
ret = 0xFFFFF000;
|
||||
break;
|
||||
case 21:
|
||||
ret = 0xFFFFF800;
|
||||
break;
|
||||
case 22:
|
||||
ret = 0xFFFFFC00;
|
||||
break;
|
||||
case 23:
|
||||
ret = 0xFFFFFE00;
|
||||
break;
|
||||
case 24:
|
||||
ret = 0xFFFFFF00;
|
||||
break;
|
||||
case 25:
|
||||
ret = 0xFFFFFF80;
|
||||
break;
|
||||
case 26:
|
||||
ret = 0xFFFFFFC0;
|
||||
break;
|
||||
case 27:
|
||||
ret = 0xFFFFFFE0;
|
||||
break;
|
||||
case 28:
|
||||
ret = 0xFFFFFFF0;
|
||||
break;
|
||||
case 29:
|
||||
ret = 0xFFFFFFF8;
|
||||
break;
|
||||
case 30:
|
||||
ret = 0xFFFFFFFC;
|
||||
break;
|
||||
case 31:
|
||||
ret = 0xFFFFFFFE;
|
||||
break;
|
||||
case 32:
|
||||
ret = 0xFFFFFFFF;
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsLittleEndian())
|
||||
|
Loading…
Reference in New Issue
Block a user