Solved

no of masquerded connection

Posted on 2000-03-03
4
164 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

20 Experts available now in Live!

Get 1:1 Help Now