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.
Files changed (510) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +245 -0
  3. package/lib/commands/address/add.interfaces.d.ts +94 -0
  4. package/lib/commands/address/add.interfaces.js +3 -0
  5. package/lib/commands/address/add.interfaces.js.map +1 -0
  6. package/lib/commands/address/add.schema.d.ts +3 -0
  7. package/lib/commands/address/add.schema.js +121 -0
  8. package/lib/commands/address/add.schema.js.map +1 -0
  9. package/lib/commands/address/delete.interfaces.d.ts +56 -0
  10. package/lib/commands/address/delete.interfaces.js +3 -0
  11. package/lib/commands/address/delete.interfaces.js.map +1 -0
  12. package/lib/commands/address/delete.schema.d.ts +3 -0
  13. package/lib/commands/address/delete.schema.js +64 -0
  14. package/lib/commands/address/delete.schema.js.map +1 -0
  15. package/lib/commands/address/flush.interfaces.d.ts +89 -0
  16. package/lib/commands/address/flush.interfaces.js +3 -0
  17. package/lib/commands/address/flush.interfaces.js.map +1 -0
  18. package/lib/commands/address/flush.schema.d.ts +3 -0
  19. package/lib/commands/address/flush.schema.js +165 -0
  20. package/lib/commands/address/flush.schema.js.map +1 -0
  21. package/lib/commands/address/show.interfaces.d.ts +166 -0
  22. package/lib/commands/address/show.interfaces.js +3 -0
  23. package/lib/commands/address/show.interfaces.js.map +1 -0
  24. package/lib/commands/address/show.schema.d.ts +3 -0
  25. package/lib/commands/address/show.schema.js +176 -0
  26. package/lib/commands/address/show.schema.js.map +1 -0
  27. package/lib/commands/address.constants.d.ts +33 -0
  28. package/lib/commands/address.constants.js +39 -0
  29. package/lib/commands/address.constants.js.map +1 -0
  30. package/lib/commands/address.d.ts +179 -0
  31. package/lib/commands/address.js +265 -0
  32. package/lib/commands/address.js.map +1 -0
  33. package/lib/commands/addrlabel/add.interfaces.d.ts +12 -0
  34. package/lib/commands/addrlabel/add.interfaces.js +3 -0
  35. package/lib/commands/addrlabel/add.interfaces.js.map +1 -0
  36. package/lib/commands/addrlabel/add.schema.d.ts +3 -0
  37. package/lib/commands/addrlabel/add.schema.js +26 -0
  38. package/lib/commands/addrlabel/add.schema.js.map +1 -0
  39. package/lib/commands/addrlabel/del.interfaces.d.ts +6 -0
  40. package/lib/commands/addrlabel/del.interfaces.js +3 -0
  41. package/lib/commands/addrlabel/del.interfaces.js.map +1 -0
  42. package/lib/commands/addrlabel/del.schema.d.ts +3 -0
  43. package/lib/commands/addrlabel/del.schema.js +27 -0
  44. package/lib/commands/addrlabel/del.schema.js.map +1 -0
  45. package/lib/commands/addrlabel/list.interfaces.d.ts +9 -0
  46. package/lib/commands/addrlabel/list.interfaces.js +3 -0
  47. package/lib/commands/addrlabel/list.interfaces.js.map +1 -0
  48. package/lib/commands/addrlabel.d.ts +104 -0
  49. package/lib/commands/addrlabel.js +149 -0
  50. package/lib/commands/addrlabel.js.map +1 -0
  51. package/lib/commands/batch.d.ts +60 -0
  52. package/lib/commands/batch.js +90 -0
  53. package/lib/commands/batch.js.map +1 -0
  54. package/lib/commands/link/add.interfaces.d.ts +122 -0
  55. package/lib/commands/link/add.interfaces.js +4 -0
  56. package/lib/commands/link/add.interfaces.js.map +1 -0
  57. package/lib/commands/link/add.schema.d.ts +4 -0
  58. package/lib/commands/link/add.schema.js +172 -0
  59. package/lib/commands/link/add.schema.js.map +1 -0
  60. package/lib/commands/link/delete.interfaces.d.ts +22 -0
  61. package/lib/commands/link/delete.interfaces.js +3 -0
  62. package/lib/commands/link/delete.interfaces.js.map +1 -0
  63. package/lib/commands/link/delete.schema.d.ts +3 -0
  64. package/lib/commands/link/delete.schema.js +29 -0
  65. package/lib/commands/link/delete.schema.js.map +1 -0
  66. package/lib/commands/link/extended-virtual-link-types/bond-slave.interfaces.d.ts +8 -0
  67. package/lib/commands/link/extended-virtual-link-types/bond-slave.interfaces.js +3 -0
  68. package/lib/commands/link/extended-virtual-link-types/bond-slave.interfaces.js.map +1 -0
  69. package/lib/commands/link/extended-virtual-link-types/bond-slave.schema.d.ts +3 -0
  70. package/lib/commands/link/extended-virtual-link-types/bond-slave.schema.js +16 -0
  71. package/lib/commands/link/extended-virtual-link-types/bond-slave.schema.js.map +1 -0
  72. package/lib/commands/link/extended-virtual-link-types/bridge-slave.interfaces.d.ts +77 -0
  73. package/lib/commands/link/extended-virtual-link-types/bridge-slave.interfaces.js +3 -0
  74. package/lib/commands/link/extended-virtual-link-types/bridge-slave.interfaces.js.map +1 -0
  75. package/lib/commands/link/extended-virtual-link-types/bridge-slave.schema.d.ts +3 -0
  76. package/lib/commands/link/extended-virtual-link-types/bridge-slave.schema.js +126 -0
  77. package/lib/commands/link/extended-virtual-link-types/bridge-slave.schema.js.map +1 -0
  78. package/lib/commands/link/set.interfaces.d.ts +271 -0
  79. package/lib/commands/link/set.interfaces.js +4 -0
  80. package/lib/commands/link/set.interfaces.js.map +1 -0
  81. package/lib/commands/link/set.schema.d.ts +5 -0
  82. package/lib/commands/link/set.schema.js +284 -0
  83. package/lib/commands/link/set.schema.js.map +1 -0
  84. package/lib/commands/link/show.interfaces.d.ts +116 -0
  85. package/lib/commands/link/show.interfaces.js +3 -0
  86. package/lib/commands/link/show.interfaces.js.map +1 -0
  87. package/lib/commands/link/show.schema.d.ts +3 -0
  88. package/lib/commands/link/show.schema.js +43 -0
  89. package/lib/commands/link/show.schema.js.map +1 -0
  90. package/lib/commands/link/virtual-link-types/bareup.interfaces.d.ts +30 -0
  91. package/lib/commands/link/virtual-link-types/bareup.interfaces.js +3 -0
  92. package/lib/commands/link/virtual-link-types/bareup.interfaces.js.map +1 -0
  93. package/lib/commands/link/virtual-link-types/bareup.schema.d.ts +3 -0
  94. package/lib/commands/link/virtual-link-types/bareup.schema.js +43 -0
  95. package/lib/commands/link/virtual-link-types/bareup.schema.js.map +1 -0
  96. package/lib/commands/link/virtual-link-types/bridge.interfaces.d.ts +140 -0
  97. package/lib/commands/link/virtual-link-types/bridge.interfaces.js +3 -0
  98. package/lib/commands/link/virtual-link-types/bridge.interfaces.js.map +1 -0
  99. package/lib/commands/link/virtual-link-types/bridge.schema.d.ts +3 -0
  100. package/lib/commands/link/virtual-link-types/bridge.schema.js +186 -0
  101. package/lib/commands/link/virtual-link-types/bridge.schema.js.map +1 -0
  102. package/lib/commands/link/virtual-link-types/can.interfaces.d.ts +71 -0
  103. package/lib/commands/link/virtual-link-types/can.interfaces.js +3 -0
  104. package/lib/commands/link/virtual-link-types/can.interfaces.js.map +1 -0
  105. package/lib/commands/link/virtual-link-types/can.schema.d.ts +3 -0
  106. package/lib/commands/link/virtual-link-types/can.schema.js +141 -0
  107. package/lib/commands/link/virtual-link-types/can.schema.js.map +1 -0
  108. package/lib/commands/link/virtual-link-types/erspan-ip6erspan.interfaces.d.ts +58 -0
  109. package/lib/commands/link/virtual-link-types/erspan-ip6erspan.interfaces.js +3 -0
  110. package/lib/commands/link/virtual-link-types/erspan-ip6erspan.interfaces.js.map +1 -0
  111. package/lib/commands/link/virtual-link-types/erspan-ip6erspan.schema.d.ts +3 -0
  112. package/lib/commands/link/virtual-link-types/erspan-ip6erspan.schema.js +64 -0
  113. package/lib/commands/link/virtual-link-types/erspan-ip6erspan.schema.js.map +1 -0
  114. package/lib/commands/link/virtual-link-types/geneve.interfaces.d.ts +54 -0
  115. package/lib/commands/link/virtual-link-types/geneve.interfaces.js +3 -0
  116. package/lib/commands/link/virtual-link-types/geneve.interfaces.js.map +1 -0
  117. package/lib/commands/link/virtual-link-types/geneve.schema.d.ts +3 -0
  118. package/lib/commands/link/virtual-link-types/geneve.schema.js +93 -0
  119. package/lib/commands/link/virtual-link-types/geneve.schema.js.map +1 -0
  120. package/lib/commands/link/virtual-link-types/gre-gretap.interfaces.d.ts +106 -0
  121. package/lib/commands/link/virtual-link-types/gre-gretap.interfaces.js +3 -0
  122. package/lib/commands/link/virtual-link-types/gre-gretap.interfaces.js.map +1 -0
  123. package/lib/commands/link/virtual-link-types/gre-gretap.schema.d.ts +3 -0
  124. package/lib/commands/link/virtual-link-types/gre-gretap.schema.js +208 -0
  125. package/lib/commands/link/virtual-link-types/gre-gretap.schema.js.map +1 -0
  126. package/lib/commands/link/virtual-link-types/hsr.interfaces.d.ts +20 -0
  127. package/lib/commands/link/virtual-link-types/hsr.interfaces.js +3 -0
  128. package/lib/commands/link/virtual-link-types/hsr.interfaces.js.map +1 -0
  129. package/lib/commands/link/virtual-link-types/hsr.schema.d.ts +3 -0
  130. package/lib/commands/link/virtual-link-types/hsr.schema.js +36 -0
  131. package/lib/commands/link/virtual-link-types/hsr.schema.js.map +1 -0
  132. package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.interfaces.d.ts +80 -0
  133. package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.interfaces.js +3 -0
  134. package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.interfaces.js.map +1 -0
  135. package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.schema.d.ts +3 -0
  136. package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.schema.js +170 -0
  137. package/lib/commands/link/virtual-link-types/ip6gre-ip6gretap.schema.js.map +1 -0
  138. package/lib/commands/link/virtual-link-types/ipip-sit.interfaces.d.ts +51 -0
  139. package/lib/commands/link/virtual-link-types/ipip-sit.interfaces.js +3 -0
  140. package/lib/commands/link/virtual-link-types/ipip-sit.interfaces.js.map +1 -0
  141. package/lib/commands/link/virtual-link-types/ipip-sit.schema.d.ts +3 -0
  142. package/lib/commands/link/virtual-link-types/ipip-sit.schema.js +74 -0
  143. package/lib/commands/link/virtual-link-types/ipip-sit.schema.js.map +1 -0
  144. package/lib/commands/link/virtual-link-types/ipoib.interfaces.d.ts +11 -0
  145. package/lib/commands/link/virtual-link-types/ipoib.interfaces.js +3 -0
  146. package/lib/commands/link/virtual-link-types/ipoib.interfaces.js.map +1 -0
  147. package/lib/commands/link/virtual-link-types/ipoib.schema.d.ts +3 -0
  148. package/lib/commands/link/virtual-link-types/ipoib.schema.js +22 -0
  149. package/lib/commands/link/virtual-link-types/ipoib.schema.js.map +1 -0
  150. package/lib/commands/link/virtual-link-types/macsec.interfaces.d.ts +44 -0
  151. package/lib/commands/link/virtual-link-types/macsec.interfaces.js +3 -0
  152. package/lib/commands/link/virtual-link-types/macsec.interfaces.js.map +1 -0
  153. package/lib/commands/link/virtual-link-types/macsec.schema.d.ts +3 -0
  154. package/lib/commands/link/virtual-link-types/macsec.schema.js +87 -0
  155. package/lib/commands/link/virtual-link-types/macsec.schema.js.map +1 -0
  156. package/lib/commands/link/virtual-link-types/macvlan-macvtap.interfaces.d.ts +59 -0
  157. package/lib/commands/link/virtual-link-types/macvlan-macvtap.interfaces.js +3 -0
  158. package/lib/commands/link/virtual-link-types/macvlan-macvtap.interfaces.js.map +1 -0
  159. package/lib/commands/link/virtual-link-types/macvlan-macvtap.schema.d.ts +4 -0
  160. package/lib/commands/link/virtual-link-types/macvlan-macvtap.schema.js +60 -0
  161. package/lib/commands/link/virtual-link-types/macvlan-macvtap.schema.js.map +1 -0
  162. package/lib/commands/link/virtual-link-types/rmnet.interfaces.d.ts +8 -0
  163. package/lib/commands/link/virtual-link-types/rmnet.interfaces.js +3 -0
  164. package/lib/commands/link/virtual-link-types/rmnet.interfaces.js.map +1 -0
  165. package/lib/commands/link/virtual-link-types/rmnet.schema.d.ts +3 -0
  166. package/lib/commands/link/virtual-link-types/rmnet.schema.js +16 -0
  167. package/lib/commands/link/virtual-link-types/rmnet.schema.js.map +1 -0
  168. package/lib/commands/link/virtual-link-types/veth-vxcan.interfaces.d.ts +8 -0
  169. package/lib/commands/link/virtual-link-types/veth-vxcan.interfaces.js +3 -0
  170. package/lib/commands/link/virtual-link-types/veth-vxcan.interfaces.js.map +1 -0
  171. package/lib/commands/link/virtual-link-types/veth-vxcan.schema.d.ts +3 -0
  172. package/lib/commands/link/virtual-link-types/veth-vxcan.schema.js +16 -0
  173. package/lib/commands/link/virtual-link-types/veth-vxcan.schema.js.map +1 -0
  174. package/lib/commands/link/virtual-link-types/vlan.interfaces.d.ts +36 -0
  175. package/lib/commands/link/virtual-link-types/vlan.interfaces.js +3 -0
  176. package/lib/commands/link/virtual-link-types/vlan.interfaces.js.map +1 -0
  177. package/lib/commands/link/virtual-link-types/vlan.schema.d.ts +3 -0
  178. package/lib/commands/link/virtual-link-types/vlan.schema.js +65 -0
  179. package/lib/commands/link/virtual-link-types/vlan.schema.js.map +1 -0
  180. package/lib/commands/link/virtual-link-types/vrf.interfaces.d.ts +8 -0
  181. package/lib/commands/link/virtual-link-types/vrf.interfaces.js +3 -0
  182. package/lib/commands/link/virtual-link-types/vrf.interfaces.js.map +1 -0
  183. package/lib/commands/link/virtual-link-types/vrf.schema.d.ts +3 -0
  184. package/lib/commands/link/virtual-link-types/vrf.schema.js +16 -0
  185. package/lib/commands/link/virtual-link-types/vrf.schema.js.map +1 -0
  186. package/lib/commands/link/virtual-link-types/vxlan.interfaces.d.ts +127 -0
  187. package/lib/commands/link/virtual-link-types/vxlan.interfaces.js +3 -0
  188. package/lib/commands/link/virtual-link-types/vxlan.interfaces.js.map +1 -0
  189. package/lib/commands/link/virtual-link-types/vxlan.schema.d.ts +3 -0
  190. package/lib/commands/link/virtual-link-types/vxlan.schema.js +176 -0
  191. package/lib/commands/link/virtual-link-types/vxlan.schema.js.map +1 -0
  192. package/lib/commands/link/virtual-link-types/xfrm.interfaces.d.ts +16 -0
  193. package/lib/commands/link/virtual-link-types/xfrm.interfaces.js +3 -0
  194. package/lib/commands/link/virtual-link-types/xfrm.interfaces.js.map +1 -0
  195. package/lib/commands/link/virtual-link-types/xfrm.schema.d.ts +3 -0
  196. package/lib/commands/link/virtual-link-types/xfrm.schema.js +21 -0
  197. package/lib/commands/link/virtual-link-types/xfrm.schema.js.map +1 -0
  198. package/lib/commands/link/xdp-options/object.interfaces.d.ts +36 -0
  199. package/lib/commands/link/xdp-options/object.interfaces.js +3 -0
  200. package/lib/commands/link/xdp-options/object.interfaces.js.map +1 -0
  201. package/lib/commands/link/xdp-options/object.schema.d.ts +3 -0
  202. package/lib/commands/link/xdp-options/object.schema.js +25 -0
  203. package/lib/commands/link/xdp-options/object.schema.js.map +1 -0
  204. package/lib/commands/link/xdp-options/off.interfaces.d.ts +8 -0
  205. package/lib/commands/link/xdp-options/off.interfaces.js +3 -0
  206. package/lib/commands/link/xdp-options/off.interfaces.js.map +1 -0
  207. package/lib/commands/link/xdp-options/off.schema.d.ts +3 -0
  208. package/lib/commands/link/xdp-options/off.schema.js +15 -0
  209. package/lib/commands/link/xdp-options/off.schema.js.map +1 -0
  210. package/lib/commands/link/xdp-options/pinned.interfaces.d.ts +13 -0
  211. package/lib/commands/link/xdp-options/pinned.interfaces.js +3 -0
  212. package/lib/commands/link/xdp-options/pinned.interfaces.js.map +1 -0
  213. package/lib/commands/link/xdp-options/pinned.schema.d.ts +3 -0
  214. package/lib/commands/link/xdp-options/pinned.schema.js +15 -0
  215. package/lib/commands/link/xdp-options/pinned.schema.js.map +1 -0
  216. package/lib/commands/link.constants.d.ts +425 -0
  217. package/lib/commands/link.constants.js +366 -0
  218. package/lib/commands/link.constants.js.map +1 -0
  219. package/lib/commands/link.d.ts +113 -0
  220. package/lib/commands/link.js +159 -0
  221. package/lib/commands/link.js.map +1 -0
  222. package/lib/commands/maddress/add.interfaces.d.ts +10 -0
  223. package/lib/commands/maddress/add.interfaces.js +3 -0
  224. package/lib/commands/maddress/add.interfaces.js.map +1 -0
  225. package/lib/commands/maddress/add.schema.d.ts +3 -0
  226. package/lib/commands/maddress/add.schema.js +22 -0
  227. package/lib/commands/maddress/add.schema.js.map +1 -0
  228. package/lib/commands/maddress/show.interfaces.d.ts +25 -0
  229. package/lib/commands/maddress/show.interfaces.js +3 -0
  230. package/lib/commands/maddress/show.interfaces.js.map +1 -0
  231. package/lib/commands/maddress/show.schema.d.ts +3 -0
  232. package/lib/commands/maddress/show.schema.js +17 -0
  233. package/lib/commands/maddress/show.schema.js.map +1 -0
  234. package/lib/commands/maddress.d.ts +82 -0
  235. package/lib/commands/maddress.js +121 -0
  236. package/lib/commands/maddress.js.map +1 -0
  237. package/lib/commands/monitor/monitor.interfaces.d.ts +24 -0
  238. package/lib/commands/monitor/monitor.interfaces.js +3 -0
  239. package/lib/commands/monitor/monitor.interfaces.js.map +1 -0
  240. package/lib/commands/monitor/monitor.schema.d.ts +3 -0
  241. package/lib/commands/monitor/monitor.schema.js +33 -0
  242. package/lib/commands/monitor/monitor.schema.js.map +1 -0
  243. package/lib/commands/monitor.constants.d.ts +17 -0
  244. package/lib/commands/monitor.constants.js +22 -0
  245. package/lib/commands/monitor.constants.js.map +1 -0
  246. package/lib/commands/monitor.d.ts +52 -0
  247. package/lib/commands/monitor.js +75 -0
  248. package/lib/commands/monitor.js.map +1 -0
  249. package/lib/commands/mroute/show.interfaces.d.ts +26 -0
  250. package/lib/commands/mroute/show.interfaces.js +3 -0
  251. package/lib/commands/mroute/show.interfaces.js.map +1 -0
  252. package/lib/commands/mroute/show.schema.d.ts +3 -0
  253. package/lib/commands/mroute/show.schema.js +44 -0
  254. package/lib/commands/mroute/show.schema.js.map +1 -0
  255. package/lib/commands/mroute.d.ts +29 -0
  256. package/lib/commands/mroute.js +53 -0
  257. package/lib/commands/mroute.js.map +1 -0
  258. package/lib/commands/neighbour/add.interfaces.d.ts +34 -0
  259. package/lib/commands/neighbour/add.interfaces.js +3 -0
  260. package/lib/commands/neighbour/add.interfaces.js.map +1 -0
  261. package/lib/commands/neighbour/add.schema.d.ts +3 -0
  262. package/lib/commands/neighbour/add.schema.js +49 -0
  263. package/lib/commands/neighbour/add.schema.js.map +1 -0
  264. package/lib/commands/neighbour/del.interfaces.d.ts +23 -0
  265. package/lib/commands/neighbour/del.interfaces.js +3 -0
  266. package/lib/commands/neighbour/del.interfaces.js.map +1 -0
  267. package/lib/commands/neighbour/del.schema.d.ts +3 -0
  268. package/lib/commands/neighbour/del.schema.js +37 -0
  269. package/lib/commands/neighbour/del.schema.js.map +1 -0
  270. package/lib/commands/neighbour/get.interfaces.d.ts +12 -0
  271. package/lib/commands/neighbour/get.interfaces.js +3 -0
  272. package/lib/commands/neighbour/get.interfaces.js.map +1 -0
  273. package/lib/commands/neighbour/get.schema.d.ts +3 -0
  274. package/lib/commands/neighbour/get.schema.js +26 -0
  275. package/lib/commands/neighbour/get.schema.js.map +1 -0
  276. package/lib/commands/neighbour/show.interfaces.d.ts +37 -0
  277. package/lib/commands/neighbour/show.interfaces.js +3 -0
  278. package/lib/commands/neighbour/show.interfaces.js.map +1 -0
  279. package/lib/commands/neighbour/show.schema.d.ts +3 -0
  280. package/lib/commands/neighbour/show.schema.js +39 -0
  281. package/lib/commands/neighbour/show.schema.js.map +1 -0
  282. package/lib/commands/neighbour.constants.d.ts +34 -0
  283. package/lib/commands/neighbour.constants.js +39 -0
  284. package/lib/commands/neighbour.constants.js.map +1 -0
  285. package/lib/commands/neighbour.d.ts +169 -0
  286. package/lib/commands/neighbour.js +238 -0
  287. package/lib/commands/neighbour.js.map +1 -0
  288. package/lib/commands/ntable/change.interfaces.d.ts +42 -0
  289. package/lib/commands/ntable/change.interfaces.js +3 -0
  290. package/lib/commands/ntable/change.interfaces.js.map +1 -0
  291. package/lib/commands/ntable/change.schema.d.ts +3 -0
  292. package/lib/commands/ntable/change.schema.js +101 -0
  293. package/lib/commands/ntable/change.schema.js.map +1 -0
  294. package/lib/commands/ntable/show.interfaces.d.ts +59 -0
  295. package/lib/commands/ntable/show.interfaces.js +3 -0
  296. package/lib/commands/ntable/show.interfaces.js.map +1 -0
  297. package/lib/commands/ntable/show.schema.d.ts +3 -0
  298. package/lib/commands/ntable/show.schema.js +22 -0
  299. package/lib/commands/ntable/show.schema.js.map +1 -0
  300. package/lib/commands/ntable.d.ts +43 -0
  301. package/lib/commands/ntable.js +75 -0
  302. package/lib/commands/ntable.js.map +1 -0
  303. package/lib/commands/route/add.interfaces.d.ts +261 -0
  304. package/lib/commands/route/add.interfaces.js +4 -0
  305. package/lib/commands/route/add.interfaces.js.map +1 -0
  306. package/lib/commands/route/add.schema.d.ts +3 -0
  307. package/lib/commands/route/add.schema.js +366 -0
  308. package/lib/commands/route/add.schema.js.map +1 -0
  309. package/lib/commands/route/encap-types/bpf.interfaces.d.ts +14 -0
  310. package/lib/commands/route/encap-types/bpf.interfaces.js +3 -0
  311. package/lib/commands/route/encap-types/bpf.interfaces.js.map +1 -0
  312. package/lib/commands/route/encap-types/bpf.schema.d.ts +3 -0
  313. package/lib/commands/route/encap-types/bpf.schema.js +31 -0
  314. package/lib/commands/route/encap-types/bpf.schema.js.map +1 -0
  315. package/lib/commands/route/encap-types/ioam6.interfaces.d.ts +19 -0
  316. package/lib/commands/route/encap-types/ioam6.interfaces.js +3 -0
  317. package/lib/commands/route/encap-types/ioam6.interfaces.js.map +1 -0
  318. package/lib/commands/route/encap-types/ioam6.schema.d.ts +3 -0
  319. package/lib/commands/route/encap-types/ioam6.schema.js +30 -0
  320. package/lib/commands/route/encap-types/ioam6.schema.js.map +1 -0
  321. package/lib/commands/route/encap-types/ip.interfaces.d.ts +17 -0
  322. package/lib/commands/route/encap-types/ip.interfaces.js +3 -0
  323. package/lib/commands/route/encap-types/ip.interfaces.js.map +1 -0
  324. package/lib/commands/route/encap-types/ip.schema.d.ts +3 -0
  325. package/lib/commands/route/encap-types/ip.schema.js +48 -0
  326. package/lib/commands/route/encap-types/ip.schema.js.map +1 -0
  327. package/lib/commands/route/encap-types/mpls.interfaces.d.ts +11 -0
  328. package/lib/commands/route/encap-types/mpls.interfaces.js +3 -0
  329. package/lib/commands/route/encap-types/mpls.interfaces.js.map +1 -0
  330. package/lib/commands/route/encap-types/mpls.schema.d.ts +3 -0
  331. package/lib/commands/route/encap-types/mpls.schema.js +46 -0
  332. package/lib/commands/route/encap-types/mpls.schema.js.map +1 -0
  333. package/lib/commands/route/encap-types/seg6.interfaces.d.ts +20 -0
  334. package/lib/commands/route/encap-types/seg6.interfaces.js +3 -0
  335. package/lib/commands/route/encap-types/seg6.interfaces.js.map +1 -0
  336. package/lib/commands/route/encap-types/seg6.schema.d.ts +3 -0
  337. package/lib/commands/route/encap-types/seg6.schema.js +38 -0
  338. package/lib/commands/route/encap-types/seg6.schema.js.map +1 -0
  339. package/lib/commands/route/encap-types/seg6local.interfaces.d.ts +76 -0
  340. package/lib/commands/route/encap-types/seg6local.interfaces.js +3 -0
  341. package/lib/commands/route/encap-types/seg6local.interfaces.js.map +1 -0
  342. package/lib/commands/route/encap-types/seg6local.schema.d.ts +6 -0
  343. package/lib/commands/route/encap-types/seg6local.schema.js +181 -0
  344. package/lib/commands/route/encap-types/seg6local.schema.js.map +1 -0
  345. package/lib/commands/route/get.interfaces.d.ts +37 -0
  346. package/lib/commands/route/get.interfaces.js +3 -0
  347. package/lib/commands/route/get.interfaces.js.map +1 -0
  348. package/lib/commands/route/get.schema.d.ts +3 -0
  349. package/lib/commands/route/get.schema.js +86 -0
  350. package/lib/commands/route/get.schema.js.map +1 -0
  351. package/lib/commands/route/show.constants.d.ts +105 -0
  352. package/lib/commands/route/show.constants.js +112 -0
  353. package/lib/commands/route/show.constants.js.map +1 -0
  354. package/lib/commands/route/show.interfaces.d.ts +96 -0
  355. package/lib/commands/route/show.interfaces.js +3 -0
  356. package/lib/commands/route/show.interfaces.js.map +1 -0
  357. package/lib/commands/route/show.schema.d.ts +3 -0
  358. package/lib/commands/route/show.schema.js +161 -0
  359. package/lib/commands/route/show.schema.js.map +1 -0
  360. package/lib/commands/route.constants.d.ts +129 -0
  361. package/lib/commands/route.constants.js +136 -0
  362. package/lib/commands/route.constants.js.map +1 -0
  363. package/lib/commands/route.d.ts +268 -0
  364. package/lib/commands/route.js +362 -0
  365. package/lib/commands/route.js.map +1 -0
  366. package/lib/commands/rule/add.interfaces.d.ts +41 -0
  367. package/lib/commands/rule/add.interfaces.js +3 -0
  368. package/lib/commands/rule/add.interfaces.js.map +1 -0
  369. package/lib/commands/rule/add.schema.d.ts +3 -0
  370. package/lib/commands/rule/add.schema.js +182 -0
  371. package/lib/commands/rule/add.schema.js.map +1 -0
  372. package/lib/commands/rule/show.interfaces.d.ts +86 -0
  373. package/lib/commands/rule/show.interfaces.js +3 -0
  374. package/lib/commands/rule/show.interfaces.js.map +1 -0
  375. package/lib/commands/rule/show.schema.d.ts +3 -0
  376. package/lib/commands/rule/show.schema.js +157 -0
  377. package/lib/commands/rule/show.schema.js.map +1 -0
  378. package/lib/commands/rule.constants.d.ts +34 -0
  379. package/lib/commands/rule.constants.js +40 -0
  380. package/lib/commands/rule.constants.js.map +1 -0
  381. package/lib/commands/rule.d.ts +143 -0
  382. package/lib/commands/rule.js +205 -0
  383. package/lib/commands/rule.js.map +1 -0
  384. package/lib/commands/tunnel/6rd.interfaces.d.ts +17 -0
  385. package/lib/commands/tunnel/6rd.interfaces.js +3 -0
  386. package/lib/commands/tunnel/6rd.interfaces.js.map +1 -0
  387. package/lib/commands/tunnel/6rd.schema.d.ts +3 -0
  388. package/lib/commands/tunnel/6rd.schema.js +33 -0
  389. package/lib/commands/tunnel/6rd.schema.js.map +1 -0
  390. package/lib/commands/tunnel/add.interfaces.d.ts +124 -0
  391. package/lib/commands/tunnel/add.interfaces.js +3 -0
  392. package/lib/commands/tunnel/add.interfaces.js.map +1 -0
  393. package/lib/commands/tunnel/add.schema.d.ts +3 -0
  394. package/lib/commands/tunnel/add.schema.js +213 -0
  395. package/lib/commands/tunnel/add.schema.js.map +1 -0
  396. package/lib/commands/tunnel/prl.interfaces.d.ts +17 -0
  397. package/lib/commands/tunnel/prl.interfaces.js +3 -0
  398. package/lib/commands/tunnel/prl.interfaces.js.map +1 -0
  399. package/lib/commands/tunnel/prl.schema.d.ts +3 -0
  400. package/lib/commands/tunnel/prl.schema.js +34 -0
  401. package/lib/commands/tunnel/prl.schema.js.map +1 -0
  402. package/lib/commands/tunnel.constants.d.ts +23 -0
  403. package/lib/commands/tunnel.constants.js +24 -0
  404. package/lib/commands/tunnel.constants.js.map +1 -0
  405. package/lib/commands/tunnel.d.ts +151 -0
  406. package/lib/commands/tunnel.js +210 -0
  407. package/lib/commands/tunnel.js.map +1 -0
  408. package/lib/commands/tuntap/add.interfaces.d.ts +25 -0
  409. package/lib/commands/tuntap/add.interfaces.js +3 -0
  410. package/lib/commands/tuntap/add.interfaces.js.map +1 -0
  411. package/lib/commands/tuntap/add.schema.d.ts +3 -0
  412. package/lib/commands/tuntap/add.schema.js +77 -0
  413. package/lib/commands/tuntap/add.schema.js.map +1 -0
  414. package/lib/commands/tuntap/show.interfaces.d.ts +17 -0
  415. package/lib/commands/tuntap/show.interfaces.js +3 -0
  416. package/lib/commands/tuntap/show.interfaces.js.map +1 -0
  417. package/lib/commands/tuntap/show.schema.d.ts +3 -0
  418. package/lib/commands/tuntap/show.schema.js +80 -0
  419. package/lib/commands/tuntap/show.schema.js.map +1 -0
  420. package/lib/commands/tuntap.constants.d.ts +8 -0
  421. package/lib/commands/tuntap.constants.js +13 -0
  422. package/lib/commands/tuntap.constants.js.map +1 -0
  423. package/lib/commands/tuntap.d.ts +83 -0
  424. package/lib/commands/tuntap.js +121 -0
  425. package/lib/commands/tuntap.js.map +1 -0
  426. package/lib/common/classes/command-with-filepath.d.ts +16 -0
  427. package/lib/common/classes/command-with-filepath.js +53 -0
  428. package/lib/common/classes/command-with-filepath.js.map +1 -0
  429. package/lib/common/classes/command-with-redirect-from-filepath-and-returned-data.d.ts +15 -0
  430. package/lib/common/classes/command-with-redirect-from-filepath-and-returned-data.js +45 -0
  431. package/lib/common/classes/command-with-redirect-from-filepath-and-returned-data.js.map +1 -0
  432. package/lib/common/classes/command-with-redirect-from-filepath.d.ts +16 -0
  433. package/lib/common/classes/command-with-redirect-from-filepath.js +53 -0
  434. package/lib/common/classes/command-with-redirect-from-filepath.js.map +1 -0
  435. package/lib/common/classes/command-with-redirect-to-filepath.d.ts +16 -0
  436. package/lib/common/classes/command-with-redirect-to-filepath.js +53 -0
  437. package/lib/common/classes/command-with-redirect-to-filepath.js.map +1 -0
  438. package/lib/common/classes/command-with-returned-data.d.ts +15 -0
  439. package/lib/common/classes/command-with-returned-data.js +45 -0
  440. package/lib/common/classes/command-with-returned-data.js.map +1 -0
  441. package/lib/common/classes/command-with-stdin.d.ts +16 -0
  442. package/lib/common/classes/command-with-stdin.js +53 -0
  443. package/lib/common/classes/command-with-stdin.js.map +1 -0
  444. package/lib/common/classes/command.d.ts +26 -0
  445. package/lib/common/classes/command.js +144 -0
  446. package/lib/common/classes/command.js.map +1 -0
  447. package/lib/common/classes/monitor-command.d.ts +30 -0
  448. package/lib/common/classes/monitor-command.js +108 -0
  449. package/lib/common/classes/monitor-command.js.map +1 -0
  450. package/lib/common/constants/attribute-values.d.ts +33 -0
  451. package/lib/common/constants/attribute-values.js +41 -0
  452. package/lib/common/constants/attribute-values.js.map +1 -0
  453. package/lib/common/constants/regexes.d.ts +34 -0
  454. package/lib/common/constants/regexes.js +38 -0
  455. package/lib/common/constants/regexes.js.map +1 -0
  456. package/lib/common/constants/schemas.d.ts +52 -0
  457. package/lib/common/constants/schemas.js +296 -0
  458. package/lib/common/constants/schemas.js.map +1 -0
  459. package/lib/common/constants/tests.d.ts +4 -0
  460. package/lib/common/constants/tests.js +9 -0
  461. package/lib/common/constants/tests.js.map +1 -0
  462. package/lib/common/errors/command.d.ts +11 -0
  463. package/lib/common/errors/command.js +20 -0
  464. package/lib/common/errors/command.js.map +1 -0
  465. package/lib/common/errors/parameters.d.ts +16 -0
  466. package/lib/common/errors/parameters.js +21 -0
  467. package/lib/common/errors/parameters.js.map +1 -0
  468. package/lib/common/interfaces/common.d.ts +115 -0
  469. package/lib/common/interfaces/common.js +3 -0
  470. package/lib/common/interfaces/common.js.map +1 -0
  471. package/lib/common/interfaces/monitor.d.ts +17 -0
  472. package/lib/common/interfaces/monitor.js +3 -0
  473. package/lib/common/interfaces/monitor.js.map +1 -0
  474. package/lib/common/interfaces/tests.d.ts +33 -0
  475. package/lib/common/interfaces/tests.js +3 -0
  476. package/lib/common/interfaces/tests.js.map +1 -0
  477. package/lib/common/misc.d.ts +4 -0
  478. package/lib/common/misc.js +18 -0
  479. package/lib/common/misc.js.map +1 -0
  480. package/lib/common/parse-output.d.ts +14 -0
  481. package/lib/common/parse-output.js +51 -0
  482. package/lib/common/parse-output.js.map +1 -0
  483. package/lib/common/validator.d.ts +3 -0
  484. package/lib/common/validator.js +45 -0
  485. package/lib/common/validator.js.map +1 -0
  486. package/lib/index.d.ts +400 -0
  487. package/lib/index.js +189 -0
  488. package/lib/index.js.map +1 -0
  489. package/lib/utils/index.d.ts +33 -0
  490. package/lib/utils/index.js +40 -0
  491. package/lib/utils/index.js.map +1 -0
  492. package/lib/utils/ip-forwarding.constants.d.ts +21 -0
  493. package/lib/utils/ip-forwarding.constants.js +27 -0
  494. package/lib/utils/ip-forwarding.constants.js.map +1 -0
  495. package/lib/utils/ip-forwarding.d.ts +103 -0
  496. package/lib/utils/ip-forwarding.js +149 -0
  497. package/lib/utils/ip-forwarding.js.map +1 -0
  498. package/lib/utils/routing-tables.constants.d.ts +7 -0
  499. package/lib/utils/routing-tables.constants.js +11 -0
  500. package/lib/utils/routing-tables.constants.js.map +1 -0
  501. package/lib/utils/routing-tables.d.ts +134 -0
  502. package/lib/utils/routing-tables.interfaces.d.ts +16 -0
  503. package/lib/utils/routing-tables.interfaces.js +3 -0
  504. package/lib/utils/routing-tables.interfaces.js.map +1 -0
  505. package/lib/utils/routing-tables.js +243 -0
  506. package/lib/utils/routing-tables.js.map +1 -0
  507. package/lib/utils/routing-tables.schemas.d.ts +3 -0
  508. package/lib/utils/routing-tables.schemas.js +22 -0
  509. package/lib/utils/routing-tables.schemas.js.map +1 -0
  510. 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
