1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
|
'\" te
.\" Copyright (C) 2009, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 1989 AT&T
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH IF_TCP 7P "Sep 02, 2015"
.SH NAME
if_tcp, if \- general properties of Internet Protocol network interfaces
.SH DESCRIPTION
.LP
A network interface is a device for sending and receiving packets on a network.
It is usually a hardware device, although it can be implemented in software.
Network interfaces used by the Internet Protocol (IPv4 or IPv6) must be STREAMS
devices conforming to the Data Link Provider Interface (\fBDLPI\fR). See
\fBdlpi\fR(7P).
.SH APPLICATION PROGRAMMING INTERFACE
.LP
An interface becomes available to \fBIP\fR when it is opened and the \fBIP\fR
module is pushed onto the stream with the \fBI_PUSH\fR \fBioctl\fR(2) command.
(See \fBstreamio\fR(7I)). The \fBSIOCSLIFNAME\fR \fBioctl\fR(2) is issued to
specify the name of the interface and to indicate whether it is IPv4 or IPv6.
This may be initiated by the kernel at boot time or by a user program after the
system is running. Each interface must be assigned an \fBIP\fR address with the
\fBSIOCSLIFADDR\fR \fBioctl()\fR before it can be used. On interfaces where the
network-to-link layer address mapping is static, only the network number is
taken from the \fBioctl()\fR request; the remainder is found in a hardware
specific manner. On interfaces which provide dynamic network-to-link layer
address mapping facilities (for example, Ethernets using \fBarp\fR(7P)), the
entire address specified in the \fBioctl()\fR is used. A routing table entry
for destinations on the network of the interface is installed automatically
when an interface's address is set.
.sp
.LP
You cannot create IPMP IP interfaces using the procedure described above.
Instead, use \fBifconfig\fR(1M).
.SH IOCTLS
.LP
The following \fBioctl()\fR calls may be used to manipulate \fBIP\fR network
interfaces. Unless specified otherwise, the request takes an \fBlifreq\fR
structure as its parameter. This structure has the form:
.sp
.in +2
.nf
struct lifreq {
#define LIFNAMSIZ 32
char lifr_name[LIFNAMSIZ]; /* if name, e.g. "le1" */
union {
int lifru_addrlen; /* for subnet/token etc */
uint_t lifru_ppa; /* SIOCSLIFNAME */
} lifr_lifru1;
union {
struct sockaddr_storage lifru_addr;
struct sockaddr_storage lifru_dstaddr;
struct sockaddr_storage lifru_broadaddr;
struct sockaddr_storage lifru_token; /* With lifr_addrlen */
struct sockaddr_storage lifru_subnet; /* With lifr_addrlen */
int lifru_index; /* interface index */
uint64_t lifru_flags; /* SIOC?LIFFLAGS */
int lifru_metric;
uint_t lifru_mtu;
int lif_muxid[2]; /* mux id's for arp & ip */
struct lif_nd_req lifru_nd_req; /* SIOCLIF*ND */
struct lif_ifinfo_req lifru_ifinfo_req;
zoneid_t lifru_zone; /* SIOC[GS]LIFZONE */
} lifr_lifru;
#define lifr_addrlen lifr_lifru1.lifru_addrlen
#define lifr_ppa lifr_lifru1.lifru_ppa /* Driver's ppa */
#define lifr_addr lifr_lifru.lifru_addr /* address */
#define lifr_dstaddr lifr_lifru.lifru_dstaddr
#define lifr_broadaddr lifr_lifru.lifru_broadaddr /* broadcast addr. */
#define lifr_token lifr_lifru.lifru_token /* address token */
#define lifr_subnet lifr_lifru.lifru_subnet /* subnet prefix */
#define lifr_index lifr_lifru.lifru_index /* interface index */
#define lifr_flags lifr_lifru.lifru_flags /* flags */
#define lifr_metric lifr_lifru.lifru_metric /* metric */
#define lifr_mtu lifr_lifru.lifru_mtu /* mtu */
#define lifr_ip_muxid lifr_lifru.lif_muxid[0]
#define lifr_arp_muxid lifr_lifru.lif_muxid[1]
#define lifr_nd lifr_lifru.lifru_nd_req /* SIOCLIF*ND */
#define lifr_ifinfo lifr_lifru.lifru_ifinfo_req /* SIOC[GS]LIFLNKINFO */
#define lifr_zone lifr_lifru.lifru_zone /* SIOC[GS]LIFZONE */
};
.fi
.in -2
.sp
.ne 2
.na
\fB\fBSIOCSLIFADDR\fR\fR
.ad
.RS 19n
Set interface address.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFADDR\fR\fR
.ad
.RS 19n
Get interface address.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFDSTADDR\fR\fR
.ad
.RS 19n
Set point to point address for interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFDSTADDR\fR\fR
.ad
.RS 19n
Get point to point address for interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFFLAGS\fR\fR
.ad
.RS 19n
Set interface flags field. If the interface is marked down, any processes
currently routing packets through the interface are notified.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFFLAGS\fR\fR
.ad
.RS 19n
Get interface flags.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFCONF\fR\fR
.ad
.RS 19n
Get interface configuration list. This request takes a \fBlifconf\fR structure
(see below) as a value-result parameter. The \fBlifc_family\fR field can be
set to \fBAF_UNSPEC\fR to retrieve both \fBAF_INET\fR and \fBAF_INET6\fR
interfaces. The \fBlifc_len\fR field should be set to the size of the buffer
pointed to by \fBlifc_buf\fR.
.sp
The \fBlifc_flags\fR field should usually be set to zero, but callers that need
low-level knowledge of the underlying IP interfaces that comprise an IPMP
group can set it to \fBLIFC_UNDER_IPMP\fR to request that those interfaces be
included in the result. Upon success, \fBlifc_len\fR contains the length, in
bytes, of the array of \fBlifreq\fR structures pointed to by \fBlifc_req\fR.
For each \fBlifreq\fR structure, the \fBlifr_name\fR and \fBlifr_addr\fR fields
are valid.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFNUM\fR\fR
.ad
.RS 19n
Get number of interfaces. This request returns an integer which is the number
of interface descriptions (\fBstruct lifreq\fR) returned by the
\fBSIOCGLIFCONF\fR ioctl (in other words, indicates how large \fBlifc_len\fR
must be).
.sp
This request takes a \fBstruct lifnum\fR (see below) as a value-result
parameter. The \fBlifn_family\fR field can be set to \fBAF_UNSPEC\fR to count
both \fBAF_INET\fR and \fBAF_INET6\fR interfaces. The \fBlifn_flags\fR field
should usually be set to zero, but callers that need low-level knowledge of the
underlying IP interfaces that comprise an IPMP group can set it to
\fBLIFC_UNDER_IPMP\fR to request that those interfaces be included in the
count.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFMTU\fR\fR
.ad
.RS 19n
Set the maximum transmission unit (MTU) size for interface. Place the request
in the \fBlifru_mtu\fR field. The \fBMTU\fR can not exceed the physical
\fBMTU\fR limitation (which is reported in the \fBDLPI\fR \fBDL_INFO_ACK\fR
message).
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFMTU\fR\fR
.ad
.RS 19n
Get the maximum transmission unit size for interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFMETRIC\fR\fR
.ad
.RS 19n
Set the metric associated with the interface. The metric is used by routing
daemons such as \fBin.routed\fR(1M).
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFMETRIC\fR\fR
.ad
.RS 19n
Get the metric associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFMUXID\fR\fR
.ad
.RS 19n
Get the \fBip\fR and \fBarp\fR \fBmuxid\fR associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFMUXID\fR\fR
.ad
.RS 19n
Set the \fBip\fR and \fBarp\fR \fBmuxid\fR associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFINDEX\fR\fR
.ad
.RS 19n
Get the interface index associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFINDEX\fR\fR
.ad
.RS 19n
Set the interface index associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFZONE\fR\fR
.ad
.RS 19n
Get the zone associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFZONE\fR\fR
.ad
.RS 19n
Set the zone associated with the interface. Only applies for zones that use the
shared-IP instance.
.RE
.sp
.ne 2
.na
\fB\fBSIOCLIFADDIF\fR\fR
.ad
.RS 19n
Add a new logical interface on a physical interface using an unused logical
interface number.
.RE
.sp
.ne 2
.na
\fB\fBSIOCLIFREMOVEIF\fR\fR
.ad
.RS 19n
Remove a logical interface by specifying its \fBIP\fR address or logical
interface name.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFTOKEN\fR\fR
.ad
.RS 19n
Set the address token used to form IPv6 link-local addresses and for stateless
address autoconfiguration.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFTOKEN\fR\fR
.ad
.RS 19n
Get the address token used to form IPv6 link-local addresses and for stateless
address autoconfiguration.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFSUBNET\fR\fR
.ad
.RS 19n
Set the subnet prefix associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFSUBNET\fR\fR
.ad
.RS 19n
Get the subnet prefix associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFLNKINFO\fR\fR
.ad
.RS 19n
Set link specific parameters for the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFLNKINFO\fR\fR
.ad
.RS 19n
Get link specific parameters for the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCLIFDELND\fR\fR
.ad
.RS 19n
Delete a neighbor cache entry for IPv6.
.RE
.sp
.ne 2
.na
\fB\fBSIOCLIFGETND\fR\fR
.ad
.RS 19n
Get a neighbor cache entry for IPv6.
.RE
.sp
.ne 2
.na
\fB\fBSIOCLIFSETND\fR\fR
.ad
.RS 19n
Set a neighbor cache entry for IPv6.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSLIFUSESRC\fR\fR
.ad
.RS 19n
Set the interface from which to choose a source address. The \fBlifr_index\fR
field has the interface index corresponding to the interface whose address is
to be used as the source address for packets going out on the interface whose
name is provided by \fBlifr_name\fR. If the \fBlifr_index\fR field is set to
zero, the previous setting is cleared. See \fBifconfig\fR(1M) for examples of
the \fBusesrc\fR option.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFUSESRC\fR\fR
.ad
.RS 19n
Get the interface index of the interface whose address is used as the source
address for packets going out on the interface provided by \fBlifr_name\fR
field. The value is retrieved in the \fBlifr_index\fR field. See
\fBifconfig\fR(1M) for examples of the \fBusesrc\fR option.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGLIFSRCOF\fR\fR
.ad
.RS 19n
Get the interface configuration list for interfaces that use an address hosted
on the interface provided by the \fBlifs_ifindex\fR field in the \fBlifsrcof\fR
struct (see below), as a source address. The application sets \fBlifs_maxlen\fR
to the size (in bytes) of the buffer it has allocated for the data. On return,
the kernel sets \fBlifs_len\fR to the actual size required. Note, the
application could set \fBlifs_maxlen\fR to zero to query the kernel of the
required buffer size instead of estimating a buffer size. The application tests
\fBlifs_len\fR <= \fBlifs_maxlen\fR -- if that's true, the buffer was big
enough and the application has an accurate list. If it is false, it needs to
allocate a bigger buffer and try again, and \fBlifs_len\fR provides a hint of
how big to make the next trial. See \fBifconfig\fR(1M) for examples of the
\fBusesrc\fR option.
.RE
.sp
.ne 2
.na
\fB\fBSIOCTONLINK\fR\fR
.ad
.RS 19n
Test if the address is directly reachable, for example, that it can be reached
without going through a router. This request takes an \fBsioc_addrreq\fR
structure (see below) as a value-result parameter. The \fBsa_addr\fR field
should be set to the address to test. The \fBsa_res\fR field will contain a
non-zero value if the address is onlink.
.RE
.sp
.ne 2
.na
\fB\fBSIOCTMYADDR\fR\fR
.ad
.RS 19n
Test if the address is assigned to this node. This request takes an
\fBsioc_addrreq\fR structure (see below) as a value-result parameter. The
\fBsa_addr\fR field should be set to the address to test. The \fBsa_res\fR
field will contain a non-zero value if the address is assigned to this node.
.RE
.sp
.ne 2
.na
\fB\fBSIOCTMYSITE\fR\fR
.ad
.RS 19n
Test if the address is part of the same site as this node. This request takes
an \fBsioc_addrreq\fR structure (see below) as a value-result parameter. The
\fBsa_addr\fR field should be set to the address to test. The \fBsa_res\fR
field will contain a non-zero value if the address is in the same site.
.RE
.sp
.LP
The structure used by \fBSIOCGLIFCONF\fR has the form:
.sp
.in +2
.nf
struct lifconf {
sa_family_t lifc_family;
int lifc_flags; /* request specific
/* interfaces */
int lifc_len; /* size of assoc. buffer */
union {
caddr_t lifcu_buf;
struct lifreq *lifcu_req;
} lifc_lifcu;
#define lifc_buf lifc_lifcu.lifcu_buf /* buffer address */
#define lifc_req lifc_lifcu.lifcu_req /* array of structs returned */
};
.fi
.in -2
.sp
.LP
The structure used by \fBSIOCGLIFNUM\fR has the form:
.sp
.in +2
.nf
struct lifnum {
sa_family_t lifn_family;
int lifn_flags; /* req. specf. interfaces */
int lifn_count; /* Result */
};
.fi
.in -2
.sp
.LP
The structure used by \fBSIOCTONLINK\fR, \fBSIOCTMYADDR\fR and
\fBSIOCTMYSITE\fR has the form:
.sp
.in +2
.nf
struct sioc_addrreq {
struct sockaddr_storage sa_addr; /* Address to test */
int sa_res; /* Result - 0/1 */
};
.fi
.in -2
.sp
.LP
The structure used by \fBSIOCGLIFSRCOF\fR has the form:
.sp
.in +2
.nf
struct lifsrcof {
uint_t lifs_ifindex; /* addr on this interface */
/* used as the src addr */
size_t lifs_maxlen; /* size of buffer: input */
size_t lifs_len; /* size of buffer: output */
union {
caddr_t lifsu_buf;
struct lifreq *lifsu_req;
} lifs_lifsu;
#define lifs_buf lifs_lifsu.lifsu_buf /* buffer addr. */
#define lifs_req lifs_lifsu.lifsu_req /* array returned */
};
.fi
.in -2
.sp
.LP
The following \fBioctl()\fR calls are maintained for compatibility but only
apply to IPv4 network interfaces, since the data structures are too small to
hold an IPv6 address. Unless specified otherwise, the request takes an
\fBifreq\fR structure as its parameter. This structure has the form:
.sp
.in +2
.nf
struct ifreq {
#define IFNAMSIZ 16
char ifr_name[IFNAMSIZ]; /* interface name - e.g. "hme0" */
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
struct sockaddr ifru_broadaddr;
short ifru_flags;
int ifru_metric;
int if_muxid[2]; /* mux id's for arp and ip */
int ifru_index; /* interface index */
} ifr_ifru;
#define ifr_addr ifr_ifru.ifru_addr /* address */
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
#define ifr_flags ifr_ifru.ifru_flags /* flags */
#define ifr_index ifr_ifru.ifru_index /* interface index */
#define ifr_metric ifr_ifru.ifru_metric /* metric */
};
.fi
.in -2
.sp
.ne 2
.na
\fB\fBSIOCSIFADDR\fR\fR
.ad
.RS 18n
Set interface address.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGIFADDR\fR\fR
.ad
.RS 18n
Get interface address.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSIFDSTADDR\fR\fR
.ad
.RS 18n
Set point to point address for interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGIFDSTADDR\fR\fR
.ad
.RS 18n
Get point to point address for interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSIFFLAGS\fR\fR
.ad
.RS 18n
Set interface flags field. If the interface is marked down, any processes
currently routing packets through the interface are notified.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGIFFLAGS\fR\fR
.ad
.RS 18n
Get interface flags.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGIFCONF\fR\fR
.ad
.RS 18n
Get interface configuration list. This request takes an \fBifconf\fR structure
(see below) as a value-result parameter. The \fBifc_len\fR field should be set
to the size of the buffer pointed to by \fBifc_buf\fR. Upon success,
\fBifc_len\fR will contain the length, in bytes, of the array of \fBifreq\fR
structures pointed to by \fBifc_req\fR. For each \fBifreq\fR structure, the
\fBifr_name\fR and \fBifr_addr\fR fields are valid. Though IPMP IP interfaces
are included in the array, underlying IP interfaces that comprise those IPMP
groups are not.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGIFNUM\fR\fR
.ad
.RS 18n
Get number of interfaces. This request returns an integer which is the number
of interface descriptions (\fBstruct ifreq\fR) returned by the
\fBSIOCGIFCONF\fR ioctl (in other words, indicates how large \fBifc_len\fR must
be). Though IPMP IP interfaces are included in the array, underlying IP
interfaces that comprise those IPMP groups are not.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSIFMTU\fR\fR
.ad
.RS 18n
Set the maximum transmission unit (\fBMTU\fR) size for interface. Place the
request in the \fBifr_metric\fR field. The \fBMTU\fR has to be smaller than
physical \fBMTU\fR limitation (which is reported in the \fBDLPI\fR
\fBDL_INFO_ACK\fR message).
.RE
.sp
.ne 2
.na
\fB\fBSIOCGIFMTU\fR\fR
.ad
.RS 18n
Get the maximum transmission unit size for interface. Upon success, the request
is placed in the \fBifr_metric\fR field.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSIFMETRIC\fR\fR
.ad
.RS 18n
Set the metric associated with the interface. The metric is used by routine
daemons such as \fBin.routed\fR(1M).
.RE
.sp
.ne 2
.na
\fB\fBSIOCGIFMETRIC\fR\fR
.ad
.RS 18n
Get the metric associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGIFMUXID\fR\fR
.ad
.RS 18n
Get the \fBip\fR and \fBarp\fR \fBmuxid\fR associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSIFMUXID\fR\fR
.ad
.RS 18n
Set the \fBip\fR and \fBarp\fR \fBmuxid\fR associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCGIFINDEX\fR\fR
.ad
.RS 18n
Get the interface index associated with the interface.
.RE
.sp
.ne 2
.na
\fB\fBSIOCSIFINDEX\fR\fR
.ad
.RS 18n
Set the interface index associated with the interface.
.RE
.sp
.LP
The \fBifconf\fR structure has the form:
.sp
.in +2
.nf
struct ifconf {
int ifc_len; /* size of assoc. buffer */
union {
caddr_t ifcu_buf;
struct ifreq *ifcu_req;
} ifc_ifcu;
#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
#define ifc_req ifc_ifcu.ifcu_req /* array of structs returned */
};
.fi
.in -2
.SS "IFF_ Flags"
.LP
You can use the \fBifconfig\fR(1M) command to display the \fBIFF\fR_ flags
listed below (with the leading \fBIFF\fR_ prefix removed). See the
\fBifconfig\fR(1M) manpage for a definition of each flag.
.sp
.in +2
.nf
#define IFF_UP 0x0000000001 /* Address is up */
#define IFF_BROADCAST 0x0000000002 /* Broadcast address valid */
#define IFF_DEBUG 0x0000000004 /* Turn on debugging */
#define IFF_LOOPBACK 0x0000000008 /* Loopback net */
#define IFF_POINTOPOINT 0x0000000010 /* Interface is p-to-p */
#define IFF_NOTRAILERS 0x0000000020 /* Avoid use of trailers */
#define IFF_RUNNING 0x0000000040 /* Resources allocated */
#define IFF_NOARP 0x0000000080 /* No address res. protocol */
#define IFF_PROMISC 0x0000000100 /* Receive all packets */
#define IFF_ALLMULTI 0x0000000200 /* Receive all multicast pkts */
#define IFF_INTELLIGENT 0x0000000400 /* Protocol code on board */
#define IFF_MULTICAST 0x0000000800 /* Supports multicast */
#define IFF_MULTI_BCAST 0x0000001000 /* Multicast using broadcst. add. */
#define IFF_UNNUMBERED 0x0000002000 /* Non-unique address */
#define IFF_DHCPRUNNING 0x0000004000 /* DHCP controls interface */
#define IFF_PRIVATE 0x0000008000 /* Do not advertise */
#define IFF_NOXMIT 0x0000010000 /* Do not transmit pkts */
#define IFF_NOLOCAL 0x0000020000 /* No address - just on-link subnet */
#define IFF_DEPRECATED 0x0000040000 /* Address is deprecated */
#define IFF_ADDRCONF 0x0000080000 /* Addr. from stateless addrconf */
#define IFF_ROUTER 0x0000100000 /* Router on interface */
#define IFF_NONUD 0x0000200000 /* No NUD on interface */
#define IFF_ANYCAST 0x0000400000 /* Anycast address */
#define IFF_NORTEXCH 0x0000800000 /* Don't xchange rout. info */
#define IFF_IPV4 0x0001000000 /* IPv4 interface */
#define IFF_IPV6 0x0002000000 /* IPv6 interface */
#define IFF_NOFAILOVER 0x0008000000 /* in.mpathd test address */
#define IFF_FAILED 0x0010000000 /* Interface has failed */
#define IFF_STANDBY 0x0020000000 /* Interface is a hot-spare */
#define IFF_INACTIVE 0x0040000000 /* Functioning but not used */
#define IFF_OFFLINE 0x0080000000 /* Interface is offline */
#define IFF_XRESOLV 0x0100000000 /* IPv6 external resolver */
#define IFF_COS_ENABLED 0x0200000000 /* If CoS marking is supported */
#define IFF_PREFERRED 0x0400000000 /* Prefer as source address */
#define IFF_TEMPORARY 0x0800000000 /* RFC3041 */
#define IFF_FIXEDMTU 0x1000000000 /* MTU set with SIOCSLIFMTU */
#define IFF_VIRTUAL 0x2000000000 /* Cannot send/receive pkts */
#define IFF_DUPLICATE 0x4000000000 /* Local address in use */
#define IFF_IPMP 0x8000000000 /* IPMP IP interface */
.fi
.in -2
.SH ERRORS
.ne 2
.na
\fB\fBEPERM\fR\fR
.ad
.RS 12n
Calling process has insufficient privileges.
.RE
.sp
.ne 2
.na
\fB\fBENXIO\fR\fR
.ad
.RS 12n
The \fBlifr_name\fR member of the \fBlifreq\fR structure contains an invalid
value.
.sp
For \fBSIOCGLIFSRCOF\fR, the \fBlifs_ifindex\fR member of the \fBlifsrcof\fR
structure contains an invalid value.
.sp
For \fBSIOCSLIFUSESRC\fR, this error is returned if the \fBlifr_index\fR is set
to an invalid value.
.RE
.sp
.ne 2
.na
\fB\fBEBADADDR\fR\fR
.ad
.RS 12n
Wrong address family or malformed address.
.RE
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 12n
For \fBSIOCSLIFMTU\fR, this error is returned when the requested \fBMTU\fR size
is invalid. This error indicates the \fBMTU\fR size is greater than the
\fBMTU\fR size supported by the \fBDLPI\fR provider or less than \fB68\fR (for
IPv4) or less than \fB1280\fR (for IPv6).
.sp
For \fBSIOCSLIFUSESRC\fR, this error is returned if either the \fBlifr_index\fR
or \fBlifr_name\fR identify interfaces that are already part of an existing
IPMP group.
.RE
.sp
.ne 2
.na
\fB\fBEEXIST\fR\fR
.ad
.RS 12n
For \fBSIOCLIFADDIF\fR, this error is returned if the \fBlifr_name\fR member in
the \fBlifreq\fR structure corresponds to an interface that already has the PPA
specified by \fBlifr_ppa\fR plumbed.
.RE
.SH SEE ALSO
.LP
\fBifconfig\fR(1M), \fBin.routed\fR(1M), \fBioctl\fR(2),
\fBsockaddr\fR(3SOCKET), \fBstreamio\fR(7I), \fBarp\fR(7P), \fBdlpi\fR(7P),
\fBip\fR(7P), \fBip6\fR(7P), \fBndp\fR(7P)
|