14#define WIN32_NO_STATUS
26#define IN_ADDR_OF(x) *((struct in_addr *)&(x))
33 _T(
" prints the route table\n")
34 _T(
"route add <target> [mask <mask>] <gw> [metric <m>]\n")
36 _T(
"route delete <target> <gw>\n")
37 _T(
" deletes a route\n") );
54 if (pAdapterInfo ==
NULL)
63 if (pAdapterInfo ==
NULL)
89 _tprintf(
_T(
"===========================================================================\n"));
95 _tprintf(
_T(
"0x%lu ........................... %hs\n"),
97 _tprintf(
_T(
"0x%lu ........................... %s\n"),
100 pAdapterInfo = pAdapterInfo->
Next;
102 _tprintf(
_T(
"===========================================================================\n"));
104 _tprintf(
_T(
"===========================================================================\n"));
107 _T(
"Network Destination"),
143 _tprintf(
_T(
"Default Gateway:%18s\n"), DefGate);
144 _tprintf(
_T(
"===========================================================================\n"));
147 free(IpForwardTable);
155 if (pAdapterInfo)
free(pAdapterInfo);
156 if (IpForwardTable)
free(IpForwardTable);
220 _T(
"route add usage:\n")
221 _T(
"route add <target> [mask <mask>] <gw> [metric <m>]\n")
222 _T(
" Adds a route to the IP route table.\n")
223 _T(
" <target> is the network or host to add a route to.\n")
224 _T(
" <mask> is the netmask to use (autodetected if unspecified)\n")
225 _T(
" <gw> is the gateway to use to access the network\n")
226 _T(
" <m> is the metric to use (lower is preferred)\n") );
245 _T(
"route delete usage:\n")
246 _T(
"route delete <target> <gw>\n")
247 _T(
" Removes a route from the IP route table.\n")
248 _T(
" <target> is the network or host to add a route to.\n")
249 _T(
" <gw> is the gateway to remove the route from.\n") );
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
static int add_route(int argc, TCHAR **argv)
static int del_route(int argc, TCHAR **argv)
static int convert_add_cmd_line(PMIB_IPFORWARDROW RowToAdd, int argc, TCHAR **argv)
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INSUFFICIENT_BUFFER
GLenum const GLvoid * addr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder)
DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute)
struct _IP_ADAPTER_INFO IP_ADAPTER_INFO
#define sprintf(buf, format,...)
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
IP_ADDR_STRING GatewayList
struct _IP_ADAPTER_INFO * Next
char Description[MAX_ADAPTER_DESCRIPTION_LENGTH+4]
IP_ADDRESS_STRING IpAddress
IF_INDEX dwForwardIfIndex
MIB_IPFORWARDROW table[1]
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
#define ERROR_BUFFER_OVERFLOW