ip.4 (6f5bc70a3ff25d174ded4288565c90e4488225c5) ip.4 (538a4c1f75b386389807518b75f58c722eb6833d)
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 515 unchanged lines hidden (view full) ---

524the fields of the IP header, including the following:
525.Bd -literal
526ip->ip_v = IPVERSION;
527ip->ip_hl = hlen >> 2;
528ip->ip_id = 0; /* 0 means kernel set appropriate value */
529ip->ip_off = offset;
530.Ed
531.Pp
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 515 unchanged lines hidden (view full) ---

524the fields of the IP header, including the following:
525.Bd -literal
526ip->ip_v = IPVERSION;
527ip->ip_hl = hlen >> 2;
528ip->ip_id = 0; /* 0 means kernel set appropriate value */
529ip->ip_off = offset;
530.Ed
531.Pp
532The ip_len and ip_off fields
533.Em must be provided in host byte order .
532The
533.Va ip_len
534and
535.Va ip_off
536fields
537.Em must
538be provided in host byte order .
534All other fields must be provided in network byte order.
535See
536.Xr byteorder 4
537for more information on network byte order.
539All other fields must be provided in network byte order.
540See
541.Xr byteorder 4
542for more information on network byte order.
538If the ip_id field is set to 0, then the kernel will choose an
543If the
544.Va ip_id
545field is set to 0 then the kernel will choose an
539appopriate value.
540If the header source address is set to
541.Dv INADDR_ANY ,
542the kernel will choose an appropriate address.
543.Sh ERRORS
544A socket operation may fail with one of the following errors returned:
545.Bl -tag -width Er
546.It Bq Er EISCONN

--- 30 unchanged lines hidden (view full) ---

577or longer than the option buffer provided.
578.El
579.Pp
580The following errors may occur when attempting to send
581.Tn IP
582datagrams via a
583.Dq raw socket
584with the
546appopriate value.
547If the header source address is set to
548.Dv INADDR_ANY ,
549the kernel will choose an appropriate address.
550.Sh ERRORS
551A socket operation may fail with one of the following errors returned:
552.Bl -tag -width Er
553.It Bq Er EISCONN

--- 30 unchanged lines hidden (view full) ---

584or longer than the option buffer provided.
585.El
586.Pp
587The following errors may occur when attempting to send
588.Tn IP
589datagrams via a
590.Dq raw socket
591with the
585.Em IP_HDRINCL
592.Dv IP_HDRINCL
586option set:
587.Bl -tag -width Er
588.It Bq Er EINVAL
593option set:
594.Bl -tag -width Er
595.It Bq Er EINVAL
589The user-supplied ip_len field was not equal to the length of the datagram
590written to the socket.
596The user-supplied
597.Va ip_len
598field was not equal to the length of the datagram written to the socket.
591.El
592.Sh SEE ALSO
593.Xr getsockopt 2 ,
594.Xr recv 2 ,
595.Xr send 2 ,
596.Xr byteorder 4 ,
597.Xr icmp 4 ,
598.Xr inet 4 ,
599.Xr intro 4
600.Sh HISTORY
601The
602.Nm
603protocol appeared in
604.Bx 4.2 .
599.El
600.Sh SEE ALSO
601.Xr getsockopt 2 ,
602.Xr recv 2 ,
603.Xr send 2 ,
604.Xr byteorder 4 ,
605.Xr icmp 4 ,
606.Xr inet 4 ,
607.Xr intro 4
608.Sh HISTORY
609The
610.Nm
611protocol appeared in
612.Bx 4.2 .