ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In C and C++, you can use the 'exec' family of functions (check out the 'exec' man page); in bash and other scripting languages you can usually just enclose a command in "`" (reverse single quotes) to execute it.
Suppose there are 3 PCs. message sent from pc 1 to pc 3 through pc 2,
pc 1 is running a server.o program to wait for connection from another pc.
when packet sent from pc 1 to pc 3 through pc 2, pc 2 will use a iptables command (-j QUEUE)to pass the packet to the queue and then a userspace program which starts running at the beginning will try to make connection to pc 1.
( I have add the command execl("client.o","",(char *) 0); at the userspace program at pc 2, but it fails to make connection to pc 1.)
(But it works if I just add the command execl("add.o","",(char *) 0); )
add.o is just a program for adding iptables command
client.o is a program for making connection to pc 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I want to ask if I can get the message sent from pc 1 to pc 3 at pc 2 even the connection is made only between pc 1 and pc 3.
Actually, I want to do this .....
I have no idea at all~~~
So, I try to pass the packet to the queue at pc 2, run a userspace program--make connection to pc 1 and ask pc 1 to send the message to pc 2~~~
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.