Bitdefender Hypervisor Memory Introspection
intronet.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _INTRO_NET_H_
6 #define _INTRO_NET_H_
7 
8 #include "lixprocess.h"
9 #include "winprocess.h"
10 
12 #define INTRONET_MIN_BUFFER_SIZE (sizeof("[ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]"))
13 
16 typedef union _INTRONET_ADDRESS
17 {
18  BYTE Ipv6[16];
19  BYTE Ipv4[4];
21 
23 
26 typedef struct _INTRONET_ENDPOINT
27 {
30 
33 
38 
47 
48  union
49  {
58  };
59 
63 
64 
65 //
66 // IntNetStateToString
67 //
68 __forceinline const char *
70  _In_ INTRO_NET_STATE State
71  )
75 {
76  switch (State)
77  {
79  return "CLOSED";
81  return "LISTENING";
83  return "SYN-SENT";
85  return "SYN-RECV";
87  return "ESTABLISHED";
89  return "FIN-WAIT";
91  return "FIN-WAIT2";
93  return "CLOSE-WAIT";
95  return "CLOSING";
97  return "LAST-ACK";
99  return "TIME-WAIT";
101  return "DELETE-TCB";
102  default:
103  return "UNKNOWN";
104  }
105 }
106 
109  _In_ const DWORD State
110  );
111 
112 _Success_(return > 0)
113 DWORD
115  _In_ const INTRO_NET_AF Family,
116  _In_ const INTRONET_ADDRESS *Address,
118  );
119 
120 #endif // _INTRO_NET_H
Exposes the types, constants and functions used to handle Windows processes events (creation...
uint8_t BYTE
Definition: intro_types.h:47
#define _In_
Definition: intro_sal.h:21
INTRONET_PORT LocalPort
Local port.
Definition: intronet.h:37
uint16_t WORD
Definition: intro_types.h:48
#define _Success_(expr)
Definition: intro_sal.h:47
enum _INTRO_NET_STATE INTRO_NET_STATE
Connection states.
INTRONET_PORT RemotePort
Remote port.
Definition: intronet.h:46
INTRO_NET_AF AddressFamily
Address family.
Definition: intronet.h:29
WIN_PROCESS_OBJECT * OwnerProcess
Pointer to the process that owns the connection.
Definition: intronet.h:57
LIX_TASK_OBJECT * OwnerTask
Pointer to the task that owns the connection.
Definition: intronet.h:53
const char * IntNetStateToString(INTRO_NET_STATE State)
Converts a connection state to a string.
Definition: intronet.h:69
#define _Out_writes_(expr)
Definition: intro_sal.h:28
#define INTRONET_MIN_BUFFER_SIZE
The minimum buffer size needed for the textual representation of an IP address.
Definition: intronet.h:12
Available only on Windows.
Definition: intro_types.h:324
union _INTRONET_ADDRESS INTRONET_ADDRESS
An IP address.
unsigned long long QWORD
Definition: intro_types.h:53
DWORD IntNetAddrToStr(const INTRO_NET_AF Family, const INTRONET_ADDRESS *Address, CHAR *String)
Converts an IP address to a string.
Definition: intronet.c:11
An endpoint.
Definition: intronet.h:26
INTRO_NET_STATE State
Connection state.
Definition: intronet.h:32
WORD INTRONET_PORT
Definition: intronet.h:22
#define __forceinline
Definition: introtypes.h:61
uint32_t DWORD
Definition: intro_types.h:49
BYTE Ipv6[16]
IPv6 address.
Definition: intronet.h:18
INTRONET_ADDRESS RemoteAddress
Remote address.
Definition: intronet.h:42
struct _INTRONET_ENDPOINT INTRONET_ENDPOINT
An endpoint.
An IP address.
Definition: intronet.h:16
INTRONET_ADDRESS LocalAddress
Local address.
Definition: intronet.h:35
enum _INTRO_NET_AF INTRO_NET_AF
Address family.
char CHAR
Definition: intro_types.h:56
QWORD Endpoint
Guest virtual address of the endpoint/socket object.
Definition: intronet.h:61
INTRO_NET_STATE IntNetConvertState(const DWORD State)
Converts a guest connection state to an Introcore connection state.
Definition: intronet.c:210
BYTE Ipv4[4]
IPv4 address.
Definition: intronet.h:19
This structure describes a running process inside the guest.
Definition: winprocess.h:83