rawlink

Portable library to read and write raw packets
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library rawlink.lwt
Module Lwt_rawlink
type t

open_link ~filter interface. Creates a rawlink on the specified interface, a BPF program filter can be passed to filter out incoming packets.

close_link. Closes a rawlink.

val read_packet : t -> Cstruct.t Lwt.t

read_packet t. Reads a full packet, may raise Unix.Unix_error.

val send_packet : t -> Cstruct.t -> unit Lwt.t

send_packet t. Sends a full packet, may raise Unix.Unix_error.

val dhcp_server_filter : unit -> string

dhcp_server_filter. Returns a BPF program suitable to be passed in open_link ~filter, it accepts UDP packets destined to port 67 (DHCP client).

val dhcp_client_filter : unit -> string

dhcp_client_filter. Returns a BPF program suitable to be passed in open_link ~filter, it accepts UDP packets destined to port 68 (DHCP server).