LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-25-2011, 10:13 AM   #1
anis_huq
LQ Newbie
 
Registered: Nov 2006
Posts: 29

Rep: Reputation: 0
Compare IP addresses


Friends,
I want to compare 2 IP addresses, so that I may comare which is more/less "specific" or "restricted" than the other.

So is there any function/library that may help in doing this comparison in C (on Ubuntu 10.10)?

Bye.
 
Old 03-25-2011, 10:27 AM   #2
derchris
LQ Newbie
 
Registered: Feb 2011
Posts: 27

Rep: Reputation: 0
What do you mean by more or less restrictive? And in which data structure do you have these IPs stored?

If it is in a char *, why not simply use strcmp()?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding 2 NICs (MAC addresses) to 2 IP Addresses in same Subnet RedHat EL4.0 skhira Linux - Networking 13 02-24-2008 08:16 PM
Binding 2 NICs (MAC addresses) to 2 IP Addresses in same Subnet RedHat EL4.0 skhira Linux - Networking 1 02-09-2008 07:17 AM
Mapping IP addresses to MAC addresses basilio Linux - Networking 17 09-12-2007 01:48 AM
mechanics of mapping process memory addresses to physical addresses on amd64 Tischbein Linux - Kernel 2 02-01-2007 08:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration