It is currently Sat Dec 15, 2018 5:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: how to send data frames using tunnel_id and session_id
PostPosted: Fri Feb 03, 2012 11:20 am 

Joined: Fri Feb 03, 2012 10:52 am
Posts: 3
hello. everyone .
my board is omap(arch is arm),and my linux version is 2.6.32 .
now I have build tunnel_id and session_id using openl2tp-1.8. but I am confused about how to send data frames using tunnel_id and session_id .I have seen the doc of kernel about the samble code about creating tunnel and session socket .I tried a lot .but it didn,t work .I cannot send data frame .
I am confused about udp_fd in the sample code .what it is and how to create it .and the peer_addr is the real ipaddr or the virture ipaddr .
so could someone give me some sample code about how to send data frames .thanks


Top
 Profile  
 
 Post subject: Re: how to send data frames using tunnel_id and session_id
PostPosted: Sun Feb 19, 2012 1:35 pm 
Site Admin

Joined: Sun Jul 27, 2008 1:39 pm
Posts: 122
aerfa828 wrote:
hello. everyone .
my board is omap(arch is arm),and my linux version is 2.6.32 .
now I have build tunnel_id and session_id using openl2tp-1.8. but I am confused about how to send data frames using tunnel_id and session_id .I have seen the doc of kernel about the samble code about creating tunnel and session socket .I tried a lot .but it didn,t work .I cannot send data frame .
I am confused about udp_fd in the sample code .what it is and how to create it .and the peer_addr is the real ipaddr or the virture ipaddr .
so could someone give me some sample code about how to send data frames .thanks

Please read the documentation in the kernel sources: Documentation/networking/l2tp.txt. Your app must open a UDP socket and pass its fd when opening a pppol2tp socket. Study the code in OpenL2TP to see how this works.


Top
 Profile  
 
 Post subject: Re: how to send data frames using tunnel_id and session_id
PostPosted: Wed Mar 07, 2012 11:08 am 

Joined: Fri Feb 03, 2012 10:52 am
Posts: 3
jchapman wrote:
aerfa828 wrote:
hello. everyone .
my board is omap(arch is arm),and my linux version is 2.6.32 .
now I have build tunnel_id and session_id using openl2tp-1.8. but I am confused about how to send data frames using tunnel_id and session_id .I have seen the doc of kernel about the samble code about creating tunnel and session socket .I tried a lot .but it didn,t work .I cannot send data frame .
I am confused about udp_fd in the sample code .what it is and how to create it .and the peer_addr is the real ipaddr or the virture ipaddr .
so could someone give me some sample code about how to send data frames .thanks

Please read the documentation in the kernel sources: Documentation/networking/l2tp.txt. Your app must open a UDP socket and pass its fd when opening a pppol2tp socket. Study the code in OpenL2TP to see how this works.


thank you for reply. I have some question to ask . my code is below .
1. now I have set vpn connect named ppp0.and they can ping successful and copy file using scp . Did you think I have finished the conect of vpn successful?
2. my send ipaddr is 192.168.1.104 .and vpn ip is 10.3.1.2 .my recv ipaddr is 192.168.1.120 and vpn ip is 10.3.1.1. which IP should I choose when use sendmsg.
3. I think I have know the meaning of udp_fd, but when I follow the sample code and I met a question "sendmsg func error: No route to host " ,I have tried a lot. but It is all this error .plaese give me help .
thank you again.


Attachments:
File comment: this is send and recv code first I start recv app and then start send app .my input arg is tunnel_id,session_id,peer_tunnel_id,peer_session_id.ip(send or recv ip)(try all the ip ,it do not work)
trans_vpn.rar [11.79 KiB]
Downloaded 73 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group