iproutejs 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +245 -0
- package/lib/commands/address/add.interfaces.d.ts +94 -0
- package/lib/commands/address/add.interfaces.js +3 -0
- package/lib/commands/address/add.interfaces.js.map +1 -0
- package/lib/commands/address/add.schema.d.ts +3 -0
- package/lib/commands/address/add.schema.js +121 -0
- package/lib/commands/address/add.schema.js.map +1 -0
- package/lib/commands/address/delete.interfaces.d.ts +56 -0
- package/lib/commands/address/delete.interfaces.js +3 -0
- package/lib/commands/address/delete.interfaces.js.map +1 -0
- package/lib/commands/address/delete.schema.d.ts +3 -0
- package/lib/commands/address/delete.schema.js +64 -0
- package/lib/commands/address/delete.schema.js.map +1 -0
- package/lib/commands/address/flush.interfaces.d.ts +89 -0
- package/lib/commands/address/flush.interfaces.js +3 -0
- package/lib/commands/address/flush.interfaces.js.map +1 -0
- package/lib/commands/address/flush.schema.d.ts +3 -0
- package/lib/commands/address/flush.schema.js +165 -0
- package/lib/commands/address/flush.schema.js.map +1 -0
- package/lib/commands/address/show.interfaces.d.ts +166 -0
- package/lib/commands/address/show.interfaces.js +3 -0
- package/lib/commands/address/show.interfaces.js.map +1 -0
- package/lib/commands/address/show.schema.d.ts +3 -0
- package/lib/commands/address/show.schema.js +176 -0
- package/lib/commands/address/show.schema.js.map +1 -0
- package/lib/commands/address.constants.d.ts +33 -0
- package/lib/commands/address.constants.js +39 -0
- package/lib/commands/address.constants.js.map +1 -0
- package/lib/commands/address.d.ts +179 -0
- package/lib/commands/address.js +265 -0
- package/lib/commands/address.js.map +1 -0
- package/lib/commands/addrlabel/add.interfaces.d.ts +12 -0
- package/lib/commands/addrlabel/add.interfaces.js +3 -0
- package/lib/commands/addrlabel/add.interfaces.js.map +1 -0
- package/lib/commands/addrlabel/add.schema.d.ts +3 -0
- package/lib/commands/addrlabel/add.schema.js +26 -0
- package/lib/commands/addrlabel/add.schema.js.map +1 -0
- package/lib/commands/addrlabel/del.interfaces.d.ts +6 -0
- package/lib/commands/addrlabel/del.interfaces.js +3 -0
- package/lib/commands/addrlabel/del.interfaces.js.map +1 -0
- package/lib/commands/addrlabel/del.schema.d.ts +3 -0
- package/lib/commands/addrlabel/del.schema.js +27 -0
- package/lib/commands/addrlabel/del.schema.js.map +1 -0
- package/lib/commands/addrlabel/list.interfaces.d.ts +9 -0
- package/lib/commands/addrlabel/list.interfaces.js +3 -0
- package/lib/commands/addrlabel/list.interfaces.js.map +1 -0
- package/lib/commands/addrlabel.d.ts +104 -0
- package/lib/commands/addrlabel.js +149 -0
- package/lib/commands/addrlabel.js.map +1 -0
- package/lib/commands/batch.d.ts +60 -0
- package/lib/commands/batch.js +90 -0
- package/lib/commands/batch.js.map +1 -0
- package/lib/commands/link/add.interfaces.d.ts +122 -0
- package/lib/commands/link/add.interfaces.js +4 -0
- package/lib/commands/link/add.interfaces.js.map +1 -0
- package/lib/commands/link/add.schema.d.ts +4 -0
- package/lib/commands/link/add.schema.js +172 -0
- package/lib/commands/link/add.schema.js.map +1 -0
- package/lib/commands/link/delete.interfaces.d.ts +22 -0
- package/lib/commands/link/delete.interfaces.js +3 -0
- package/lib/commands/link/delete.interfaces.js.map +1 -0
- package/lib/commands/link/delete.schema.d.ts +3 -0
- package/lib/commands/link/delete.schema.js +29 -0
- package/lib/commands/link/delete.schema.js.map +1 -0
- package/lib/commands/link/extended-virtual-link-types/bond-slave.interfaces.d.ts +8 -0
- package/lib/commands/link/extended-virtual-link-types/bond-slave.interfaces.js +3 -0
- package/lib/commands/link/extended-virtual-link-types/bond-slave.interfaces.js.map +1 -0
- package/lib/commands/link/extended-virtual-link-types/bond-slave.schema.d.ts +3 -0
- package/lib/commands/link/extended-virtual-link-types/bond-slave.schema.js +16 -0
- package/lib/commands/link/extended-virtual-link-types/bond-slave.schema.js.map +1 -0
- package/lib/commands/link/extended-virtual-link-types/bridge-slave.interfaces.d.ts +77 -0
- package/lib/commands/link/extended-virtual-link-types/bridge-slave.interfaces.js +3 -0
- package/lib/commands/link/extended-virtual-link-types/bridge-slave.interfaces.js.map +1 -0
- package/lib/commands/link/extended-virtual-link-types/bridge-slave.schema.d.ts +3 -0
- package/lib/commands/link/extended-virtual-link-types/bridge-slave.schema.js +126 -0
- package/lib/commands/link/extended-virtual-link-types/bridge-slave.schema.js.map +1 -0
- package/lib/commands/link/set.interfaces.d.ts +271 -0
- package/lib/commands/link/set.interfaces.js +4 -0
- package/lib/commands/link/set.interfaces.js.map +1 -0
- package/lib/commands/link/set.schema.d.ts +5 -0
- package/lib/commands/link/set.schema.js +284 -0
- package/lib/commands/link/set.schema.js.map +1 -0
- package/lib/commands/link/show.interfaces.d.ts +116 -0
- package/lib/commands/link/show.interfaces.js +3 -0
- package/lib/commands/link/show.interfaces.js.map +1 -0
- package/lib/commands/link/show.schema.d.ts +3 -0
- package/lib/commands/link/show.schema.js +43 -0
- package/lib/commands/link/show.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/bareup.interfaces.d.ts +30 -0
- package/lib/commands/link/virtual-link-types/bareup.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/bareup.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/bareup.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/bareup.schema.js +43 -0
- package/lib/commands/link/virtual-link-types/bareup.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/bridge.interfaces.d.ts +140 -0
- package/lib/commands/link/virtual-link-types/bridge.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/bridge.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/bridge.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/bridge.schema.js +186 -0
- package/lib/commands/link/virtual-link-types/bridge.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/can.interfaces.d.ts +71 -0
- package/lib/commands/link/virtual-link-types/can.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/can.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/can.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/can.schema.js +141 -0
- package/lib/commands/link/virtual-link-types/can.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/erspan-ip6erspan.interfaces.d.ts +58 -0
- package/lib/commands/link/virtual-link-types/erspan-ip6erspan.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/erspan-ip6erspan.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/erspan-ip6erspan.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/erspan-ip6erspan.schema.js +64 -0
- package/lib/commands/link/virtual-link-types/erspan-ip6erspan.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/geneve.interfaces.d.ts +54 -0
- package/lib/commands/link/virtual-link-types/geneve.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/geneve.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/geneve.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/geneve.schema.js +93 -0
- package/lib/commands/link/virtual-link-types/geneve.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/gre-gretap.interfaces.d.ts +106 -0
- package/lib/commands/link/virtual-link-types/gre-gretap.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/gre-gretap.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/gre-gretap.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/gre-gretap.schema.js +208 -0
- package/lib/commands/link/virtual-link-types/gre-gretap.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/hsr.interfaces.d.ts +20 -0
- package/lib/commands/link/virtual-link-types/hsr.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/hsr.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/hsr.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/hsr.schema.js +36 -0
- package/lib/commands/link/virtual-link-types/hsr.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.interfaces.d.ts +80 -0
- package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.schema.js +170 -0
- package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/ipip-sit.interfaces.d.ts +51 -0
- package/lib/commands/link/virtual-link-types/ipip-sit.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/ipip-sit.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/ipip-sit.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/ipip-sit.schema.js +74 -0
- package/lib/commands/link/virtual-link-types/ipip-sit.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/ipoib.interfaces.d.ts +11 -0
- package/lib/commands/link/virtual-link-types/ipoib.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/ipoib.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/ipoib.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/ipoib.schema.js +22 -0
- package/lib/commands/link/virtual-link-types/ipoib.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/macsec.interfaces.d.ts +44 -0
- package/lib/commands/link/virtual-link-types/macsec.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/macsec.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/macsec.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/macsec.schema.js +87 -0
- package/lib/commands/link/virtual-link-types/macsec.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/macvlan-macvtap.interfaces.d.ts +59 -0
- package/lib/commands/link/virtual-link-types/macvlan-macvtap.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/macvlan-macvtap.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/macvlan-macvtap.schema.d.ts +4 -0
- package/lib/commands/link/virtual-link-types/macvlan-macvtap.schema.js +60 -0
- package/lib/commands/link/virtual-link-types/macvlan-macvtap.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/rmnet.interfaces.d.ts +8 -0
- package/lib/commands/link/virtual-link-types/rmnet.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/rmnet.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/rmnet.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/rmnet.schema.js +16 -0
- package/lib/commands/link/virtual-link-types/rmnet.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/veth-vxcan.interfaces.d.ts +8 -0
- package/lib/commands/link/virtual-link-types/veth-vxcan.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/veth-vxcan.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/veth-vxcan.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/veth-vxcan.schema.js +16 -0
- package/lib/commands/link/virtual-link-types/veth-vxcan.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/vlan.interfaces.d.ts +36 -0
- package/lib/commands/link/virtual-link-types/vlan.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/vlan.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/vlan.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/vlan.schema.js +65 -0
- package/lib/commands/link/virtual-link-types/vlan.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/vrf.interfaces.d.ts +8 -0
- package/lib/commands/link/virtual-link-types/vrf.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/vrf.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/vrf.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/vrf.schema.js +16 -0
- package/lib/commands/link/virtual-link-types/vrf.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/vxlan.interfaces.d.ts +127 -0
- package/lib/commands/link/virtual-link-types/vxlan.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/vxlan.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/vxlan.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/vxlan.schema.js +176 -0
- package/lib/commands/link/virtual-link-types/vxlan.schema.js.map +1 -0
- package/lib/commands/link/virtual-link-types/xfrm.interfaces.d.ts +16 -0
- package/lib/commands/link/virtual-link-types/xfrm.interfaces.js +3 -0
- package/lib/commands/link/virtual-link-types/xfrm.interfaces.js.map +1 -0
- package/lib/commands/link/virtual-link-types/xfrm.schema.d.ts +3 -0
- package/lib/commands/link/virtual-link-types/xfrm.schema.js +21 -0
- package/lib/commands/link/virtual-link-types/xfrm.schema.js.map +1 -0
- package/lib/commands/link/xdp-options/object.interfaces.d.ts +36 -0
- package/lib/commands/link/xdp-options/object.interfaces.js +3 -0
- package/lib/commands/link/xdp-options/object.interfaces.js.map +1 -0
- package/lib/commands/link/xdp-options/object.schema.d.ts +3 -0
- package/lib/commands/link/xdp-options/object.schema.js +25 -0
- package/lib/commands/link/xdp-options/object.schema.js.map +1 -0
- package/lib/commands/link/xdp-options/off.interfaces.d.ts +8 -0
- package/lib/commands/link/xdp-options/off.interfaces.js +3 -0
- package/lib/commands/link/xdp-options/off.interfaces.js.map +1 -0
- package/lib/commands/link/xdp-options/off.schema.d.ts +3 -0
- package/lib/commands/link/xdp-options/off.schema.js +15 -0
- package/lib/commands/link/xdp-options/off.schema.js.map +1 -0
- package/lib/commands/link/xdp-options/pinned.interfaces.d.ts +13 -0
- package/lib/commands/link/xdp-options/pinned.interfaces.js +3 -0
- package/lib/commands/link/xdp-options/pinned.interfaces.js.map +1 -0
- package/lib/commands/link/xdp-options/pinned.schema.d.ts +3 -0
- package/lib/commands/link/xdp-options/pinned.schema.js +15 -0
- package/lib/commands/link/xdp-options/pinned.schema.js.map +1 -0
- package/lib/commands/link.constants.d.ts +425 -0
- package/lib/commands/link.constants.js +366 -0
- package/lib/commands/link.constants.js.map +1 -0
- package/lib/commands/link.d.ts +113 -0
- package/lib/commands/link.js +159 -0
- package/lib/commands/link.js.map +1 -0
- package/lib/commands/maddress/add.interfaces.d.ts +10 -0
- package/lib/commands/maddress/add.interfaces.js +3 -0
- package/lib/commands/maddress/add.interfaces.js.map +1 -0
- package/lib/commands/maddress/add.schema.d.ts +3 -0
- package/lib/commands/maddress/add.schema.js +22 -0
- package/lib/commands/maddress/add.schema.js.map +1 -0
- package/lib/commands/maddress/show.interfaces.d.ts +25 -0
- package/lib/commands/maddress/show.interfaces.js +3 -0
- package/lib/commands/maddress/show.interfaces.js.map +1 -0
- package/lib/commands/maddress/show.schema.d.ts +3 -0
- package/lib/commands/maddress/show.schema.js +17 -0
- package/lib/commands/maddress/show.schema.js.map +1 -0
- package/lib/commands/maddress.d.ts +82 -0
- package/lib/commands/maddress.js +121 -0
- package/lib/commands/maddress.js.map +1 -0
- package/lib/commands/monitor/monitor.interfaces.d.ts +24 -0
- package/lib/commands/monitor/monitor.interfaces.js +3 -0
- package/lib/commands/monitor/monitor.interfaces.js.map +1 -0
- package/lib/commands/monitor/monitor.schema.d.ts +3 -0
- package/lib/commands/monitor/monitor.schema.js +33 -0
- package/lib/commands/monitor/monitor.schema.js.map +1 -0
- package/lib/commands/monitor.constants.d.ts +17 -0
- package/lib/commands/monitor.constants.js +22 -0
- package/lib/commands/monitor.constants.js.map +1 -0
- package/lib/commands/monitor.d.ts +52 -0
- package/lib/commands/monitor.js +75 -0
- package/lib/commands/monitor.js.map +1 -0
- package/lib/commands/mroute/show.interfaces.d.ts +26 -0
- package/lib/commands/mroute/show.interfaces.js +3 -0
- package/lib/commands/mroute/show.interfaces.js.map +1 -0
- package/lib/commands/mroute/show.schema.d.ts +3 -0
- package/lib/commands/mroute/show.schema.js +44 -0
- package/lib/commands/mroute/show.schema.js.map +1 -0
- package/lib/commands/mroute.d.ts +29 -0
- package/lib/commands/mroute.js +53 -0
- package/lib/commands/mroute.js.map +1 -0
- package/lib/commands/neighbour/add.interfaces.d.ts +34 -0
- package/lib/commands/neighbour/add.interfaces.js +3 -0
- package/lib/commands/neighbour/add.interfaces.js.map +1 -0
- package/lib/commands/neighbour/add.schema.d.ts +3 -0
- package/lib/commands/neighbour/add.schema.js +49 -0
- package/lib/commands/neighbour/add.schema.js.map +1 -0
- package/lib/commands/neighbour/del.interfaces.d.ts +23 -0
- package/lib/commands/neighbour/del.interfaces.js +3 -0
- package/lib/commands/neighbour/del.interfaces.js.map +1 -0
- package/lib/commands/neighbour/del.schema.d.ts +3 -0
- package/lib/commands/neighbour/del.schema.js +37 -0
- package/lib/commands/neighbour/del.schema.js.map +1 -0
- package/lib/commands/neighbour/get.interfaces.d.ts +12 -0
- package/lib/commands/neighbour/get.interfaces.js +3 -0
- package/lib/commands/neighbour/get.interfaces.js.map +1 -0
- package/lib/commands/neighbour/get.schema.d.ts +3 -0
- package/lib/commands/neighbour/get.schema.js +26 -0
- package/lib/commands/neighbour/get.schema.js.map +1 -0
- package/lib/commands/neighbour/show.interfaces.d.ts +37 -0
- package/lib/commands/neighbour/show.interfaces.js +3 -0
- package/lib/commands/neighbour/show.interfaces.js.map +1 -0
- package/lib/commands/neighbour/show.schema.d.ts +3 -0
- package/lib/commands/neighbour/show.schema.js +39 -0
- package/lib/commands/neighbour/show.schema.js.map +1 -0
- package/lib/commands/neighbour.constants.d.ts +34 -0
- package/lib/commands/neighbour.constants.js +39 -0
- package/lib/commands/neighbour.constants.js.map +1 -0
- package/lib/commands/neighbour.d.ts +169 -0
- package/lib/commands/neighbour.js +238 -0
- package/lib/commands/neighbour.js.map +1 -0
- package/lib/commands/ntable/change.interfaces.d.ts +42 -0
- package/lib/commands/ntable/change.interfaces.js +3 -0
- package/lib/commands/ntable/change.interfaces.js.map +1 -0
- package/lib/commands/ntable/change.schema.d.ts +3 -0
- package/lib/commands/ntable/change.schema.js +101 -0
- package/lib/commands/ntable/change.schema.js.map +1 -0
- package/lib/commands/ntable/show.interfaces.d.ts +59 -0
- package/lib/commands/ntable/show.interfaces.js +3 -0
- package/lib/commands/ntable/show.interfaces.js.map +1 -0
- package/lib/commands/ntable/show.schema.d.ts +3 -0
- package/lib/commands/ntable/show.schema.js +22 -0
- package/lib/commands/ntable/show.schema.js.map +1 -0
- package/lib/commands/ntable.d.ts +43 -0
- package/lib/commands/ntable.js +75 -0
- package/lib/commands/ntable.js.map +1 -0
- package/lib/commands/route/add.interfaces.d.ts +261 -0
- package/lib/commands/route/add.interfaces.js +4 -0
- package/lib/commands/route/add.interfaces.js.map +1 -0
- package/lib/commands/route/add.schema.d.ts +3 -0
- package/lib/commands/route/add.schema.js +366 -0
- package/lib/commands/route/add.schema.js.map +1 -0
- package/lib/commands/route/encap-types/bpf.interfaces.d.ts +14 -0
- package/lib/commands/route/encap-types/bpf.interfaces.js +3 -0
- package/lib/commands/route/encap-types/bpf.interfaces.js.map +1 -0
- package/lib/commands/route/encap-types/bpf.schema.d.ts +3 -0
- package/lib/commands/route/encap-types/bpf.schema.js +31 -0
- package/lib/commands/route/encap-types/bpf.schema.js.map +1 -0
- package/lib/commands/route/encap-types/ioam6.interfaces.d.ts +19 -0
- package/lib/commands/route/encap-types/ioam6.interfaces.js +3 -0
- package/lib/commands/route/encap-types/ioam6.interfaces.js.map +1 -0
- package/lib/commands/route/encap-types/ioam6.schema.d.ts +3 -0
- package/lib/commands/route/encap-types/ioam6.schema.js +30 -0
- package/lib/commands/route/encap-types/ioam6.schema.js.map +1 -0
- package/lib/commands/route/encap-types/ip.interfaces.d.ts +17 -0
- package/lib/commands/route/encap-types/ip.interfaces.js +3 -0
- package/lib/commands/route/encap-types/ip.interfaces.js.map +1 -0
- package/lib/commands/route/encap-types/ip.schema.d.ts +3 -0
- package/lib/commands/route/encap-types/ip.schema.js +48 -0
- package/lib/commands/route/encap-types/ip.schema.js.map +1 -0
- package/lib/commands/route/encap-types/mpls.interfaces.d.ts +11 -0
- package/lib/commands/route/encap-types/mpls.interfaces.js +3 -0
- package/lib/commands/route/encap-types/mpls.interfaces.js.map +1 -0
- package/lib/commands/route/encap-types/mpls.schema.d.ts +3 -0
- package/lib/commands/route/encap-types/mpls.schema.js +46 -0
- package/lib/commands/route/encap-types/mpls.schema.js.map +1 -0
- package/lib/commands/route/encap-types/seg6.interfaces.d.ts +20 -0
- package/lib/commands/route/encap-types/seg6.interfaces.js +3 -0
- package/lib/commands/route/encap-types/seg6.interfaces.js.map +1 -0
- package/lib/commands/route/encap-types/seg6.schema.d.ts +3 -0
- package/lib/commands/route/encap-types/seg6.schema.js +38 -0
- package/lib/commands/route/encap-types/seg6.schema.js.map +1 -0
- package/lib/commands/route/encap-types/seg6local.interfaces.d.ts +76 -0
- package/lib/commands/route/encap-types/seg6local.interfaces.js +3 -0
- package/lib/commands/route/encap-types/seg6local.interfaces.js.map +1 -0
- package/lib/commands/route/encap-types/seg6local.schema.d.ts +6 -0
- package/lib/commands/route/encap-types/seg6local.schema.js +181 -0
- package/lib/commands/route/encap-types/seg6local.schema.js.map +1 -0
- package/lib/commands/route/get.interfaces.d.ts +37 -0
- package/lib/commands/route/get.interfaces.js +3 -0
- package/lib/commands/route/get.interfaces.js.map +1 -0
- package/lib/commands/route/get.schema.d.ts +3 -0
- package/lib/commands/route/get.schema.js +86 -0
- package/lib/commands/route/get.schema.js.map +1 -0
- package/lib/commands/route/show.constants.d.ts +105 -0
- package/lib/commands/route/show.constants.js +112 -0
- package/lib/commands/route/show.constants.js.map +1 -0
- package/lib/commands/route/show.interfaces.d.ts +96 -0
- package/lib/commands/route/show.interfaces.js +3 -0
- package/lib/commands/route/show.interfaces.js.map +1 -0
- package/lib/commands/route/show.schema.d.ts +3 -0
- package/lib/commands/route/show.schema.js +161 -0
- package/lib/commands/route/show.schema.js.map +1 -0
- package/lib/commands/route.constants.d.ts +129 -0
- package/lib/commands/route.constants.js +136 -0
- package/lib/commands/route.constants.js.map +1 -0
- package/lib/commands/route.d.ts +268 -0
- package/lib/commands/route.js +362 -0
- package/lib/commands/route.js.map +1 -0
- package/lib/commands/rule/add.interfaces.d.ts +41 -0
- package/lib/commands/rule/add.interfaces.js +3 -0
- package/lib/commands/rule/add.interfaces.js.map +1 -0
- package/lib/commands/rule/add.schema.d.ts +3 -0
- package/lib/commands/rule/add.schema.js +182 -0
- package/lib/commands/rule/add.schema.js.map +1 -0
- package/lib/commands/rule/show.interfaces.d.ts +86 -0
- package/lib/commands/rule/show.interfaces.js +3 -0
- package/lib/commands/rule/show.interfaces.js.map +1 -0
- package/lib/commands/rule/show.schema.d.ts +3 -0
- package/lib/commands/rule/show.schema.js +157 -0
- package/lib/commands/rule/show.schema.js.map +1 -0
- package/lib/commands/rule.constants.d.ts +34 -0
- package/lib/commands/rule.constants.js +40 -0
- package/lib/commands/rule.constants.js.map +1 -0
- package/lib/commands/rule.d.ts +143 -0
- package/lib/commands/rule.js +205 -0
- package/lib/commands/rule.js.map +1 -0
- package/lib/commands/tunnel/6rd.interfaces.d.ts +17 -0
- package/lib/commands/tunnel/6rd.interfaces.js +3 -0
- package/lib/commands/tunnel/6rd.interfaces.js.map +1 -0
- package/lib/commands/tunnel/6rd.schema.d.ts +3 -0
- package/lib/commands/tunnel/6rd.schema.js +33 -0
- package/lib/commands/tunnel/6rd.schema.js.map +1 -0
- package/lib/commands/tunnel/add.interfaces.d.ts +124 -0
- package/lib/commands/tunnel/add.interfaces.js +3 -0
- package/lib/commands/tunnel/add.interfaces.js.map +1 -0
- package/lib/commands/tunnel/add.schema.d.ts +3 -0
- package/lib/commands/tunnel/add.schema.js +213 -0
- package/lib/commands/tunnel/add.schema.js.map +1 -0
- package/lib/commands/tunnel/prl.interfaces.d.ts +17 -0
- package/lib/commands/tunnel/prl.interfaces.js +3 -0
- package/lib/commands/tunnel/prl.interfaces.js.map +1 -0
- package/lib/commands/tunnel/prl.schema.d.ts +3 -0
- package/lib/commands/tunnel/prl.schema.js +34 -0
- package/lib/commands/tunnel/prl.schema.js.map +1 -0
- package/lib/commands/tunnel.constants.d.ts +23 -0
- package/lib/commands/tunnel.constants.js +24 -0
- package/lib/commands/tunnel.constants.js.map +1 -0
- package/lib/commands/tunnel.d.ts +151 -0
- package/lib/commands/tunnel.js +210 -0
- package/lib/commands/tunnel.js.map +1 -0
- package/lib/commands/tuntap/add.interfaces.d.ts +25 -0
- package/lib/commands/tuntap/add.interfaces.js +3 -0
- package/lib/commands/tuntap/add.interfaces.js.map +1 -0
- package/lib/commands/tuntap/add.schema.d.ts +3 -0
- package/lib/commands/tuntap/add.schema.js +77 -0
- package/lib/commands/tuntap/add.schema.js.map +1 -0
- package/lib/commands/tuntap/show.interfaces.d.ts +17 -0
- package/lib/commands/tuntap/show.interfaces.js +3 -0
- package/lib/commands/tuntap/show.interfaces.js.map +1 -0
- package/lib/commands/tuntap/show.schema.d.ts +3 -0
- package/lib/commands/tuntap/show.schema.js +80 -0
- package/lib/commands/tuntap/show.schema.js.map +1 -0
- package/lib/commands/tuntap.constants.d.ts +8 -0
- package/lib/commands/tuntap.constants.js +13 -0
- package/lib/commands/tuntap.constants.js.map +1 -0
- package/lib/commands/tuntap.d.ts +83 -0
- package/lib/commands/tuntap.js +121 -0
- package/lib/commands/tuntap.js.map +1 -0
- package/lib/common/classes/command-with-filepath.d.ts +16 -0
- package/lib/common/classes/command-with-filepath.js +53 -0
- package/lib/common/classes/command-with-filepath.js.map +1 -0
- package/lib/common/classes/command-with-redirect-from-filepath-and-returned-data.d.ts +15 -0
- package/lib/common/classes/command-with-redirect-from-filepath-and-returned-data.js +45 -0
- package/lib/common/classes/command-with-redirect-from-filepath-and-returned-data.js.map +1 -0
- package/lib/common/classes/command-with-redirect-from-filepath.d.ts +16 -0
- package/lib/common/classes/command-with-redirect-from-filepath.js +53 -0
- package/lib/common/classes/command-with-redirect-from-filepath.js.map +1 -0
- package/lib/common/classes/command-with-redirect-to-filepath.d.ts +16 -0
- package/lib/common/classes/command-with-redirect-to-filepath.js +53 -0
- package/lib/common/classes/command-with-redirect-to-filepath.js.map +1 -0
- package/lib/common/classes/command-with-returned-data.d.ts +15 -0
- package/lib/common/classes/command-with-returned-data.js +45 -0
- package/lib/common/classes/command-with-returned-data.js.map +1 -0
- package/lib/common/classes/command-with-stdin.d.ts +16 -0
- package/lib/common/classes/command-with-stdin.js +53 -0
- package/lib/common/classes/command-with-stdin.js.map +1 -0
- package/lib/common/classes/command.d.ts +26 -0
- package/lib/common/classes/command.js +144 -0
- package/lib/common/classes/command.js.map +1 -0
- package/lib/common/classes/monitor-command.d.ts +30 -0
- package/lib/common/classes/monitor-command.js +108 -0
- package/lib/common/classes/monitor-command.js.map +1 -0
- package/lib/common/constants/attribute-values.d.ts +33 -0
- package/lib/common/constants/attribute-values.js +41 -0
- package/lib/common/constants/attribute-values.js.map +1 -0
- package/lib/common/constants/regexes.d.ts +34 -0
- package/lib/common/constants/regexes.js +38 -0
- package/lib/common/constants/regexes.js.map +1 -0
- package/lib/common/constants/schemas.d.ts +52 -0
- package/lib/common/constants/schemas.js +296 -0
- package/lib/common/constants/schemas.js.map +1 -0
- package/lib/common/constants/tests.d.ts +4 -0
- package/lib/common/constants/tests.js +9 -0
- package/lib/common/constants/tests.js.map +1 -0
- package/lib/common/errors/command.d.ts +11 -0
- package/lib/common/errors/command.js +20 -0
- package/lib/common/errors/command.js.map +1 -0
- package/lib/common/errors/parameters.d.ts +16 -0
- package/lib/common/errors/parameters.js +21 -0
- package/lib/common/errors/parameters.js.map +1 -0
- package/lib/common/interfaces/common.d.ts +115 -0
- package/lib/common/interfaces/common.js +3 -0
- package/lib/common/interfaces/common.js.map +1 -0
- package/lib/common/interfaces/monitor.d.ts +17 -0
- package/lib/common/interfaces/monitor.js +3 -0
- package/lib/common/interfaces/monitor.js.map +1 -0
- package/lib/common/interfaces/tests.d.ts +33 -0
- package/lib/common/interfaces/tests.js +3 -0
- package/lib/common/interfaces/tests.js.map +1 -0
- package/lib/common/misc.d.ts +4 -0
- package/lib/common/misc.js +18 -0
- package/lib/common/misc.js.map +1 -0
- package/lib/common/parse-output.d.ts +14 -0
- package/lib/common/parse-output.js +51 -0
- package/lib/common/parse-output.js.map +1 -0
- package/lib/common/validator.d.ts +3 -0
- package/lib/common/validator.js +45 -0
- package/lib/common/validator.js.map +1 -0
- package/lib/index.d.ts +400 -0
- package/lib/index.js +189 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/index.d.ts +33 -0
- package/lib/utils/index.js +40 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/ip-forwarding.constants.d.ts +21 -0
- package/lib/utils/ip-forwarding.constants.js +27 -0
- package/lib/utils/ip-forwarding.constants.js.map +1 -0
- package/lib/utils/ip-forwarding.d.ts +103 -0
- package/lib/utils/ip-forwarding.js +149 -0
- package/lib/utils/ip-forwarding.js.map +1 -0
- package/lib/utils/routing-tables.constants.d.ts +7 -0
- package/lib/utils/routing-tables.constants.js +11 -0
- package/lib/utils/routing-tables.constants.js.map +1 -0
- package/lib/utils/routing-tables.d.ts +134 -0
- package/lib/utils/routing-tables.interfaces.d.ts +16 -0
- package/lib/utils/routing-tables.interfaces.js +3 -0
- package/lib/utils/routing-tables.interfaces.js.map +1 -0
- package/lib/utils/routing-tables.js +243 -0
- package/lib/utils/routing-tables.js.map +1 -0
- package/lib/utils/routing-tables.schemas.d.ts +3 -0
- package/lib/utils/routing-tables.schemas.js +22 -0
- package/lib/utils/routing-tables.schemas.js.map +1 -0
- package/package.json +92 -0
package/lib/index.js
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.RoutePreferences = exports.route = exports.AddressFamilies = exports.AddressScopes = exports.address = exports.XdpOptionTypes = exports.BridgeSlavePortStates = exports.AddrGenMode = exports.SecureAssociationEncodings = exports.MacsecValidationModeOptions = exports.MldVersions = exports.IgmpVersions = exports.MultiCastRouterOptions = exports.HsrProtocols = exports.HsrVersions = exports.MacvlanMacvtapModes = exports.TtlSpecialValues = exports.ErspanDirections = exports.IpoIbModes = exports.IpipSipDeviceModes = exports.SecondaryUdpEncapsulations = exports.DontFragmentFlagValues = exports.VlanProtocols = exports.ExtendedLinkTypes = exports.LinkTypes = exports.link = exports.batch = exports.ParametersError = exports.CommandError = exports.colonSeparatedNumbers = exports.timeWithUnit = exports.commaSeparatedIpv6Addresses = exports.slashSeparatedNumbers = exports.slashSeparatedStrings = exports.ipWithOptionalFamilyPrefix = exports.ipWithRequiredMaskAndAllAndDefaultValues = exports.ipWithOptionalMaskAndAllAndDefaultValues = exports.ipOrAny = exports.ipWithRequiredMask = exports.ipWithOptionalMask = exports.ip = exports.ipv6 = exports.ipv4 = exports.hex4Digits = exports.mac = exports.SchemaIds = exports.EnableDisableAutoToggle = exports.EnableDisableAsStringToggle = exports.EnableDisableToggle = exports.OnOffToggle = void 0;
|
|
30
|
+
exports.MonitorCommand = exports.Command = exports.utils = exports.mroute = exports.maddress = exports.TunTapTunnelModes = exports.tuntap = exports.TunnelModes = exports.tunnel = exports.ntable = exports.NudStates = exports.neighbour = exports.addrlabel = exports.MonitorObjects = exports.monitor = exports.RuleTypes = exports.RoutingTables = exports.rule = exports.RouteTypes = exports.RoutingTableProtocols = exports.RouteRoutingTables = exports.EncapTypes = exports.EncapSeg6LocalActions = void 0;
|
|
31
|
+
// Special commands not pertaining to a specific command object.
|
|
32
|
+
const batchModule = __importStar(require("./commands/batch"));
|
|
33
|
+
exports.batch = batchModule;
|
|
34
|
+
const batch_1 = __importDefault(require("./commands/batch"));
|
|
35
|
+
// Network devices configuration.
|
|
36
|
+
const linkModule = __importStar(require("./commands/link"));
|
|
37
|
+
exports.link = linkModule;
|
|
38
|
+
const link_1 = __importDefault(require("./commands/link"));
|
|
39
|
+
// Protocol address management.
|
|
40
|
+
const addressModule = __importStar(require("./commands/address"));
|
|
41
|
+
exports.address = addressModule;
|
|
42
|
+
const address_1 = __importDefault(require("./commands/address"));
|
|
43
|
+
// Routing table management.
|
|
44
|
+
const routeModule = __importStar(require("./commands/route"));
|
|
45
|
+
exports.route = routeModule;
|
|
46
|
+
const route_1 = __importDefault(require("./commands/route"));
|
|
47
|
+
// Routing policy database (RPDB) management.
|
|
48
|
+
const ruleModule = __importStar(require("./commands/rule"));
|
|
49
|
+
exports.rule = ruleModule;
|
|
50
|
+
const rule_1 = __importDefault(require("./commands/rule"));
|
|
51
|
+
// State monitoring.
|
|
52
|
+
const monitorModule = __importStar(require("./commands/monitor"));
|
|
53
|
+
exports.monitor = monitorModule;
|
|
54
|
+
const monitor_1 = __importDefault(require("./commands/monitor"));
|
|
55
|
+
// Protocol address label management.
|
|
56
|
+
const addrlabelModule = __importStar(require("./commands/addrlabel"));
|
|
57
|
+
exports.addrlabel = addrlabelModule;
|
|
58
|
+
const addrlabel_1 = __importDefault(require("./commands/addrlabel"));
|
|
59
|
+
// Neighbour/ARP tables management.
|
|
60
|
+
const neighbourModule = __importStar(require("./commands/neighbour"));
|
|
61
|
+
exports.neighbour = neighbourModule;
|
|
62
|
+
const neighbour_1 = __importDefault(require("./commands/neighbour"));
|
|
63
|
+
// Neighbour table configuration.
|
|
64
|
+
const ntableModule = __importStar(require("./commands/ntable"));
|
|
65
|
+
exports.ntable = ntableModule;
|
|
66
|
+
const ntable_1 = __importDefault(require("./commands/ntable"));
|
|
67
|
+
// Tunnel configuration.
|
|
68
|
+
const tunnelModule = __importStar(require("./commands/tunnel"));
|
|
69
|
+
exports.tunnel = tunnelModule;
|
|
70
|
+
const tunnel_1 = __importDefault(require("./commands/tunnel"));
|
|
71
|
+
// TunTap configuration.
|
|
72
|
+
const tuntapModule = __importStar(require("./commands/tuntap"));
|
|
73
|
+
exports.tuntap = tuntapModule;
|
|
74
|
+
const tuntap_1 = __importDefault(require("./commands/tuntap"));
|
|
75
|
+
// Maddress configuration.
|
|
76
|
+
const maddressModule = __importStar(require("./commands/maddress"));
|
|
77
|
+
exports.maddress = maddressModule;
|
|
78
|
+
const maddress_1 = __importDefault(require("./commands/maddress"));
|
|
79
|
+
// Multicast routing cache management.
|
|
80
|
+
const mrouteModule = __importStar(require("./commands/mroute"));
|
|
81
|
+
exports.mroute = mrouteModule;
|
|
82
|
+
const mroute_1 = __importDefault(require("./commands/mroute"));
|
|
83
|
+
// General utilities functions to provide extra handy functionality not present in iproute.
|
|
84
|
+
const utilsModule = __importStar(require("./utils"));
|
|
85
|
+
exports.utils = utilsModule;
|
|
86
|
+
const utils_1 = __importDefault(require("./utils"));
|
|
87
|
+
// Common.
|
|
88
|
+
const command_1 = __importDefault(require("./common/classes/command"));
|
|
89
|
+
exports.Command = command_1.default;
|
|
90
|
+
const monitor_command_1 = __importDefault(require("./common/classes/monitor-command"));
|
|
91
|
+
exports.MonitorCommand = monitor_command_1.default;
|
|
92
|
+
//
|
|
93
|
+
// Common/Constants.
|
|
94
|
+
//
|
|
95
|
+
var attribute_values_1 = require("./common/constants/attribute-values");
|
|
96
|
+
Object.defineProperty(exports, "OnOffToggle", { enumerable: true, get: function () { return attribute_values_1.OnOffToggle; } });
|
|
97
|
+
Object.defineProperty(exports, "EnableDisableToggle", { enumerable: true, get: function () { return attribute_values_1.EnableDisableToggle; } });
|
|
98
|
+
Object.defineProperty(exports, "EnableDisableAsStringToggle", { enumerable: true, get: function () { return attribute_values_1.EnableDisableAsStringToggle; } });
|
|
99
|
+
Object.defineProperty(exports, "EnableDisableAutoToggle", { enumerable: true, get: function () { return attribute_values_1.EnableDisableAutoToggle; } });
|
|
100
|
+
var schemas_1 = require("./common/constants/schemas");
|
|
101
|
+
Object.defineProperty(exports, "SchemaIds", { enumerable: true, get: function () { return schemas_1.SchemaIds; } });
|
|
102
|
+
var regexes_1 = require("./common/constants/regexes");
|
|
103
|
+
Object.defineProperty(exports, "mac", { enumerable: true, get: function () { return regexes_1.mac; } });
|
|
104
|
+
Object.defineProperty(exports, "hex4Digits", { enumerable: true, get: function () { return regexes_1.hex4Digits; } });
|
|
105
|
+
Object.defineProperty(exports, "ipv4", { enumerable: true, get: function () { return regexes_1.ipv4; } });
|
|
106
|
+
Object.defineProperty(exports, "ipv6", { enumerable: true, get: function () { return regexes_1.ipv6; } });
|
|
107
|
+
Object.defineProperty(exports, "ip", { enumerable: true, get: function () { return regexes_1.ip; } });
|
|
108
|
+
Object.defineProperty(exports, "ipWithOptionalMask", { enumerable: true, get: function () { return regexes_1.ipWithOptionalMask; } });
|
|
109
|
+
Object.defineProperty(exports, "ipWithRequiredMask", { enumerable: true, get: function () { return regexes_1.ipWithRequiredMask; } });
|
|
110
|
+
Object.defineProperty(exports, "ipOrAny", { enumerable: true, get: function () { return regexes_1.ipOrAny; } });
|
|
111
|
+
Object.defineProperty(exports, "ipWithOptionalMaskAndAllAndDefaultValues", { enumerable: true, get: function () { return regexes_1.ipWithOptionalMaskAndAllAndDefaultValues; } });
|
|
112
|
+
Object.defineProperty(exports, "ipWithRequiredMaskAndAllAndDefaultValues", { enumerable: true, get: function () { return regexes_1.ipWithRequiredMaskAndAllAndDefaultValues; } });
|
|
113
|
+
Object.defineProperty(exports, "ipWithOptionalFamilyPrefix", { enumerable: true, get: function () { return regexes_1.ipWithOptionalFamilyPrefix; } });
|
|
114
|
+
Object.defineProperty(exports, "slashSeparatedStrings", { enumerable: true, get: function () { return regexes_1.slashSeparatedStrings; } });
|
|
115
|
+
Object.defineProperty(exports, "slashSeparatedNumbers", { enumerable: true, get: function () { return regexes_1.slashSeparatedNumbers; } });
|
|
116
|
+
Object.defineProperty(exports, "commaSeparatedIpv6Addresses", { enumerable: true, get: function () { return regexes_1.commaSeparatedIpv6Addresses; } });
|
|
117
|
+
Object.defineProperty(exports, "timeWithUnit", { enumerable: true, get: function () { return regexes_1.timeWithUnit; } });
|
|
118
|
+
Object.defineProperty(exports, "colonSeparatedNumbers", { enumerable: true, get: function () { return regexes_1.colonSeparatedNumbers; } });
|
|
119
|
+
//
|
|
120
|
+
// Common/Errors.
|
|
121
|
+
//
|
|
122
|
+
var command_2 = require("./common/errors/command");
|
|
123
|
+
Object.defineProperty(exports, "CommandError", { enumerable: true, get: function () { return command_2.CommandError; } });
|
|
124
|
+
var parameters_1 = require("./common/errors/parameters");
|
|
125
|
+
Object.defineProperty(exports, "ParametersError", { enumerable: true, get: function () { return parameters_1.ParametersError; } });
|
|
126
|
+
var link_constants_1 = require("./commands/link.constants");
|
|
127
|
+
Object.defineProperty(exports, "LinkTypes", { enumerable: true, get: function () { return link_constants_1.LinkTypes; } });
|
|
128
|
+
Object.defineProperty(exports, "ExtendedLinkTypes", { enumerable: true, get: function () { return link_constants_1.ExtendedLinkTypes; } });
|
|
129
|
+
Object.defineProperty(exports, "VlanProtocols", { enumerable: true, get: function () { return link_constants_1.VlanProtocols; } });
|
|
130
|
+
Object.defineProperty(exports, "DontFragmentFlagValues", { enumerable: true, get: function () { return link_constants_1.DontFragmentFlagValues; } });
|
|
131
|
+
Object.defineProperty(exports, "SecondaryUdpEncapsulations", { enumerable: true, get: function () { return link_constants_1.SecondaryUdpEncapsulations; } });
|
|
132
|
+
Object.defineProperty(exports, "IpipSipDeviceModes", { enumerable: true, get: function () { return link_constants_1.IpipSipDeviceModes; } });
|
|
133
|
+
Object.defineProperty(exports, "IpoIbModes", { enumerable: true, get: function () { return link_constants_1.IpoIbModes; } });
|
|
134
|
+
Object.defineProperty(exports, "ErspanDirections", { enumerable: true, get: function () { return link_constants_1.ErspanDirections; } });
|
|
135
|
+
Object.defineProperty(exports, "TtlSpecialValues", { enumerable: true, get: function () { return link_constants_1.TtlSpecialValues; } });
|
|
136
|
+
Object.defineProperty(exports, "MacvlanMacvtapModes", { enumerable: true, get: function () { return link_constants_1.MacvlanMacvtapModes; } });
|
|
137
|
+
Object.defineProperty(exports, "HsrVersions", { enumerable: true, get: function () { return link_constants_1.HsrVersions; } });
|
|
138
|
+
Object.defineProperty(exports, "HsrProtocols", { enumerable: true, get: function () { return link_constants_1.HsrProtocols; } });
|
|
139
|
+
Object.defineProperty(exports, "MultiCastRouterOptions", { enumerable: true, get: function () { return link_constants_1.MultiCastRouterOptions; } });
|
|
140
|
+
Object.defineProperty(exports, "IgmpVersions", { enumerable: true, get: function () { return link_constants_1.IgmpVersions; } });
|
|
141
|
+
Object.defineProperty(exports, "MldVersions", { enumerable: true, get: function () { return link_constants_1.MldVersions; } });
|
|
142
|
+
Object.defineProperty(exports, "MacsecValidationModeOptions", { enumerable: true, get: function () { return link_constants_1.MacsecValidationModeOptions; } });
|
|
143
|
+
Object.defineProperty(exports, "SecureAssociationEncodings", { enumerable: true, get: function () { return link_constants_1.SecureAssociationEncodings; } });
|
|
144
|
+
Object.defineProperty(exports, "AddrGenMode", { enumerable: true, get: function () { return link_constants_1.AddrGenMode; } });
|
|
145
|
+
Object.defineProperty(exports, "BridgeSlavePortStates", { enumerable: true, get: function () { return link_constants_1.BridgeSlavePortStates; } });
|
|
146
|
+
Object.defineProperty(exports, "XdpOptionTypes", { enumerable: true, get: function () { return link_constants_1.XdpOptionTypes; } });
|
|
147
|
+
var address_constants_1 = require("./commands/address.constants");
|
|
148
|
+
Object.defineProperty(exports, "AddressScopes", { enumerable: true, get: function () { return address_constants_1.AddressScopes; } });
|
|
149
|
+
Object.defineProperty(exports, "AddressFamilies", { enumerable: true, get: function () { return address_constants_1.AddressFamilies; } });
|
|
150
|
+
var route_constants_1 = require("./commands/route.constants");
|
|
151
|
+
Object.defineProperty(exports, "RoutePreferences", { enumerable: true, get: function () { return route_constants_1.RoutePreferences; } });
|
|
152
|
+
Object.defineProperty(exports, "EncapSeg6LocalActions", { enumerable: true, get: function () { return route_constants_1.EncapSeg6LocalActions; } });
|
|
153
|
+
Object.defineProperty(exports, "EncapTypes", { enumerable: true, get: function () { return route_constants_1.EncapTypes; } });
|
|
154
|
+
var show_constants_1 = require("./commands/route/show.constants");
|
|
155
|
+
Object.defineProperty(exports, "RouteRoutingTables", { enumerable: true, get: function () { return show_constants_1.RouteRoutingTables; } });
|
|
156
|
+
Object.defineProperty(exports, "RoutingTableProtocols", { enumerable: true, get: function () { return show_constants_1.RoutingTableProtocols; } });
|
|
157
|
+
Object.defineProperty(exports, "RouteTypes", { enumerable: true, get: function () { return show_constants_1.RouteTypes; } });
|
|
158
|
+
var rule_constants_1 = require("./commands/rule.constants");
|
|
159
|
+
Object.defineProperty(exports, "RoutingTables", { enumerable: true, get: function () { return rule_constants_1.RoutingTables; } });
|
|
160
|
+
Object.defineProperty(exports, "RuleTypes", { enumerable: true, get: function () { return rule_constants_1.RuleTypes; } });
|
|
161
|
+
var monitor_constants_1 = require("./commands/monitor.constants");
|
|
162
|
+
Object.defineProperty(exports, "MonitorObjects", { enumerable: true, get: function () { return monitor_constants_1.MonitorObjects; } });
|
|
163
|
+
var neighbour_constants_1 = require("./commands/neighbour.constants");
|
|
164
|
+
Object.defineProperty(exports, "NudStates", { enumerable: true, get: function () { return neighbour_constants_1.NudStates; } });
|
|
165
|
+
var tunnel_constants_1 = require("./commands/tunnel.constants");
|
|
166
|
+
Object.defineProperty(exports, "TunnelModes", { enumerable: true, get: function () { return tunnel_constants_1.TunnelModes; } });
|
|
167
|
+
var tuntap_constants_1 = require("./commands/tuntap.constants");
|
|
168
|
+
Object.defineProperty(exports, "TunTapTunnelModes", { enumerable: true, get: function () { return tuntap_constants_1.TunTapTunnelModes; } });
|
|
169
|
+
/** @hidden **/
|
|
170
|
+
exports.default = {
|
|
171
|
+
// Special methods not pertaining to IP commands.
|
|
172
|
+
batch: batch_1.default,
|
|
173
|
+
// IP Commands.
|
|
174
|
+
link: link_1.default,
|
|
175
|
+
address: address_1.default,
|
|
176
|
+
rule: rule_1.default,
|
|
177
|
+
route: route_1.default,
|
|
178
|
+
monitor: monitor_1.default,
|
|
179
|
+
addrlabel: addrlabel_1.default,
|
|
180
|
+
neighbour: neighbour_1.default,
|
|
181
|
+
ntable: ntable_1.default,
|
|
182
|
+
tunnel: tunnel_1.default,
|
|
183
|
+
tuntap: tuntap_1.default,
|
|
184
|
+
maddress: maddress_1.default,
|
|
185
|
+
mroute: mroute_1.default,
|
|
186
|
+
// Extras.
|
|
187
|
+
utils: utils_1.default
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAgE;AAChE,8DAAgD;AAyHxB,4BAAK;AAxH7B,6DAA6C;AAE7C,iCAAiC;AACjC,4D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U,OAAA;AA8B9D,4DAAqE;AAA5D,+GAAA,aAAa,OAAA;AAAE,2GAAA,SAAS,OAAA;AAgBjC,kEAA8D;AAArD,mHAAA,cAAc,OAAA;AA0CvB,sEAA2D;AAAlD,gHAAA,SAAS,OAAA;AAwClB,gEAAsE;AAAjD,+GAAA,WAAW,OAAA;AAiBhC,gEAAgE;AAAvD,qHAAA,iBAAiB,OAAA;AAsD1B,eAAe;AACf,kBAAe;IACb,iDAAiD;IACjD,KAAK,EAAE,eAAa;IACpB,eAAe;IACf,IAAI,EAAO,cAAY;IACvB,OAAO,EAAI,iBAAe;IAC1B,IAAI,EAAO,cAAY;IACvB,KAAK,EAAM,eAAa;IACxB,OAAO,EAAI,iBAAe;IAC1B,SAAS,EAAE,mBAAiB;IAC5B,SAAS,EAAE,mBAAiB;IAC5B,MAAM,EAAK,gBAAc;IACzB,MAAM,EAAK,gBAAc;IACzB,MAAM,EAAK,gBAAc;IACzB,QAAQ,EAAG,kBAAgB;IAC3B,MAAM,EAAK,gBAAc;IACzB,UAAU;IACV,KAAK,EAAE,eAAa;CACrB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as ipForwardingModule from './ip-forwarding';
|
|
2
|
+
import * as routingTablesModule from './routing-tables';
|
|
3
|
+
/** Manipulates IP forwarding. */
|
|
4
|
+
export { ipForwardingModule as ipForwarding };
|
|
5
|
+
/** Manipulates routing tables. */
|
|
6
|
+
export { routingTablesModule as routingTables };
|
|
7
|
+
declare const _default: {
|
|
8
|
+
ipForwarding: {
|
|
9
|
+
v4: {
|
|
10
|
+
enable: (globalOptions?: import("..").GlobalOptions) => Promise<string | null>;
|
|
11
|
+
disable: (globalOptions?: import("..").GlobalOptions) => Promise<string | null>;
|
|
12
|
+
status: (globalOptions?: import("..").GlobalOptions) => Promise<string | null>;
|
|
13
|
+
};
|
|
14
|
+
v6: {
|
|
15
|
+
enable: (globalOptions?: import("..").GlobalOptions) => Promise<string | null>;
|
|
16
|
+
disable: (globalOptions?: import("..").GlobalOptions) => Promise<string | null>;
|
|
17
|
+
status: (globalOptions?: import("..").GlobalOptions) => Promise<string | null>;
|
|
18
|
+
};
|
|
19
|
+
enable: (globalOptions?: import("..").GlobalOptions) => Promise<void>;
|
|
20
|
+
disable: (globalOptions?: import("..").GlobalOptions) => Promise<void>;
|
|
21
|
+
status: (globalOptions?: import("..").GlobalOptions) => Promise<{
|
|
22
|
+
v4: string;
|
|
23
|
+
v6: string;
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
routingTables: {
|
|
27
|
+
show: typeof routingTablesModule.show;
|
|
28
|
+
add: typeof routingTablesModule.add;
|
|
29
|
+
del: typeof routingTablesModule.del;
|
|
30
|
+
clear: typeof routingTablesModule.clear;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.routingTables = exports.ipForwarding = void 0;
|
|
30
|
+
const ipForwardingModule = __importStar(require("./ip-forwarding"));
|
|
31
|
+
exports.ipForwarding = ipForwardingModule;
|
|
32
|
+
const ip_forwarding_1 = __importDefault(require("./ip-forwarding"));
|
|
33
|
+
const routingTablesModule = __importStar(require("./routing-tables"));
|
|
34
|
+
exports.routingTables = routingTablesModule;
|
|
35
|
+
const routing_tables_1 = __importDefault(require("./routing-tables"));
|
|
36
|
+
exports.default = {
|
|
37
|
+
ipForwarding: ip_forwarding_1.default,
|
|
38
|
+
routingTables: routing_tables_1.default
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAsD;AAOvB,0CAAY;AAN3C,oEAAsD;AAEtD,sEAAwD;AAMxB,4CAAa;AAL7C,sEAAwD;AAOxD,kBAAe;IACb,YAAY,EAAG,uBAAoB;IACnC,aAAa,EAAE,wBAAqB;CACrC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sysctl actions.
|
|
3
|
+
*
|
|
4
|
+
* @category Constants
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare enum SysctlActions {
|
|
8
|
+
Enable = "enable",
|
|
9
|
+
Disable = "disable",
|
|
10
|
+
Status = "status"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Sysctl paths.
|
|
14
|
+
*
|
|
15
|
+
* @category Constants
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare enum SysctlPaths {
|
|
19
|
+
Ipv4Forwarding = "net.ipv4.ip_forward",
|
|
20
|
+
Ipv6Forwarding = "net.ipv6.conf.all.forwarding"
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SysctlPaths = exports.SysctlActions = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Sysctl actions.
|
|
6
|
+
*
|
|
7
|
+
* @category Constants
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
var SysctlActions;
|
|
11
|
+
(function (SysctlActions) {
|
|
12
|
+
SysctlActions["Enable"] = "enable";
|
|
13
|
+
SysctlActions["Disable"] = "disable";
|
|
14
|
+
SysctlActions["Status"] = "status";
|
|
15
|
+
})(SysctlActions || (exports.SysctlActions = SysctlActions = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Sysctl paths.
|
|
18
|
+
*
|
|
19
|
+
* @category Constants
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
var SysctlPaths;
|
|
23
|
+
(function (SysctlPaths) {
|
|
24
|
+
SysctlPaths["Ipv4Forwarding"] = "net.ipv4.ip_forward";
|
|
25
|
+
SysctlPaths["Ipv6Forwarding"] = "net.ipv6.conf.all.forwarding";
|
|
26
|
+
})(SysctlPaths || (exports.SysctlPaths = SysctlPaths = {}));
|
|
27
|
+
//# sourceMappingURL=ip-forwarding.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ip-forwarding.constants.js","sourceRoot":"","sources":["../../src/utils/ip-forwarding.constants.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,kCAAkB,CAAA;IAClB,oCAAmB,CAAA;IACnB,kCAAkB,CAAA;AACpB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED;;;;;GAKG;AACH,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,qDAAsC,CAAA;IACtC,8DAA+C,CAAA;AACjD,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { GlobalOptions } from '../common/interfaces/common';
|
|
2
|
+
/**
|
|
3
|
+
* Enables and checks status of IPv4 forwarding.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* ```
|
|
8
|
+
* import { utils } from 'iproutejs';
|
|
9
|
+
*
|
|
10
|
+
* await utils.ipForwarding.v4.enable();
|
|
11
|
+
* await utils.ipForwarding.v4.disable();
|
|
12
|
+
*
|
|
13
|
+
* const status = await utils.ipForwarding.v4.status();
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const v4: {
|
|
17
|
+
enable: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
18
|
+
disable: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
19
|
+
status: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Enables and checks status of IPv6 forwarding.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
*
|
|
26
|
+
* ```
|
|
27
|
+
* import { utils } from 'iproutejs';
|
|
28
|
+
*
|
|
29
|
+
* await utils.ipForwarding.v6.enable();
|
|
30
|
+
* await utils.ipForwarding.v6.disable();
|
|
31
|
+
*
|
|
32
|
+
* const status = await utils.ipForwarding.v6.status();
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const v6: {
|
|
36
|
+
enable: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
37
|
+
disable: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
38
|
+
status: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Enables both IPv4 & IPv6 IP forwarding.
|
|
42
|
+
*
|
|
43
|
+
* @param globalOptions - Global parameters options that affects the command execution.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
*
|
|
47
|
+
* ```
|
|
48
|
+
* import { utils } from 'iproutejs';
|
|
49
|
+
*
|
|
50
|
+
* await utils.ipForwarding.enable();
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare const enable: (globalOptions?: GlobalOptions) => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Disables both IPv4 & IPv6 IP forwarding.
|
|
56
|
+
*
|
|
57
|
+
* @param globalOptions - Global parameters options that affects the command execution.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
*
|
|
61
|
+
* ```
|
|
62
|
+
* import { utils } from 'iproutejs';
|
|
63
|
+
*
|
|
64
|
+
* await utils.ipForwarding.disable();
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare const disable: (globalOptions?: GlobalOptions) => Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Checks both IPv4 & IPv6 IP forwarding statuses.
|
|
70
|
+
*
|
|
71
|
+
* @param globalOptions - Global parameters options that affects the command execution.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
*
|
|
75
|
+
* ```
|
|
76
|
+
* import { utils } from 'iproutejs';
|
|
77
|
+
*
|
|
78
|
+
* const status = await utils.ipForwarding.status();
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare const status: (globalOptions?: GlobalOptions) => Promise<{
|
|
82
|
+
v4: string;
|
|
83
|
+
v6: string;
|
|
84
|
+
}>;
|
|
85
|
+
declare const _default: {
|
|
86
|
+
v4: {
|
|
87
|
+
enable: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
88
|
+
disable: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
89
|
+
status: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
90
|
+
};
|
|
91
|
+
v6: {
|
|
92
|
+
enable: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
93
|
+
disable: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
94
|
+
status: (globalOptions?: GlobalOptions) => Promise<string | null>;
|
|
95
|
+
};
|
|
96
|
+
enable: (globalOptions?: GlobalOptions) => Promise<void>;
|
|
97
|
+
disable: (globalOptions?: GlobalOptions) => Promise<void>;
|
|
98
|
+
status: (globalOptions?: GlobalOptions) => Promise<{
|
|
99
|
+
v4: string;
|
|
100
|
+
v6: string;
|
|
101
|
+
}>;
|
|
102
|
+
};
|
|
103
|
+
export default _default;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.status = exports.disable = exports.enable = exports.v6 = exports.v4 = void 0;
|
|
13
|
+
const util_1 = require("util");
|
|
14
|
+
const child_process_1 = require("child_process");
|
|
15
|
+
const ip_forwarding_constants_1 = require("./ip-forwarding.constants");
|
|
16
|
+
const command_1 = require("../common/errors/command");
|
|
17
|
+
const schemas_1 = require("../common/constants/schemas");
|
|
18
|
+
const misc_1 = require("../common/misc");
|
|
19
|
+
const promisifiedExec = (0, util_1.promisify)(child_process_1.exec);
|
|
20
|
+
function sysctl(path, action, globalOptions = {}) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
(0, misc_1.validate)(schemas_1.SchemaIds.GlobalOptions, schemas_1.GlobalOptionsSchema, globalOptions);
|
|
23
|
+
let args = ['sysctl'];
|
|
24
|
+
if (action === ip_forwarding_constants_1.SysctlActions.Enable) {
|
|
25
|
+
args = args.concat('-w', path + '=1');
|
|
26
|
+
}
|
|
27
|
+
else if (action === ip_forwarding_constants_1.SysctlActions.Disable) {
|
|
28
|
+
args = args.concat('-w', path + '=0');
|
|
29
|
+
}
|
|
30
|
+
else if (action === ip_forwarding_constants_1.SysctlActions.Status) {
|
|
31
|
+
args = args.concat('--values', path);
|
|
32
|
+
}
|
|
33
|
+
let cmdToExec = args.join(' ');
|
|
34
|
+
if (globalOptions.dryRun) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const { stdout, stderr } = yield promisifiedExec(cmdToExec);
|
|
38
|
+
if (stderr) {
|
|
39
|
+
const message = stderr.replace(/\n/g, '');
|
|
40
|
+
throw new command_1.CommandError(message, cmdToExec);
|
|
41
|
+
}
|
|
42
|
+
if (action === ip_forwarding_constants_1.SysctlActions.Status) {
|
|
43
|
+
return stdout;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Enables and checks status of IPv4 forwarding.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
*
|
|
53
|
+
* ```
|
|
54
|
+
* import { utils } from 'iproutejs';
|
|
55
|
+
*
|
|
56
|
+
* await utils.ipForwarding.v4.enable();
|
|
57
|
+
* await utils.ipForwarding.v4.disable();
|
|
58
|
+
*
|
|
59
|
+
* const status = await utils.ipForwarding.v4.status();
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
exports.v4 = {
|
|
63
|
+
enable: (globalOptions = {}) => sysctl(ip_forwarding_constants_1.SysctlPaths.Ipv4Forwarding, ip_forwarding_constants_1.SysctlActions.Enable, globalOptions),
|
|
64
|
+
disable: (globalOptions = {}) => sysctl(ip_forwarding_constants_1.SysctlPaths.Ipv4Forwarding, ip_forwarding_constants_1.SysctlActions.Disable, globalOptions),
|
|
65
|
+
status: (globalOptions = {}) => sysctl(ip_forwarding_constants_1.SysctlPaths.Ipv4Forwarding, ip_forwarding_constants_1.SysctlActions.Status, globalOptions)
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Enables and checks status of IPv6 forwarding.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
*
|
|
72
|
+
* ```
|
|
73
|
+
* import { utils } from 'iproutejs';
|
|
74
|
+
*
|
|
75
|
+
* await utils.ipForwarding.v6.enable();
|
|
76
|
+
* await utils.ipForwarding.v6.disable();
|
|
77
|
+
*
|
|
78
|
+
* const status = await utils.ipForwarding.v6.status();
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
exports.v6 = {
|
|
82
|
+
enable: (globalOptions = {}) => sysctl(ip_forwarding_constants_1.SysctlPaths.Ipv6Forwarding, ip_forwarding_constants_1.SysctlActions.Enable, globalOptions),
|
|
83
|
+
disable: (globalOptions = {}) => sysctl(ip_forwarding_constants_1.SysctlPaths.Ipv6Forwarding, ip_forwarding_constants_1.SysctlActions.Disable, globalOptions),
|
|
84
|
+
status: (globalOptions = {}) => sysctl(ip_forwarding_constants_1.SysctlPaths.Ipv6Forwarding, ip_forwarding_constants_1.SysctlActions.Status, globalOptions)
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Enables both IPv4 & IPv6 IP forwarding.
|
|
88
|
+
*
|
|
89
|
+
* @param globalOptions - Global parameters options that affects the command execution.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
*
|
|
93
|
+
* ```
|
|
94
|
+
* import { utils } from 'iproutejs';
|
|
95
|
+
*
|
|
96
|
+
* await utils.ipForwarding.enable();
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
const enable = (globalOptions = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
100
|
+
yield Promise.all([exports.v4.enable(globalOptions), exports.v6.enable(globalOptions)]);
|
|
101
|
+
});
|
|
102
|
+
exports.enable = enable;
|
|
103
|
+
/**
|
|
104
|
+
* Disables both IPv4 & IPv6 IP forwarding.
|
|
105
|
+
*
|
|
106
|
+
* @param globalOptions - Global parameters options that affects the command execution.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
*
|
|
110
|
+
* ```
|
|
111
|
+
* import { utils } from 'iproutejs';
|
|
112
|
+
*
|
|
113
|
+
* await utils.ipForwarding.disable();
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
const disable = (globalOptions = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
117
|
+
yield Promise.all([exports.v4.disable(globalOptions), exports.v6.disable(globalOptions)]);
|
|
118
|
+
});
|
|
119
|
+
exports.disable = disable;
|
|
120
|
+
/**
|
|
121
|
+
* Checks both IPv4 & IPv6 IP forwarding statuses.
|
|
122
|
+
*
|
|
123
|
+
* @param globalOptions - Global parameters options that affects the command execution.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
*
|
|
127
|
+
* ```
|
|
128
|
+
* import { utils } from 'iproutejs';
|
|
129
|
+
*
|
|
130
|
+
* const status = await utils.ipForwarding.status();
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
const status = (globalOptions = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
134
|
+
var _a, _b;
|
|
135
|
+
const results = yield Promise.all([exports.v4.status(globalOptions), exports.v6.status(globalOptions)]);
|
|
136
|
+
return {
|
|
137
|
+
v4: ((_a = results[0]) === null || _a === void 0 ? void 0 : _a.split('\n')[0]) || '',
|
|
138
|
+
v6: ((_b = results[1]) === null || _b === void 0 ? void 0 : _b.split('\n')[0]) || ''
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
exports.status = status;
|
|
142
|
+
exports.default = {
|
|
143
|
+
v4: exports.v4,
|
|
144
|
+
v6: exports.v6,
|
|
145
|
+
enable: exports.enable,
|
|
146
|
+
disable: exports.disable,
|
|
147
|
+
status: exports.status
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=ip-forwarding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ip-forwarding.js","sourceRoot":"","sources":["../../src/utils/ip-forwarding.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAAiC;AACjC,iDAA0C;AAE1C,uEAA2E;AAC3E,sDAA0E;AAE1E,yDAA6E;AAC7E,yCAAgE;AAEhE,MAAM,eAAe,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAExC,SAAe,MAAM,CAAC,IAAY,EACZ,MAAqB,EACrB,gBAA+B,EAAE;;QAErD,IAAA,eAAQ,EAAgB,mBAAS,CAAC,aAAa,EAAE,6BAAmB,EAAE,aAAa,CAAC,CAAC;QAErF,IAAI,IAAI,GAAa,CAAE,QAAQ,CAAE,CAAC;QAElC,IAAI,MAAM,KAAK,uCAAa,CAAC,MAAM,EAAE;YACnC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;SACvC;aACI,IAAI,MAAM,KAAK,uCAAa,CAAC,OAAO,EAAE;YACzC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;SACvC;aACI,IAAI,MAAM,KAAK,uCAAa,CAAC,MAAM,EAAE;YACxC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;SACtC;QAED,IAAI,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE/B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AE;IACF,MAAM,EAAN,cAAM;IACN,OAAO,EAAP,eAAO;IACP,MAAM,EAAN,cAAM;CACP,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tablesPath = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Routing table file path.
|
|
6
|
+
*
|
|
7
|
+
* @category Constants
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
exports.tablesPath = '/etc/iproute2/rt_tables';
|
|
11
|
+
//# sourceMappingURL=routing-tables.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-tables.constants.js","sourceRoot":"","sources":["../../src/utils/routing-tables.constants.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACU,QAAA,UAAU,GAAG,yBAAyB,CAAC"}
|