nettool(n)
π 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 allocatestartingport, 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?β marksportas busy, optionally as eithertcp(that's the default, bestie) orudp. π«Ά::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/cpuinfoand/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.
- for Linux, the info is drawn from
canonical fields for all platforms:
cpusβ count of CPUs/cores/execution unitsspeedβ clock speed of processor(s) in Mhzmemoryβ installed RAM (in MB)vendorβ manufacturer
::nettool::find_port startingportβ returnsstartingportif it's available, or the next free port afterstartingport. > 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 withip::nativeToPrefix. π::nettool::port_busy portβ returnstrueifportis claimed,falseotherwise. vibe check complete. β¨::nettool::release_port port ?protocol?β marksportas not busy, optionally as eithertcp(default) orudp. 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 oftopfor all platforms. πΈ
common fields include:
loadβ processes per processing unitmemory_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 whereappnameshould 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 β¨
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
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2015-2018 Sean Woods <yoda@etoyoc\&.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms