Changeset View
Changeset View
Standalone View
Standalone View
sbin/ifconfig/ifconfig.8
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 | .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd Aug 12, 2015 | .Dd August 29, 2015 | ||||
.Dt IFCONFIG 8 | .Dt IFCONFIG 8 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm ifconfig | .Nm ifconfig | ||||
.Nd configure network interface parameters | .Nd configure network interface parameters | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Op Fl c | |||||
.Op Fl s | |||||
marcel: I fear I just fell victim to the over-engineering trap, but I have a comment -- treat it as… | |||||
Not Done Inline ActionsThis would likely make sense, and avoid using up all of the letters of the alphabet on one-off flags This would also solve the problem that, in this patch, the -s and -c flags only apply to 'inet', and not inet6 or anything else. I will have to look at how the options parsing framework works, as currently you register a flag like -c from inside af_inet.c so I am not sure how to make a -f apply to multiple modules, nor deal with the fact that some modes apply to multiple address families. I might play with this a bit more then allanjude: This would likely make sense, and avoid using up all of the letters of the alphabet on one-off… | |||||
.Op Fl L | .Op Fl L | ||||
.Op Fl k | .Op Fl k | ||||
.Op Fl m | .Op Fl m | ||||
.Op Fl n | .Op Fl n | ||||
.Ar interface | .Ar interface | ||||
.Op Cm create | .Op Cm create | ||||
.Ar address_family | .Ar address_family | ||||
.Oo | .Oo | ||||
▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | |||||
.It Ar interface | .It Ar interface | ||||
This | This | ||||
parameter is a string of the form | parameter is a string of the form | ||||
.Dq name unit , | .Dq name unit , | ||||
for example, | for example, | ||||
.Dq Li ed0 . | .Dq Li ed0 . | ||||
.It Ar groupname | .It Ar groupname | ||||
List the interfaces in the given group. | List the interfaces in the given group. | ||||
.El | |||||
.Pp | |||||
The following flags can be used to modify the output format of | |||||
.Nm : | |||||
.Bl -tag -width indent | |||||
.It Fl c | |||||
Display subnet masks in CIDR notation. | |||||
For example 10.0.0.0/8 or 203.0.113.224/29 | |||||
.It Fl s | |||||
Display subnet masks in dotted quad notation. | |||||
For example 255.255.0.0 or 255.255.255.192 | |||||
.El | .El | ||||
.Pp | .Pp | ||||
The following parameters may be set with | The following parameters may be set with | ||||
.Nm : | .Nm : | ||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It Cm add | .It Cm add | ||||
Another name for the | Another name for the | ||||
.Cm alias | .Cm alias | ||||
▲ Show 20 Lines • Show All 2,667 Lines • Show Last 20 Lines |
I fear I just fell victim to the over-engineering trap, but I have a comment -- treat it as inspirational more than a request for change:
I can't shake of this feeling that -c and -s are specific to IP (v4 and/or v6) and that different protocol families may want to change the output in some form or shape as well and that this therefore may create a flurry of "one-off" options. What if we have a single option, say -f, for format that takes an argument. The argument is a protocol-specific specifier for how to print addresses. For IP this could be "-f cidr" and "-f dotted" as the moral equivalent of "-c" and "-s" (resp).
Since we print addresses for different protocols at the same time, maybe even add a protocol prefix, like inet:dotted and allow -f to give us a list of specifiers so that we can tweak the output of multiple families at the same time.
Examples of different ways one may want to print an address:
ethernet: use dashes instead of colons between bytes, print as 3 groups of hex numbers with dots.
IPv6: don't suffix the scope, don't abbreviate, resolve to hostname, hex only, etc
IPv4: resolve to hostname, hex only, CIDR, dotted, etc
Again: this probably goes too far, but I feel is more future-proof.