Skip to content

darwin: add in6_aliasreq, ifaliasreq structs #4435

Open
@pronebird

Description

@pronebird

Structs such as in6_aliasreq, ifaliasreq are missing in libc. We should consider adding them.

Custom bindings that I use right now. Probably can be adapted to better match the original field names.

#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Copy, Clone)]
struct in6_aliasreq {
    pub name: [c_char; IFNAMSIZ],
    pub addr: sockaddr_in6,
    pub dstaddr: sockaddr_in6,
    pub prefixmask: sockaddr_in6,
    pub flags: c_int,
    pub lifetime: in6_addrlifetime,
}

#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Copy, Clone)]
struct in6_addrlifetime {
    pub ia6t_expire: time_t,
    pub ia6t_preferred: time_t,
    pub ia6t_vltime: u32,
    pub ia6t_pltime: u32,
}

#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Copy, Clone)]
struct ifaliasreq {
    pub ifran: [c_char; IFNAMSIZ],
    pub addr: sockaddr,
    pub destination: sockaddr,
    pub mask: sockaddr,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions