35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
//@ts-check
|
|
|
|
//@ts-expect-error
|
|
const ip = require('./ip.node')
|
|
|
|
const flags = {
|
|
IFF_UP: 0x1, /* Interface is up. */
|
|
IFF_BROADCAST: 0x2, /* Broadcast address valid. */
|
|
IFF_DEBUG: 0x4, /* Turn on debugging. */
|
|
IFF_LOOPBACK: 0x8, /* Is a loopback net. */
|
|
IFF_POINTOPOINT: 0x10, /* Interface is point-to-point link. */
|
|
IFF_NOTRAILERS: 0x20, /* Avoid use of trailers. */
|
|
IFF_RUNNING: 0x40, /* Resources allocated. */
|
|
IFF_NOARP: 0x80, /* No address resolution protocol. */
|
|
IFF_PROMISC: 0x100, /* Receive all packets. */
|
|
/* Not supported */
|
|
IFF_ALLMULTI: 0x200, /* Receive all multicast packets. */
|
|
IFF_MASTER: 0x400, /* Master of a load balancer. */
|
|
IFF_SLAVE: 0x800, /* Slave of a load balancer. */
|
|
IFF_MULTICAST: 0x1000, /* Supports multicast. */
|
|
IFF_PORTSEL: 0x2000, /* Can set media type. */
|
|
IFF_AUTOMEDIA: 0x4000, /* Auto media select active. */
|
|
IFF_DYNAMIC: 0x8000 /* Dialup device with changing addresses. */
|
|
}
|
|
|
|
/**
|
|
* @param { string } interface
|
|
* @param { number } flags
|
|
* @return { number }
|
|
*/
|
|
function setFlags(interface, flags) {
|
|
return ip.setFlags(interface, flags)
|
|
}
|
|
|
|
module.exports = { setFlags, flags } |