In the last post (Domains and Address Families), you learned how various types of socket addresses could be allocated and initialized. These were all simple cases of initializing from a constant. Setting up an address from a C string with varying addresses requires more programming effort. In this chapter, you will focus on the additional issues pertaining to establishing Internet addresses, and learning about the functions that can assist you in this area. In this post, you will learn about
- Classes of internet addresses
- IP netmasks
- Private and reserved IP numbers
- Functions that convert IP numbers
Before you get started however, I will recommend you to have a quick review on the IP aaddress and the Net Mask. I can give you little review but that is not intent for this blog now, better you can follow this wiki link to study that by your self
Hoping you have a quick knowledge of them lets start with playing with them now.
Manipulating IP Numbers
To ease the programming burden of turning IP numbers in string form into usable socket addresses, a number of conversion functions have been provided. These and other useful functions will be presented in the following sections.