LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-15-2010, 03:49 PM   #1
virtualCoder
Member
 
Registered: Sep 2007
Distribution: Ubuntu
Posts: 33

Rep: Reputation: 15
Socket programming select interface


Hi everyone,

I have currently had the need to go back to basic socket programming, and implemented a simple udp packet sender. But I realized I needed to be able to select which network interface to send the packets from.

The reason is so that one of the interfaces has vlan tagging, and I need my UDP packets to be accordingly vlan tagged. For example, one of the interfaces is eth1.200.

I did search online but havent come up with anything yet and was hoping it would be worth to post a message here .

Can anyone please help.
Thanks in advance.
 
Old 01-15-2010, 04:57 PM   #2
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Not sure to understand what you want to do. But if you need network interfaces info, use "getifaddrs" function (I'm assuming you're doing C under an unix)

Last edited by jf.argentino; 01-15-2010 at 04:59 PM. Reason: precising langauge and os
 
1 members found this post helpful.
Old 01-16-2010, 09:52 PM   #3
virtualCoder
Member
 
Registered: Sep 2007
Distribution: Ubuntu
Posts: 33

Original Poster
Rep: Reputation: 15
Oh sorry, yes I am working with C, and on linux.

Thanks a lot, I think this is exactly what I was looking for.
Saved me a lot of frustration.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket Programming making use of "select()" and "writefds" johncsl82 Programming 10 11-13-2011 12:27 PM
How NET_TX_SOFTIRQ select network interface when multiple interface exits Mr.J Linux - Kernel 0 06-02-2009 11:17 AM
socket programming in c interface vipin_jss Linux - Networking 4 03-04-2008 08:45 AM
Select() did not select my socket thvo Programming 1 05-08-2005 12:20 AM
Socket and Select() problems strikernzl Programming 2 09-01-2003 08:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration