19
2007
DNS Query Code in C with winsock
Introduction Its no new fact that when we type a web address in our browser a dns request is immediately send by our browser to a DNS server to get the IP address of that web address.In winsock applications we achieve this by gethostbyname() and things are pretty simple.In this article we shall do this simple thing without the help of gethostbyname().We shall be sending DNS queries and receive the reply and extract the ipv4 [...]
19
2007
Packet Sniffer Code in C using Winsock
Introduction Ever since windows 2000/XP when IP_HDRINCL became a valid option for setsockopt() , WSAIoctl() had another option called SIO_RCVALL which enabled a raw socket to sniff all incoming traffic over the selected interface to whose IP the socket was bound.Hence to make a sniffer in Winsock he simple steps are : 1. Create a raw socket. 2. Bind the socket to the local IP over which the traffic is to be sniffed. 3. WSAIoctl() [...]
18
2007
Raw Sockets Using Winsock
Introduction Raw sockets, or “Raw Packets”, give you the facility to access the entire contents of a packet or datagram, both for reading and writing purpose. In other words, you can fabricate a whole packet according to your likes and dislikes. For example, a TCP packet would contain an IP header, a TCP header, and then the actual data that needs to be transmitted. When working with normal sockets, whatever we send to a socket [...]
18
2007
C Program to print permutations of a string
If the length of a string is n and the total number of places is r then the number of possible permutations is nPr or n!/(n-r)! . That is ofcourse a very simple mathematical relation. Only loops would not be a good idea to generate the permutations when n , r are both unbounded and variable. Recursion helps. The following program does the task : An Output like this comes :
Subscribe
Recent Posts
- Compile wxwebconnect on Ubuntu 11.04 64 bit
- Disqus Comments Importer Script in PHP
- Beginners’ guide to socket programming with winsock
- Handle multiple socket connections with fd_set and select on Linux
- Beginners guide to socket programming in C on Linux
- Gui whois client in python with wxpython
- Whois client code in C with Linux sockets
- str_replace for C
- Easy to use C/C++ IDE for Ubuntu Linux
- Get local ip in C on linux
An article by Binary Tides