Re: Interface description support

2019-06-24 Thread KUSABA Takeshi
> I think if_description in struct ifnet should be moved before the #ifdef > _KERNEL block so it stays at the same offset for non-_KERNEL users. Thank you. I updated the patch. https://gist.githubusercontent.com/maleic1618/f4881717cbd3b1e3182984f9773b1001/raw/967396caf88e6aab51b660f313872925564

Re: Interface description support

2019-06-24 Thread Michael van Elst
e...@math.uni-bonn.de (Edgar =?iso-8859-1?B?RnXf?=) writes: >Or is there an argument that descriptions ought to be able to look like names? These are not really descriptions but aliases and people like to use them as such. If you allow arbitrary strings (even with special characters, whitespace o

Re: Interface description support

2019-06-24 Thread Thor Lancelot Simon
On Mon, Jun 24, 2019 at 08:08:24AM -0400, Mouse wrote: > > I think I would prefer that attempting to set a description that > equals an interface name is rejected, and, when attaching an interface > after boot (ie, after interface descriptions can have been set), when > choosing an interface disam

Re: Interface description support

2019-06-24 Thread Mouse
>>> Couldn't you just enforce the description to not match >>> /[a-z]+[0-9]+/? >> That breaks down if you want the descriptions to be "wan0", "lan0", >> "lan1", etc. > But you could use "wan-0", "wan_0" or "WAN 0" or whatever. wan_0 and wan-0 are not fixes; _ and - are permitted in device names (a

Re: Interface description support

2019-06-24 Thread Edgar Fuß
EF> Couldn't you just enforce the description to not match /[a-z]+[0-9]+/? JT> That breaks down if you want the descriptions to be "wan0", "lan0", "lan1", etc. But you could use "wan-0", "wan_0" or "WAN 0" or whatever. Or is there an argument that descriptions ought to be able to look like names?

Re: Interface description support

2019-06-24 Thread Jason Thorpe
> On Jun 24, 2019, at 6:42 AM, Edgar Fuß wrote: > >> I think I would prefer that attempting to set a description that >> equals an interface name is rejected, and, [...] > Couldn't you just enforce the description to not match /[a-z]+[0-9]+/? That breaks down if you want the descriptions to b

Re: Interface description support

2019-06-24 Thread Mouse
>> I think I would prefer that attempting to set a description that >> equals an interface name is rejected, and, [...] > Couldn't you just enforce the description to not match > /[a-z]+[0-9]+/? Well, according to scan.l in the usr.bin/config I have at ready hand, it's [A-Za-z_][-A-Za-z_0-9]* (wit

Re: Interface description support

2019-06-24 Thread Edgar Fuß
> I think I would prefer that attempting to set a description that > equals an interface name is rejected, and, [...] Couldn't you just enforce the description to not match /[a-z]+[0-9]+/?

Re: Interface description support

2019-06-24 Thread Manuel Bouyer
On Mon, Jun 24, 2019 at 04:59:04AM -0700, Jason Thorpe wrote: > > > On Jun 24, 2019, at 4:29 AM, Manuel Bouyer wrote: > > > > I'd say that we should explicitely mention if we're looking up a name or > > a description, to avoid confusion. For example if wm0 has descrition > > "external if" we sho

Re: Interface description support

2019-06-24 Thread Jason Thorpe
> On Jun 24, 2019, at 4:29 AM, Manuel Bouyer wrote: > > I'd say that we should explicitely mention if we're looking up a name or > a description, to avoid confusion. For example if wm0 has descrition > "external if" we should be able to write in ipf: > > block in on wm0 from any to any > or >

Re: Interface description support

2019-06-24 Thread Mouse
> I agree, we should be able to use the description as a means of looking up t$ > 1- Duplicate descriptions are not allowed (should return EEXIST if an attemp$ Agreed. At least, unless and until someone comes up with reasonable semantics for handling multiple interfaces at once in all relevant c

Re: Interface description support

2019-06-24 Thread Manuel Bouyer
On Mon, Jun 24, 2019 at 04:20:59AM -0700, Jason Thorpe wrote: > > > On Jun 24, 2019, at 12:15 AM, Manuel Bouyer wrote: > > > > I'd like to see this in NetBSD. I'd also like packet filters to be able > > to use the description instead of the name for interfaces. This would make > > my life much e

Re: Interface description support

2019-06-24 Thread Jason Thorpe
> On Jun 24, 2019, at 12:15 AM, Manuel Bouyer wrote: > > I'd like to see this in NetBSD. I'd also like packet filters to be able > to use the description instead of the name for interfaces. This would make > my life much easier for e.g. ipfilter in Xen dom0, where the domU's virtual > interface

Re: Interface description support

2019-06-24 Thread Jared McNeill
I think if_description in struct ifnet should be moved before the #ifdef _KERNEL block so it stays at the same offset for non-_KERNEL users. Cheers, Jared On Mon, 24 Jun 2019, KUSABA Takeshi wrote: Hi, I would like to propose a feature: a description of a network interface. (FreeBSD and Open

Re: Interface description support

2019-06-24 Thread Manuel Bouyer
On Mon, Jun 24, 2019 at 01:52:18PM +0900, KUSABA Takeshi wrote: > Hi, > > I would like to propose a feature: a description of a network interface. > (FreeBSD and OpenBSD support this feature.) > > Here is a patch. > > https://gist.githubusercontent.com/maleic1618/f4881717cbd3b1e3182984f9773b1001