Module Cf_ip4_proto


module Cf_ip4_proto: sig .. end
The AF_INET address family (for use with TCP and UDP over IPv4).


Modules and Types

module AF: Cf_socket.AF  with
    type tag = [ `AF_INET ] and
    type address = Cf_ip4_addr.opaque Cf_ip4_addr.t * int
The address family module for IPv4 transports.
module TCP: Cf_socket.P  with
    module AF = AF and
    module ST = Cf_socket.SOCK_STREAM
The TCP (IPv4) socket protocol.
module UDP: Cf_socket.P  with
    module AF = AF and
    module ST = Cf_socket.SOCK_DGRAM
The UDP (IPv4) socket protocol.

type mreq = {
   imr_multiaddr : Cf_ip4_addr.multicast Cf_ip4_addr.t;
   imr_interface : Cf_ip4_addr.unicast Cf_ip4_addr.t;
}
The multicast request type

Socket Options

The following socket options are available on sockets of AF_INET family.

val ip_ttl : (int, [ `AF_INET ], 'a) Cf_socket.sockopt
Set the unicast hop count for the socket.
val ip_add_membership : (mreq, [ `AF_INET ], [ `SOCK_DGRAM ]) Cf_socket.sockopt
Add the socket to the membership of a multicast group.
val ip_drop_membership : (mreq, [ `AF_INET ], [ `SOCK_DGRAM ]) Cf_socket.sockopt
Drop the socket from the membership of a multicast group.
val ip_multicast_if : (Cf_ip4_addr.unicast Cf_ip4_addr.t, [ `AF_INET ], [ `SOCK_DGRAM ])
Cf_socket.sockopt
The primary network interface address for sending to multicast destinations.
val ip_multicast_ttl : (int, [ `AF_INET ], [ `SOCK_DGRAM ]) Cf_socket.sockopt
The multicast hop count for the socket.
val ip_multicast_loop : (bool, [ `AF_INET ], [ `SOCK_DGRAM ]) Cf_socket.sockopt
Enable multicast loopback on the socket.

Other Functions

The following socket options are available on sockets of AF_INET and AF_INET6 address/protocol families.

val siocgifaddr : ([ `AF_INET ], 'a) Cf_socket.t ->
string -> [> Cf_ip4_addr.unicast ] Cf_ip4_addr.t
Use siocgifaddr sock name with any `AF_INET address family socket sock to get the primary IP address for the name interface.