tun.4 (56187) | tun.4 (57676) |
---|---|
1.\" $NetBSD: tun.4,v 1.1 1996/06/25 22:17:37 pk Exp $ | 1.\" $NetBSD: tun.4,v 1.1 1996/06/25 22:17:37 pk Exp $ |
2.\" $FreeBSD: head/share/man/man4/tun.4 56187 2000-01-17 14:17:28Z asmodai $ | 2.\" $FreeBSD: head/share/man/man4/tun.4 57676 2000-03-01 14:50:24Z sheldonh $ |
3.\" Based on PR#2411 4.\" 5.Dd March 10, 1996 6.Dt TUN 4 7.Os 8.Sh NAME 9.Nm tun 10.Nd tunnel software network interface --- 56 unchanged lines hidden (view full) --- 67hardware had just received it. 68.Pp 69The tunnel device, normally 70.Pa /dev/tun Ns Sy N , 71is exclusive-open 72.Po 73it cannot be opened if it is already open 74.Pc | 3.\" Based on PR#2411 4.\" 5.Dd March 10, 1996 6.Dt TUN 4 7.Os 8.Sh NAME 9.Nm tun 10.Nd tunnel software network interface --- 56 unchanged lines hidden (view full) --- 67hardware had just received it. 68.Pp 69The tunnel device, normally 70.Pa /dev/tun Ns Sy N , 71is exclusive-open 72.Po 73it cannot be opened if it is already open 74.Pc |
75and is restricted to the super-user. A | 75and is restricted to the super-user. 76A |
76.Fn read 77call will return an error 78.Pq Er EHOSTDOWN 79if the interface is not 80.Dq ready 81.Po 82which means that the control device is open and the interface's 83address has been set --- 8 unchanged lines hidden (view full) --- 92.Fn read , 93the extra data will be silently dropped. 94.Pp 95Packets can be optionally prepended with the destination address as presented 96to the network interface output routine 97.Pq Sq Li tunoutput . 98The destination address is in 99.Sq Li struct sockaddr | 77.Fn read 78call will return an error 79.Pq Er EHOSTDOWN 80if the interface is not 81.Dq ready 82.Po 83which means that the control device is open and the interface's 84address has been set --- 8 unchanged lines hidden (view full) --- 93.Fn read , 94the extra data will be silently dropped. 95.Pp 96Packets can be optionally prepended with the destination address as presented 97to the network interface output routine 98.Pq Sq Li tunoutput . 99The destination address is in 100.Sq Li struct sockaddr |
100format. The actual length of the prepended address is in the member | 101format. 102The actual length of the prepended address is in the member |
101.Sq Li sa_len . 102The packet data follows immediately. 103A 104.Xr write 2 105call passes a packet in to be 106.Dq received 107on the pseudo-interface. Each 108.Fn write --- 111 unchanged lines hidden --- | 103.Sq Li sa_len . 104The packet data follows immediately. 105A 106.Xr write 2 107call passes a packet in to be 108.Dq received 109on the pseudo-interface. Each 110.Fn write --- 111 unchanged lines hidden --- |