Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

no of masquerded connection

Posted on 2000-03-03
4
Medium Priority
?
172 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 150 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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 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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

916 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