@@ -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,4DAA8C;AAkIvB,0BAAI;AAjI3B,2DAA2C;AAE3C,+BAA+B;AAC/B,kEAAoD;AA+M1B,gCAAO;AA9MjC,iEAAiD;AAEjD,4BAA4B;AAC5B,8DAAgD;AAoOxB,4BAAK;AAnO7B,6DAA6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AwClB,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;A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AAE,UAAE,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,UAAE,CAAC,OAAO,CAAC,aAAa,CAAC,CAAE,CAAC,CAAC;AAC9E,CAAC,CAAA,CAAC;AAFW,QAAA,OAAO,WAElB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,MAAM,GAAG,CAAO,gBAA+B,EAAE,EAAuC,EAAE;;IACrG,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAE,UAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,UAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAE,CAAC,CAAC;IAC1F,OAAO;QACL,EAAE,EAAE,CAAA,MAAA,OAAO,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,KAAI,EAAE;QACpC,EAAE,EAAE,CAAA,MAAA,OAAO,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,KAAI,EAAE;KACrC,CAAC;AACJ,CAAC,CAAA,CAAC;AANW,QAAA,MAAM,UAMjB;AAEF,kBAAe;IACb,EAAE,EAAF,UAAE;IACF,EAAE,EAAF,UAAE;IACF,MAAM,EAAN,cAAM;IACN,OAAO,EAAP,eAAO;IACP,MAAM,EAAN,cAAM;CACP,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Routing table file path.
3
+ *
4
+ * @category Constants
5
+ * @internal
6
+ */
7
+ export declare const tablesPath = "/etc/iproute2/rt_tables";
@@ -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"}