logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

nettool - Tools for networked applications

Bugs, Ideas, Feedback

       This  document,  and  the package it describes, will undoubtedly contain bugs and other problems.  Please
       report such in the category odie of the TcllibTrackers  [http://core.tcl.tk/tcllib/reportlist].   Please
       also report any ideas for enhancements you may have for either package and/or documentation.

       When proposing code changes, please provide unifieddiffs, 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.

Category

       System

Commands

::catfilename
              Dump the contents of a file as a result.

       ::nettool::allocate_portstartingport
              Attempt  to  allocate startingport, or, if busy, advance the port number sequentially until a free
              port is found, and claim that port.  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::arp_table
              Dump the contents of this computer's Address Resolution Protocol (ARP) table.  The result will  be
              a Tcl formatted list: macidipaddrlist ...

       ::nettool::broadcast_list
              Returns  a  list  of  broadcast  addresses  (suitable  for  UDP  multicast)  that this computer is
              associated with.

       ::nettool::claim_portport ?protocol?
              Mark port as busy, optionally as either tcp (default) or udp.

       ::nettool::cpuinfoargs
              If no arguments are given, return a key/value list describing the  CPU  of  the  present  machine.
              Included  in  the matrix is info on the number of cores/processors that are available for parallel
              tasking, installed physical RAM, and processor family.

              The exact contents are platform specific.

              For Linux, information is drawn from /proc/cpuinfo and /proc/meminfo.

              For MacOSX, information is drawn from sysctl

              For Windows, information is draw from TWAPI.

              If arguments are given, the result with be a key/value list limited to the fields requested.

              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_portstartingport
              Return startingport if it is available, or the next free port  after  startingport.  Note:  Unlike
              ::nettool::allocate_port, this command does not claim the port.

              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
              Return 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
              Return a list of IP addresses associated with this computer.

       ::nettool::mac_list
              Return  a  list of MACIDs for the network cards attached to this machine. The MACID of the primary
              network card is returned first.

       ::nettool::network_list
              Return  a  list  of  networks  associated  with  this  computer.  Networks   are   formated   with
              ip::nativeToPrefix.

       ::nettool::port_busyport
              Return true if port is claimed, false otherwise.

       ::nettool::release_portport ?protocol?
              Mark port as not busy, optionally as either tcp (default) or udp.

       ::nettool::status
              Return  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_rootappname
              Return a fully qualified path to a folder where appname should store it's data.  The path  is  not
              created, only computed, by this command.

Description

       The  nettool  package  consists of a Pure-tcl set of tools to perform common network functions that would
       normally require different packages or calls to exec, in a standard Tcl interface.   At  present  nettool
       has reference implementations for the following operating systems: Windows, MacOSX, and Linux (debian).

Keywords

       nettool, odie

Name

       nettool - Tools for networked applications

Synopsis

       package require Tcl8.59

       package require nettool?0.5.4?

       package require twapi3.1

       package require ip0.2

       package require platform0.2::catfilename::nettool::allocate_portstartingport::nettool::arp_table::nettool::broadcast_list::nettool::claim_portport ?protocol?

       ::nettool::cpuinfoargs::nettool::find_portstartingport::nettool::hwid_list::nettool::ip_list::nettool::mac_list::nettool::network_list::nettool::port_busyport::nettool::release_portport ?protocol?

       ::nettool::status::nettool::user_data_rootappname

________________________________________________________________________________________________________________

See Also