nettool(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– nettool β€” the manual page, but make it cute πŸ’–

okay bestie, welcome to nettool(n), no cap. this is the one. 🌸


✨ NAME ✨

nettool β€” Tools for networked applications πŸ¦‹


✨ SYNOPSIS ✨

package require Tcl 8.5 9

package require nettool ?0.5.4?

package require twapi 3.1

package require ip 0.2

package require platform 0.2

::cat filename

::nettool::allocate_port startingport

::nettool::arp_table

::nettool::broadcast_list

::nettool::claim_port port ?protocol?

::nettool::cpuinfo args

::nettool::find_port startingport

::nettool::hwid_list

::nettool::ip_list

::nettool::mac_list

::nettool::network_list

::nettool::port_busy port

::nettool::release_port port ?protocol?

::nettool::status

::nettool::user_data_root appname

✨ DESCRIPTION ✨

so the nettool package is literally a Pure-tcl set of tools for doing the common network things that usually make you go install five different packages or call exec like a menace. it gives you all of that through a standard Tcl interface instead. πŸ’…

and rn, nettool has reference implementations for these operating systems:

  • Windows
  • MacOSX
  • Linux (debian)

periodt. πŸŽ€


✨ COMMANDS ✨

  • ::cat filename β€” dumps the contents of a file as a result. that's it, that's the whole vibe. πŸ“
  • ::nettool::allocate_port startingport β€” tries to allocate startingport, and if it's busy it just keeps advancing the port number sequentially until it finds a free one, then claims that port. it checks a built-in database of known ports so it doesn't hand you something that's already in common use (like, for example: http (80)). not me protecting you from yourself, iconic. πŸ‘‘
  • ::nettool::arp_table β€” dumps the contents of this computer's Address Resolution Protocol (ARP) table. the result comes back as a Tcl formatted list: macid ipaddrlist ... ✨
  • ::nettool::broadcast_list β€” returns a list of broadcast addresses (suitable for UDP multicast) that this computer is associated with. 🌈
  • ::nettool::claim_port port ?protocol? β€” marks port as busy, optionally as either tcp (that's the default, bestie) or udp. 🫢
  • ::nettool::cpuinfo args β€” if you give it no arguments, you get back a key/value list describing the CPU of the present machine. in that matrix you'll find info on the number of cores/processors available for parallel tasking, installed physical RAM, and processor family. the exact contents are platform specific, lowkey:
    • for Linux, the info is drawn from /proc/cpuinfo and /proc/meminfo.
    • for MacOSX, the info is drawn from sysctl.
    • for Windows, the info is drawn from TWAPI.
    • if you do give arguments, the result will be a key/value list limited to just the fields you asked for.

canonical fields for all platforms:

  • cpus β€” count of CPUs/cores/execution units
  • speed β€” clock speed of processor(s) in Mhz
  • memory β€” installed RAM (in MB)
  • vendor β€” manufacturer
  • ::nettool::find_port startingport β€” returns startingport if it's available, or the next free port after startingport. > Note: unlike ::nettool::allocate_port, this command does not claim the port. it's just looking, not touching. πŸ™ˆ

this command uses a built-in database of known ports to avoid returning a port which is in common use. (for example: http (80)) πŸ”₯

  • ::nettool::hwid_list β€” returns a list of hardware specific identifiers from this computer. the source and content will vary by platform:
    • for MacOSX, the motherboard serial number and macids for all network devices is returned.
    • for Windows, the volume serial number of C and macids for all network devices is returned.
    • for Linux, macids for all network devices is returned.
  • ::nettool::ip_list β€” returns a list of IP addresses associated with this computer. ⭐
  • ::nettool::mac_list β€” returns a list of MACIDs for the network cards attached to this machine. the MACID of the primary network card comes back first, main character energy fr fr. πŸ‘‘
  • ::nettool::network_list β€” returns a list of networks associated with this computer. networks are formated with ip::nativeToPrefix. πŸ’œ
  • ::nettool::port_busy port β€” returns true if port is claimed, false otherwise. vibe check complete. ✨
  • ::nettool::release_port port ?protocol? β€” marks port as not busy, optionally as either tcp (default) or udp. freeing her. πŸ¦‹
  • ::nettool::status β€” returns a key/value list describing the status of the computer. the output is designed to be comparable to the output of top for all platforms. 🌸

common fields include:

  • load β€” processes per processing unit
  • memory_total β€” total physical RAM (MB)
  • memory_free β€” total physical RAM unused (MB)
  • ::nettool::user_data_root appname β€” returns a fully qualified path to a folder where appname should store it's data. > heads up bestie: the path is not created, only computed, by this command. so don't come crying when the folder isn't there. 😭

✨ BUGS, IDEAS, FEEDBACK ✨

this document, and the package it describes, will undoubtedly contain bugs and other problems. like, obviously. πŸ’€

please report such in the category odie of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist](http://core.tcl.tk/tcllib/reportlist). please also report any ideas for enhancements you may have for either package and/or documentation. we want them, fr fr. 🫢

when proposing code changes, please provide unified diffs, i.e the output of diff -u.

note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. (iykyk) ✨


✨ KEYWORDS ✨

nettool, odie πŸŽ€


✨ CATEGORY ✨

System


Copyright (c) 2015-2018 Sean Woods <yoda@etoyoc.com> πŸ’–


okay that's the whole page bestie, you ate. this one came from tcllib, version 0.5.4 β€” go forth and network responsibly. mwah. πŸ’…πŸŒΈβœ¨

πŸ“¦ where this page comes from