1.\" $NetBSD: srt.4,v 1.3 2019/03/26 22:03:34 pgoyette Exp $ 2.\" 3.\" This file is in the public domain. 4.\" 5.Dd March 27, 2019 6.Dt SRT 4 7.Os 8.Sh NAME 9.Nm srt 10.Nd source-routing network interface 11.Sh SYNOPSIS 12.Cd pseudo-device srt 13.Sh DESCRIPTION 14The 15.Nm srt 16interface is a software interface that implements source-address-based 17routing. 18Packets are directed to the 19.Nm 20interface using normal routing decision process. 21Packets queued for delivery are then processed according to the rules 22established for the interface using the 23.Xr srtconfig 1 24utility. 25.Pp 26To use an 27.Nm 28device, the administrator must first create the interface. 29This can be done by using the 30.Xr ifconfig 8 31.Cm create 32command. 33An 34.Xr open 2 35call on 36.Pa /dev/srt Ns Sy N 37will also create a network interface with a unit number the same as the 38minor device number of that device if the interface doesn't exist yet. 39.Pp 40To be useful, the 41.Nm 42interface needs to be configured using 43.Xr srtconfig 1 44which uses the associated 45.Nm 46character device 47.Pa /dev/srt Ns Sy # . 48.Pp 49The network interfaces should be named 50.Sy srt Ns Ar 0 , 51.Sy srt Ns Ar 1 , 52etc. 53The 54.Nm 55interface supports only the 56.Xr open 2 , 57.Xr close 2 , 58and 59.Xr ioctl 2 60operations; other operations such as 61.Xr read 2 62and 63.Xr write 2 64are not supported. 65.Pp 66All standard network interface 67.Xr ioctl 2 68calls are supported by the 69.Nm 70interface. 71In addition, the following 72.Xr ioctl 2 73calls 74.Pq defined in Aq Pa net/if_srt.h 75are supported on the 76.Nm 77character device: 78.Bl -tag -width SRT_SGFLAGS -offset 4n 79.It Dv SRT_GETNRT 80The argument is a pointer to an integer, in which the number of 81entries in the device's routing table is returned. 82.It Dv SRT_GETRT 83The argument is the address of a 84.Fa struct srt_rt . 85The routing table entry specified by the 86.Dq inx 87member is returned. 88.It Dv SRT_SETRT 89The argument is the address of a 90.Fa struct srt_rt . 91The routing entry is placed into the device's routing table at the 92index specified by the 93.Dq inx 94member. 95.It Dv SRT_DELRT 96The argument is the address of a 97.Fa struct srt_rt . 98The routing entry specified by the 99.Dq inx 100member is deleted from the device's routing table. 101(Any entries in the device's routing table with higher index values are 102renumbered.) 103.It Dv SRT_SFLAGS 104The argument is a pointer to an integer containing any of the following 105flags to be set: 106.Bl -tag -width SSF_MTULOCK 107.It Dv SSF_MTULOCK 108If set, do not automatically update the interface's MTU. 109.El 110.It Dv SRT_GFLAGS 111The argument is a pointer to an integer in which the current flags 112are returned. 113.It Dv SRT_SGFLAGS 114This call updates the flags in the same manner as 115.Dv SRT_SFLAGS . 116The original flags are returned in the integer pointed to by the argument. 117.It Dv SRT_DEBUG 118Currently this is a no-op. 119.El 120.Sh SEE ALSO 121.Xr srtconfig 1 , 122.Xr inet 4 , 123.Xr intro 4 124.Sh HISTORY 125.An -nosplit 126The 127.Nm 128device was added in 129.Nx 5.0 130by 131.An der Mouse Aq Mt mouse@NetBSD.org . 132This manual page was prepared by 133.An Paul Goyette Aq Mt pgoyette@NetBSD.org . 134