LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-21-2007, 12:27 PM   #1
karan84
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Rep: Reputation: 0
tun tap query


hi
i have one doubt
i configured the tun0 interface after the open systemcall
i.e
"tuntapfd=open("\den\net\tun"........................

the interface is up and running
next i configured it using the following:

"ifconfig %s 10.8.0.2 pointopoint 10.8.0.1 mtu 1500"

next i created a simple udp server which sends a message like"hello" to the tun0 interface

In my tunnel code,if i want to read from the /dev/net/tun interface, if i use the following code


"
while(1)
{
len=read(tuntapfd,temp_buffer,sizeof(temp_buffer));//hangs here
if(len>=0)
{
printf("\n recieved.........\n");
}
else
{
printf("failed ........");
}
"

i know that i shud be using select for reading and shud be non blocking,but i just wantd to test it with a simple read statement

the problem is that the program hangs???????
the data it seems has not been transferred to the /dev/net/tun character device file

please help me out on this
what my doubt exactly is that if i send data say"hello" on the tun0 interface ,will my code be able to use it or access it using the /dev/net/tun character file because this is what i have been trying with no success

how should i proceed with this?


thanks
karan
 
Old 03-26-2007, 11:29 AM   #2
melvinebenezer@gmail
LQ Newbie
 
Registered: Mar 2007
Posts: 2

Rep: Reputation: 0
i hav a similar problem ..... did you manage to solve it
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
tun tap doubt karan84 Linux - Networking 2 01-10-2007 01:43 AM
Tun/Tap issue minasafwat Linux - Kernel 0 11-14-2006 01:11 AM
Tun/Tap getting started? blavo Linux - Newbie 0 02-14-2006 10:29 AM
how to allow tun/tap device in firewall? efm Linux - Networking 12 07-22-2005 04:47 AM
TUN TAP for non-Redhat Machine Echo Kilo Linux - Networking 3 12-19-2004 06:16 PM


All times are GMT -5. The time now is 11:21 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration