YMC-GitHub / sh-lib-nw-fun

some function for caculating network for ymc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sh lib nw-fun

desc

some function for caculating network for ymc

deps

  • sh-lib-str
  • sh-lib-arr
  • sh-lib-txt
  • sh-lib-time-cost
  • sh-lib-path-resolve
  • sh-lib-num-base-bc
  • sh-lib-test
  • sh-lib-fun

apis

  • nw_cidr_to_mask
  • nw_cidr_from_mask
  • nw_cidr_to_host_bits
  • nw_cidr_from_host_bits
  • nw_mask_ini
  • nw_mask_cimi_sum
  • nw_mask_from_cidr
  • nw_mask_to_cidr
  • nw_mask_get
  • nw_mask_add
  • nw_mask_del
  • nw_mask_is
  • nw_mask_type_is
  • nw_ip_get
  • nw_ip_add
  • nw_ip_del
  • nw_ip_is
  • nw_ip_type_is
  • nw_ip_private_is
  • nw_ip_addr_broad_from_net
  • nw_ip_addr_net_from_host
  • nw_ip_addr_hostid
  • nw_ip_format_to_bin
  • nw_ip_addr_net_to_cidr
  • nw_sub_num_to_bits
  • nw_sub_bits_to_num
  • nw_sub_bits_to_mask
  • nw_sub_mask_to_bits
  • nw_sub_bits_to_cidr
  • nw_sub_cidr_to_bits
  • nw_sub_host_bits_to_num
  • nw_sub_host_num_to_bits
  • nw_sub_host_bits_to_cidr
  • nw_sub_host_cidr_to_bits
  • nw_sub_know_from_list
  • nw_sub_know_set
  • nw_sub_know_get
  • nw_sup_know_from_list
  • nw_sup_know_set
  • nw_sup_know_get
src/dev.api.sh

feat

  • basic operation for cidr
  • basic operation for mask
  • basic operation for sub
  • basic operation for sup
  • apis begins with ns nw/sup/sub/mask/cidr

how to use for poduction?

# get the code

# run the index file
# ./index.sh

# or import to your sh file
# source /path/to/the/index file

# simple usage

how to use for developer?

# get the code

# run test
# test file is ./src/test*.sh
# eg.
./test/index.sh
#2 get some fail test
#./src/test.sh | grep "it is false"

author

yemiancheng ymc.github@gmail.com

license

MIT

About

some function for caculating network for ymc

License:MIT License


Languages

Language:Shell 100.0%