73 " nslookup [-opt ...] # interactive mode using default server\n"
74 " nslookup [-opt ...] - server # interactive mode using 'server'\n"
75 " nslookup [-opt ...] host # just look up 'host' using default server\n"
76 " nslookup [-opt ...] host server # just look up 'host' using 'server'\n") );
81 _tprintf(
_T(
"Commands: (identifiers are shown in uppercase, [] means optional)\n"));
82 _tprintf(
_T(
"NAME1 - print info about host/domain NAME using default server\n"));
83 _tprintf(
_T(
"NAME1 NAME2 - as above, but use NAME2 as server\n"));
84 _tprintf(
_T(
"help or ? - print info on common commands\n"));
86 _tprintf(
_T(
" all - print options, current server and host\n"));
87 _tprintf(
_T(
" [no]debug - print debugging information\n"));
88 _tprintf(
_T(
" [no]d2 - print exhaustive debugging information\n"));
89 _tprintf(
_T(
" [no]defname - apend domain name to each query\n"));
90 _tprintf(
_T(
" [no]recurse - ask for recursive answer to query\n"));
91 _tprintf(
_T(
" [no]search - use domain list query\n"));
92 _tprintf(
_T(
" [no]vc - always use virtual circuit\n"));
93 _tprintf(
_T(
" domain=NAME - set default domain name to NAME\n"));
94 _tprintf(
_T(
" srchlist=N1[/N2/.../N6] - set domain to N1 and search list to N1,N2 etc.\n"));
95 _tprintf(
_T(
" root=NAME - set root server to NAME\n"));
96 _tprintf(
_T(
" retry=X - set number of retries to X\n"));
97 _tprintf(
_T(
" timeout=X - set initial time-out interval to X seconds\n"));
98 _tprintf(
_T(
" type=X - set query type (ex. A,ANY,CNAME,MX,NS,PTR,SOA,SRV)\n"));
100 _tprintf(
_T(
" class=X - set query type (ex. IN (Internet), ANY)\n"));
101 _tprintf(
_T(
" [no]msxfr - use MS fast zone transfer\n"));
102 _tprintf(
_T(
" ixfrver=X - current version to use in IXFR transfer request\n"));
103 _tprintf(
_T(
"server NAME - set default server to NAME, using current default server\n"));
104 _tprintf(
_T(
"lserver NAME - set default server to NAME, using initial server\n"));
105 _tprintf(
_T(
"finger [USER] - finger the optional NAME at the current default host\n"));
106 _tprintf(
_T(
"root - set current default server too the root\n"));
118 int i = 0,
j = 0,
k = 0,
d = 0;
192 for(
k = 0;
k <
strlen( pResolve );
k += 1 )
194 if( pResolve[
k] !=
'.' )
226 NumQuestions =
ntohs( ((
PSHORT)&RecBuffer[4])[0] );
233 for(
i = 0;
i < NumQuestions;
i += 1 )
276 int i = 0,
j = 0,
k = 0,
d = 0;
363 for(
k = 0;
k <
strlen( pResolve );
k += 1 )
365 if( pResolve[
k] !=
'.' )
397 Header2 = RecBuffer[3];
398 NumQuestions =
ntohs( ((
PSHORT)&RecBuffer[4])[0] );
429 for(
i = 0;
i < NumQuestions;
i += 1 )
462 _tprintf(
_T(
"%s name = %s\n"), pResolve, pResult );
474 if( 0 == NumAuthority )
475 _tprintf(
_T(
"Non-authoritative answer:\n") );
500 CHAR AddrToResolve[256];
534 State.DefaultServer );
541 State.DefaultServerAddress );
619 State.retry = dwValue;
626 State.timeout = dwValue;
709 if(
State.debug )
_tprintf(
_T(
"d2 mode disabled; still in debug mode\n") );
758 NoMoreOptions =
TRUE;
766 NoMoreOptions =
TRUE;
775 State.DefaultServer );
785 State.DefaultServer );
792 CHAR input_line[256];
793 PSTR args_vector[64];
808 memset(args_vector, 0,
sizeof(args_vector));
818 if (*
ptr ==
_T(
'\"'))
840 if (
_stricmp(args_vector[0],
"exit") == 0)
844 else if ((!
_stricmp(args_vector[0],
"help")) ||
849 else if (!
_stricmp(args_vector[0],
"set"))
853 if (!
_stricmp(args_vector[1],
"all"))
857 else if (!
_stricmp(args_vector[1],
"debug"))
861 else if (!
_stricmp(args_vector[1],
"nodebug"))
866 else if (!
_stricmp(args_vector[1],
"defname"))
870 else if (!
_stricmp(args_vector[1],
"nodefname"))
874 else if (!
_stricmp(args_vector[1],
"search"))
878 else if (!
_stricmp(args_vector[1],
"nosearch"))
882 else if (!
_stricmp(args_vector[1],
"recurse"))
886 else if (!
_stricmp(args_vector[1],
"norecurse"))
890 else if (!
_stricmp(args_vector[1],
"d2"))
895 else if (!
_stricmp(args_vector[1],
"nod2"))
899 else if (!
_stricmp(args_vector[1],
"vc"))
903 else if (!
_stricmp(args_vector[1],
"novc"))
907 else if (!
_stricmp(args_vector[1],
"msxfr"))
911 else if (!
_stricmp(args_vector[1],
"nomsxfr"))
920 State.retry = dwValue;
927 State.timeout = dwValue;
935 _tprintf(
_T(
"Option not implemented: srchlist\n"));
939 _tprintf(
_T(
"Option not implemented: root\n"));
985 _tprintf(
_T(
"unknown query type: %s"), &args_vector[1][6]);
988 else if (!
_strnicmp(args_vector[1],
"querytype=",
strlen(
"querytype=")))
1032 _tprintf(
_T(
"unknown query type: %s"), &args_vector[1][11]);
1047 _tprintf(
_T(
"unknown query class: %s"), &args_vector[1][7]);
1052 _tprintf(
_T(
"Option not implemented: ixfrver\n"));
1056 _tprintf(
_T(
"*** Invalid option: %s.\n"), args_vector[1]);
1060 else if (!
_stricmp(args_vector[0],
"server"))
1062 _tprintf(
_T(
"Command not implemented: server\n"));
1064 else if (!
_stricmp(args_vector[0],
"lserver"))
1066 _tprintf(
_T(
"Command not implemented: lserver\n"));
1068 else if (!
_stricmp(args_vector[0],
"finger"))
1070 _tprintf(
_T(
"Command not implemented: finger\n"));
1072 else if (!
_stricmp(args_vector[0],
"root"))
1074 _tprintf(
_T(
"Command not implemented: root\n"));
1076 else if (!
_stricmp(args_vector[0],
"ls"))
1078 _tprintf(
_T(
"Command not implemented: ls\n"));
1080 else if (!
_stricmp(args_vector[0],
"view"))
1082 _tprintf(
_T(
"Command not implemented: view\n"));
1092 CHAR BackupServerAddress[16];
1093 CHAR BackupServer[256];
1095 CopyMemory(BackupServerAddress,
State.DefaultServerAddress,
sizeof(BackupServerAddress));
1101 State.DefaultServerAddress[
min(16,
strlen(args_vector[1]))] =
'\0';
1104 State.DefaultServer);
1112 State.DefaultServerAddress);
1117 CopyMemory(
State.DefaultServerAddress, BackupServerAddress,
sizeof(BackupServerAddress));
1141 ULONG NetBufLen = 0;
1178 _tprintf(
_T(
"Error in GetNetworkParams call\n") );
1184 if( pNetInfo ==
NULL )
1195 _tprintf(
_T(
"Error in GetNetworkParams call\n") );
#define _strnicmp(_String1, _String2, _MaxCount)
#define HeapFree(x, y, z)
static void cleanup(void)
char *CDECL fgets(char *s, int size, FILE *file)
_ACRTIMP __msvcrt_ulong __cdecl strtoul(const char *, char **, int)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER pAddr
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
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 GLint GLint j
DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
#define memcpy(s1, s2, n)
_In_ LPWSTR _In_ DWORD dwArgCount
BOOL ParseCommandLine(int argc, char *argv[])
BOOL PerformInternalLookup(PCHAR pAddr, PCHAR pResult)
void PerformLookup(PCHAR pAddr)
USHORT ClassNametoClassID(PCHAR ClassName)
int ExtractIP(PCHAR pBuffer, PCHAR pOutput, USHORT Offset)
BOOL SendRequest(PCHAR pInBuffer, ULONG InBufferLength, PCHAR pOutBuffer, PULONG pOutBufferLength)
BOOL IsValidIP(PCHAR pInput)
void ReverseIP(PCHAR pIP, PCHAR pReturn)
int ExtractName(PCHAR pBuffer, PCHAR pOutput, USHORT Offset, UCHAR Limit)
USHORT TypeNametoTypeID(PCHAR TypeName)
FIXED_INFO_W2KSP1 * PFIXED_INFO
_In_opt_ LPCSTR _In_opt_ LPCSTR pszValue
static void Server(int port)
char DomainName[MAX_DOMAIN_NAME_LEN+4]
IP_ADDR_STRING DnsServerList
IP_ADDRESS_STRING IpAddress
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
#define ERROR_BUFFER_OVERFLOW
int PASCAL FAR WSACleanup(void)