mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-12-06 10:11:32 +03:00
Preliminary IPC IPv6 implementation (untested)
This commit is contained in:
@ -24,6 +24,12 @@
|
||||
#define IPC_LAYER_2 2
|
||||
#define IPC_LAYER_3 3
|
||||
|
||||
// IPv6 constants
|
||||
#define IPC_IPV6_NDT_LIFETIME (30 * 1000) // as per REACHABLE_TIME constant of RFC4861
|
||||
#define IPC_IPV6_NDT_GIVEUPTIME (3 * 1000) // as per MAX_MULTICAST_SOLICIT * RETRANS_TIMER constants of RFC4861
|
||||
#define IPC_IPV6_RA_INTERVAL (4 * 1000) // as per RTR_SOLICITATION_INTERVAL constant of RFC4861
|
||||
#define IPC_IPV6_RA_MAX_RETRIES 3 // as per MAX_RTR_SOLICITATIONS constant of RFC4861
|
||||
|
||||
// ARP table entry
|
||||
struct IPC_ARP
|
||||
{
|
||||
@ -117,6 +123,13 @@ struct IPC
|
||||
SHARED_BUFFER *IpcSessionSharedBuffer; // A shared buffer between IPC and Session
|
||||
IPC_SESSION_SHARED_BUFFER_DATA *IpcSessionShared; // Shared data between IPC and Session
|
||||
UINT Layer;
|
||||
|
||||
// IPv6 stuff
|
||||
QUEUE* IPv6ReceivedQueue; // IPv6 reception queue
|
||||
LIST* IPv6NeighborTable; // Neighbor Discovery Table
|
||||
LIST* IPv6RouterAdvs; // Router offered prefixes
|
||||
UINT64 IPv6ClientEUI; // The EUI of the client (for the SLAAC autoconf)
|
||||
UINT64 IPv6ServerEUI; // The EUI of the server (from the RA discovery)
|
||||
};
|
||||
|
||||
// MS-CHAPv2 authentication information
|
||||
@ -129,6 +142,15 @@ struct IPC_MSCHAP_V2_AUTHINFO
|
||||
EAP_CLIENT *MsChapV2_EapClient; // EAP client
|
||||
};
|
||||
|
||||
struct IPC_IPV6_ROUTER_ADVERTISEMENT
|
||||
{
|
||||
IP RoutedPrefix;
|
||||
IP RoutedMask;
|
||||
IP RouterAddress;
|
||||
UCHAR RouterMacAddress[6];
|
||||
UCHAR RouterLinkLayerAddress[6];
|
||||
};
|
||||
|
||||
IPC *NewIPC(CEDAR *cedar, char *client_name, char *postfix, char *hubname, char *username, char *password,
|
||||
UINT *error_code, IP *client_ip, UINT client_port, IP *server_ip, UINT server_port,
|
||||
char *client_hostname, char *crypt_name,
|
||||
@ -151,15 +173,15 @@ IPC_ARP *IPCNewARP(IP *ip, UCHAR *mac_address);
|
||||
void IPCFreeARP(IPC_ARP *a);
|
||||
int IPCCmpArpTable(void *p1, void *p2);
|
||||
void IPCSendIPv4Unicast(IPC *ipc, void *data, UINT size, IP *next_ip);
|
||||
IPC_ARP *IPCSearchArpTable(IPC *ipc, IP *ip);
|
||||
IPC_ARP *IPCSearchArpTable(LIST* arpTable, IP *ip);
|
||||
void IPCSendIPv4WithDestMacAddr(IPC *ipc, void *data, UINT size, UCHAR *dest_mac_addr);
|
||||
void IPCFlushArpTable(IPC *ipc);
|
||||
void IPCFlushArpTableEx(IPC *ipc, UINT64 now);
|
||||
void IPCProcessArp(IPC *ipc, BLOCK *b);
|
||||
void IPCAssociateOnArpTable(IPC *ipc, IP *ip, UCHAR *mac_address);
|
||||
bool IsValidUnicastMacAddress(UCHAR *mac);
|
||||
bool IsValidUnicastIPAddress4(IP *ip);
|
||||
bool IsValidUnicastIPAddressUINT4(UINT ip);
|
||||
|
||||
|
||||
|
||||
DHCPV4_DATA *IPCSendDhcpRequest(IPC *ipc, IP *dest_ip, UINT tran_id, DHCP_OPTION_LIST *opt, UINT expecting_code, UINT timeout, TUBE *discon_poll_tube);
|
||||
BUF *IPCBuildDhcpRequest(IPC *ipc, IP *dest_ip, UINT tran_id, DHCP_OPTION_LIST *opt);
|
||||
BUF *IPCBuildDhcpRequestOptions(IPC *ipc, DHCP_OPTION_LIST *opt);
|
||||
@ -171,6 +193,25 @@ IPC_ASYNC *NewIPCAsync(CEDAR *cedar, IPC_PARAM *param, SOCK_EVENT *sock_event);
|
||||
void IPCAsyncThreadProc(THREAD *thread, void *param);
|
||||
void FreeIPCAsync(IPC_ASYNC *a);
|
||||
|
||||
// IPv6 stuff
|
||||
// Memory management
|
||||
void IPCIPv6Init(IPC* ipc);
|
||||
void IPCIPv6Free(IPC* ipc);
|
||||
// NDT
|
||||
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);
|
||||
// RA
|
||||
void IPCIPv6AddRouterPrefix(IPC* ipc, ICMPV6_OPTION_LIST* recvPrefix, UCHAR* macAddress, IP* ip);
|
||||
bool IPCIPv6CheckUnicastFromRouterPrefix(IPC* ipc, IP* ip, IPC_IPV6_ROUTER_ADVERTISEMENT* matchedRA);
|
||||
void IPCIPv6SendRouterSolicitation(IPC* ipc);
|
||||
// Data flow
|
||||
BLOCK* IPCIPv6Recv(IPC* ipc);
|
||||
void IPCIPv6Send(IPC* ipc, void* data, UINT size);
|
||||
void IPCIPv6SendWithDestMacAddr(IPC* ipc, void* data, UINT size, UCHAR* dest_mac_addr);
|
||||
void IPCIPv6SendUnicast(IPC* ipc, void* data, UINT size, IP* next_ip);
|
||||
|
||||
bool ParseAndExtractMsChapV2InfoFromPassword(IPC_MSCHAP_V2_AUTHINFO *d, char *password);
|
||||
|
||||
#endif // IPC_H
|
||||
|
||||
Reference in New Issue
Block a user