Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

no of masquerded connection

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

837 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