Click here to Skip to main content
15,845,785 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionsaving the external input number to a variable Pin
raviteja202029-Oct-09 2:10
raviteja202029-Oct-09 2:10 
AnswerRe: saving the external input number to a variable Pin
enhzflep29-Oct-09 2:59
enhzflep29-Oct-09 2:59 
QuestionRe: saving the external input number to a variable Pin
David Crow29-Oct-09 3:39
David Crow29-Oct-09 3:39 
AnswerRe: saving the external input number to a variable Pin
Iain Clarke, Warrior Programmer29-Oct-09 3:56
Iain Clarke, Warrior Programmer29-Oct-09 3:56 
QuestionCComboBox in CHeaderCtrl of CListCtrl Pin
Sheebuk29-Oct-09 1:03
Sheebuk29-Oct-09 1:03 
AnswerRe: CComboBox in CHeaderCtrl of CListCtrl Pin
Iain Clarke, Warrior Programmer29-Oct-09 4:07
Iain Clarke, Warrior Programmer29-Oct-09 4:07 
GeneralRe: CComboBox in CHeaderCtrl of CListCtrl Pin
Sheebuk29-Oct-09 6:50
Sheebuk29-Oct-09 6:50 
QuestionMaking a DNS (domain name system) resolver with c++ [modified] Pin
marti8629-Oct-09 0:59
marti8629-Oct-09 0:59 
I have a project which about dns resolver. I need help about this subject. If somebody have any code in c++ or java, please help.

DNS runs over the UDP protocol, and is used to convert user-friendly host names, e.g., www.anadolu.edu.tr, to IP addresses, called the forward translation, or IP addresses to host names, called the reverse translation.

DNS consists of 2 types of messages: Queries and replies.The message (both query and reply) starts with a 12-byte header. The ¯rst 2 bytes contains the message identi¯er, and is used to match replies with queries. Notice that a real DNS resolver may be handling several queries at the same time. Since
all responses will arrive at the same client port, the resolver needs a way to match responses to queries. The message identifier is used for this purpose. Since the resolver will deal with a single query at any time, you may simply set the identifier field to 1 for all your queries. The next 2 bytes is the flags field, and is divided into numerous pieces.

My code should send the the user friendly adress( www.anadolu.edu.tr) to a name server than if i get the answer i will print the ip adresses to the screen. Also my program shoul send the ip address to a server and get the user friendly name to print.

Type of the message should be like this (Query(i sent) and Reply(server sents) messages are same).

12 BYTES HEADER
0-15 (bits) identification:is used to match replies with queries. It is 1 for this project.
16-31(bits) flag field: id divided into fields like below.
QR is a 1-bit ¯eld: 0 means the message is a query, 1 means it is a response.
OPCODE is a 4-bit field: The normal value is 0 (standard query). Other values are 1 (an inverse query), and 2 (server status request).
AA is a 1-bit flag that means "authoritative answer." If the DNS server is authoritative for the queried host, it sets this bit.
TC is a 1-bit flag that means "truncated." With UDP this means the total size of the reply exceeds 512 bytes, and only the first 512 bytes of the reply was returned.
RD is a 1-bit flag that means "recursion desired." This bit can be set in a query and is then returned in the response. This flag tells the name server to handle the query itlsef, called a recursive query. If the bit is not set, and the requested name server does not have an authoritative answer, the requested name server returns a list of other name servers to contact for the answer. This is called an iterative query.
ZERO There is a 3-bit field that must be 0.
RCODE is a 4-bit field with the return code. The common values are 0 (no error) and 3 (name error). A name error is returned only from an authoritative name server and means the domain speci¯ed in query does not exist.

Thanks..

modified on Thursday, October 29, 2009 8:47 AM

AnswerRe: Making a DNS (domain name system) resolver with c++ Pin
David Crow29-Oct-09 3:40
David Crow29-Oct-09 3:40 
QuestionExecuting a process a startup of System?(Vista & Windows 2008) [modified] Pin
Kushagra Tiwari29-Oct-09 0:40
Kushagra Tiwari29-Oct-09 0:40 
AnswerRe: Executing a process a startup of System?(Vista & Windows 2008) Pin
Iain Clarke, Warrior Programmer29-Oct-09 1:19
Iain Clarke, Warrior Programmer29-Oct-09 1:19 
AnswerRe: Executing a process a startup of System?(Vista & Windows 2008) Pin
Kushagra Tiwari29-Oct-09 1:42
Kushagra Tiwari29-Oct-09 1:42 
GeneralRe: Executing a process a startup of System?(Vista & Windows 2008) Pin
dxlee29-Oct-09 4:48
dxlee29-Oct-09 4:48 
GeneralRe: Executing a process a startup of System?(Vista & Windows 2008) Pin
Kushagra Tiwari29-Oct-09 5:00
Kushagra Tiwari29-Oct-09 5:00 
GeneralRe: Executing a process a startup of System?(Vista & Windows 2008) Pin
dxlee29-Oct-09 5:02
dxlee29-Oct-09 5:02 
GeneralRe: Executing a process a startup of System?(Vista & Windows 2008) Pin
Kushagra Tiwari29-Oct-09 5:04
Kushagra Tiwari29-Oct-09 5:04 
QuestionHow to check if any specific folder is empty Pin
sunny_vc29-Oct-09 0:07
sunny_vc29-Oct-09 0:07 
AnswerRe: How to check if any specific folder is empty Pin
Richard MacCutchan29-Oct-09 0:21
mveRichard MacCutchan29-Oct-09 0:21 
AnswerRe: How to check if any specific folder is empty Pin
Randor 29-Oct-09 0:23
professional Randor 29-Oct-09 0:23 
QuestionRe: How to check if any specific folder is empty Pin
Iain Clarke, Warrior Programmer29-Oct-09 1:21
Iain Clarke, Warrior Programmer29-Oct-09 1:21 
AnswerRe: How to check if any specific folder is empty Pin
sunny_vc29-Oct-09 1:33
sunny_vc29-Oct-09 1:33 
GeneralRe: How to check if any specific folder is empty [modified] Pin
Michael Schubert29-Oct-09 2:04
Michael Schubert29-Oct-09 2:04 
GeneralRe: How to check if any specific folder is empty Pin
sunny_vc29-Oct-09 2:49
sunny_vc29-Oct-09 2:49 
AnswerRe: How to check if any specific folder is empty Pin
Blake Miller3-Nov-09 11:54
Blake Miller3-Nov-09 11:54 
QuestionProblem in inserting new page during print - MFC Pin
diptipanchal28-Oct-09 23:27
diptipanchal28-Oct-09 23:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.