On Tue, Dec 20, 2022 at 08:27:14PM -0500, Paul R. Tagliamonte wrote:
> Heyya tech@,
> 
> Please keep me on cc, I'm not subscribed
> 
> I've been working on porting some of my linux specific software to
> work on OpenBSD. While working with some routing-specific code,
> I needed to pull up show.c to map the letters in `route show` to the
> RTF_ values.
> 
> I figured while I was in there, I'd send a patch along adding that to
> the manpage in the hopes it's a bit easier for others in the future.
> Most of the descriptions were pulled from the .h
> 
> First time sending anything in to OpenBSD, please let me know if
> there's anything I can do better for next time! I'm wary of my MUA
> (GMail's web interface) destroying the patch, so I've attached it
> for redundancy.
> 
> paultag
> --
> :wq
> 

hi.

some of the relevant flags are already documented in route(8) ("Routes
have associated flags...). the entire list is documented in route(4),
but you have to explicitly ask for it (man 4 route) and again the flags
with detail in netstat(8) ("The mapping between letters and flags
is...").

jmc

> Index: route.8
> ===================================================================
> RCS file: /cvs/src/sbin/route/route.8,v
> retrieving revision 1.106
> diff -u -p -r1.106 route.8
> --- route.8 19 Nov 2022 19:23:37 -0000 1.106
> +++ route.8 21 Dec 2022 01:11:22 -0000
> @@ -571,6 +571,37 @@ and
>  .Dv RTM_CHANGE .
>  As such, only the superuser may modify
>  the routing tables.
> +.Sh FLAGS
> +When displaying routes with the
> +.Cm show
> +command, the output contains a
> +.Ar Flags
> +column indicating what flags have been set on the route. The possible
> +values and their corresponding header definition names are:
> +.Bl -column "U" "RTF_BLACKHOLE" "description"
> +.It U Ta Dv RTF_UP         Ta "route is usable"
> +.It G Ta Dv RTF_GATEWAY    Ta "route traffic through a gateway"
> +.It H Ta Pf RTF_HOST       Ta "route target is a host entry"
> +.It R Ta Dv RTF_REJECT     Ta "host or net is unreachable"
> +.It D Ta Dv RTF_DYNAMIC    Ta "route created dynamically (by redirect)"
> +.It M Ta Pf RTF_MODIFIED   Ta "route modified dynamically (by redirect)"
> +.It C Ta Dv RTF_CLONING    Ta "generate new routes on use"
> +.It m Ta Dv RTF_MULTICAST  Ta "route associated to a multicast addr"
> +.It L Ta Dv RTF_LLINFO     Ta "route generated by ARP or NDP"
> +.It S Ta Dv RTF_STATIC     Ta "route was manually added"
> +.It B Ta Dv RTF_BLACKHOLE  Ta "discard all traffic"
> +.It 3 Ta Dv RTF_PROTO3     Ta "protocol specific routing flag"
> +.It 2 Ta Dv RTF_PROTO2     Ta "protocol specific routing flag"
> +.It 1 Ta Dv RTF_PROTO1     Ta "protocol specific routing flag"
> +.It c Ta Dv RTF_CLONED     Ta "route was cloned"
> +.It h Ta Dv RTF_CACHED     Ta "referenced by gateway route"
> +.It P Ta Dv RTF_MPATH      Ta "multipath route"
> +.It T Ta Dv RTF_MPLS       Ta "MPLS route"
> +.It l Ta Dv RTF_LOCAL      Ta "route is local to the host"
> +.It F Ta Dv RTF_BFD        Ta "link state controlled by BFD"
> +.It b Ta Dv RTF_BROADCAST  Ta "route associated to a broadcast addr"
> +.It n Ta Dv RTF_CONNECTED  Ta "interface route"
> +.El
>  .Sh FILES
>  .Bl -tag -width "/etc/mygate" -compact
>  .It Pa /etc/hosts

> Index: route.8
> ===================================================================
> RCS file: /cvs/src/sbin/route/route.8,v
> retrieving revision 1.106
> diff -u -p -r1.106 route.8
> --- route.8   19 Nov 2022 19:23:37 -0000      1.106
> +++ route.8   21 Dec 2022 01:11:22 -0000
> @@ -571,6 +571,37 @@ and
>  .Dv RTM_CHANGE .
>  As such, only the superuser may modify
>  the routing tables.
> +.Sh FLAGS
> +When displaying routes with the
> +.Cm show
> +command, the output contains a
> +.Ar Flags
> +column indicating what flags have been set on the route. The possible
> +values and their corresponding header definition names are:
> +.Bl -column "U" "RTF_BLACKHOLE" "description"
> +.It U Ta Dv RTF_UP         Ta "route is usable"
> +.It G Ta Dv RTF_GATEWAY    Ta "route traffic through a gateway"
> +.It H Ta Pf RTF_HOST       Ta "route target is a host entry"
> +.It R Ta Dv RTF_REJECT     Ta "host or net is unreachable"
> +.It D Ta Dv RTF_DYNAMIC    Ta "route created dynamically (by redirect)"
> +.It M Ta Pf RTF_MODIFIED   Ta "route modified dynamically (by redirect)"
> +.It C Ta Dv RTF_CLONING    Ta "generate new routes on use"
> +.It m Ta Dv RTF_MULTICAST  Ta "route associated to a multicast addr"
> +.It L Ta Dv RTF_LLINFO     Ta "route generated by ARP or NDP"
> +.It S Ta Dv RTF_STATIC     Ta "route was manually added"
> +.It B Ta Dv RTF_BLACKHOLE  Ta "discard all traffic"
> +.It 3 Ta Dv RTF_PROTO3     Ta "protocol specific routing flag"
> +.It 2 Ta Dv RTF_PROTO2     Ta "protocol specific routing flag"
> +.It 1 Ta Dv RTF_PROTO1     Ta "protocol specific routing flag"
> +.It c Ta Dv RTF_CLONED     Ta "route was cloned"
> +.It h Ta Dv RTF_CACHED     Ta "referenced by gateway route"
> +.It P Ta Dv RTF_MPATH      Ta "multipath route"
> +.It T Ta Dv RTF_MPLS       Ta "MPLS route"
> +.It l Ta Dv RTF_LOCAL      Ta "route is local to the host"
> +.It F Ta Dv RTF_BFD        Ta "link state controlled by BFD"
> +.It b Ta Dv RTF_BROADCAST  Ta "route associated to a broadcast addr"
> +.It n Ta Dv RTF_CONNECTED  Ta "interface route"
> +.El
>  .Sh FILES
>  .Bl -tag -width "/etc/mygate" -compact
>  .It Pa /etc/hosts

Reply via email to