Solved

no of masquerded connection

Posted on 2000-03-03
4
165 Views
Last Modified: 2010-04-22
how to get the no of masqueraded connection by programming in c under linux. (similar to 'ipchains -L -M' command in linux).
0
Comment
Question by:abhishekpatel
4 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2580833
I'm not sure what you are asking? Do you mean that you want to know what the external IP is for a host behind an IP Masquerading box (i.e in the private address space)?
0
 

Author Comment

by:abhishekpatel
ID: 2582627
Edited text of question.
0
 

Expert Comment

by:javadp
ID: 2584309
you would edit ip_forward.c and using a array for saving the external packet and change the Src_IP and Src_Port and after incomming packet do reverse work.
0
 
LVL 10

Accepted Solution

by:
rbr earned 50 total points
ID: 2587156


FILE *fp;

char buffer[1000];

fp =popen ("ipchains -L -M","r");
while (NULL != fgets (buffer,999,fp)) {

/* Do what you want with the buffer
 * e.g. print it out */

   printf ("%s",buffer);
}
pclose (fp);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now