Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
13 user(s) are online (7 user(s) are browsing Forums)

Members: 0
Guests: 13

more...

Support us!

Headlines

 
  Register To Post  

unix like "netstat" tool for os4, v1.1
Home away from home
Home away from home


See User information
Since begining of my os4 journey i always miss the casual "netstat" tool from unix, which i just always use with "-an" option to just see info about all tcp/udp connections and opened ports.
So at last give a go and made a full mimic of it , mean you can do same "netstat -l" , "netstat -an" , "netstat -a" all the same as on unix and it will works and outputs exactly the same.
Also support of -s were added too, and all what left is just -r and -I (to show routing and interface tables):

(hit open in new tab for fullsize)
Resized Image


There are binary if anyone want it to try and report bugs:

https://kas1e.mikendezign.com/aos4/network/netstat/netstat_v1_1.zip


Edited by kas1e on 2025/5/16 17:50:26
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: unix like netstat tool for os4, beta
Not too shy to talk
Not too shy to talk


See User information
@kas1e
ooo... QEMU ?
For testing software after cross compiler is perfectly suitable.

Go to top
Re: unix like netstat tool for os4, beta
Just can't stay away
Just can't stay away


See User information
@kas1e

works frin on my SAM460ex:
#KDH1:Comm/netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp      24     0 192.168.1.204
:1073      103.27.34.17:443        FIN_WAIT_1  
tcp       0    24 192.168.1.204
:1051      46.4.77.21:443          CLOSING     
tcp       0     0 0.0.0.0
:21              0.0.0.0:*               LISTEN      
tcp       0     0 127.0.0.1
:1024          127.0.0.1:1025          ESTABLISHED 
tcp       0     0 127.0.0.1
:1025          127.0.0.1:1024          ESTABLISHED 
#



If RECV:Q SEND_Q column data could be aligned plz

Go to top
Re: unix like netstat tool for os4, beta
Quite a regular
Quite a regular


See User information
@kas1e
Thanks!

AmigaOS3: Amiga 1200
AmigaOS4: Micro A1-C, AmigaOne XE, Pegasos II, Sam440ep, Sam440ep-flex, AmigaOne X1000
MorphOS: Efika 5200b, Pegasos I, Pegasos II, Powerbook, Mac Mini, iMac, Powermac Quad
Go to top
Re: unix like netstat tool for os4, beta
Just popping in
Just popping in


See User information
Its really good, yeahhhh \m/_
Thanks

Go to top
Re: unix like netstat tool for os4, beta
Home away from home
Home away from home


See User information
@smarkusg
Quote:

ooo... QEMU ?
For testing software after cross compiler is perfectly suitable.


Yeah, for me QEMU 10 on a notebook boots to a ready Workbench in about 15 seconds (using Pegasos2 emulation). I compile everything with a cross-compiler directly in a shared directory, which QEMU sees as a FAT stick after boot.

Sure, it's a bit annoying that you have to restart QEMU every time you want to see updated files from that shared directory, but still — cold boot of OS4 is only really fast on the Sam460 (if I remember correctly, around 15–20 seconds).
On other machines, it usually takes 30–40 seconds.

In other words, even with restarting QEMU because the FAT stick can't refresh automatically, it's still faster than waiting for a real Amiga to boot. Plus, it's just quicker to cross-compile and test everything on the same desktop — and only move to real hardware once everything is ready.


@Javier
Quote:

If RECV:Q SEND_Q column data could be aligned plz


Done!

@All
New version — likely final, unless bugs are found. Tried to mimic the original as closely as possible.

6.System:> netstat --help
Usage
netstat [options]
Options:
  -
a, --all            Show all sockets (listening and non-listening)
  -
l, --listening      Show only listening sockets
  
-n, --numeric        Show numerical addresses and ports
  
-s, --statistics     Show network statistics
  
-i, --interfaces     Display interface table
  
-r, --route          Show routing table
  
--version            Show version
  
-h, --help           Show this help
Default: Show TCP and UDP connections with resolved names
6.System
:>


(hit open in new tab for fullsize)
Resized Image

Fixed formatting issues, added -r and -i options. Adjusted handling of -n, -a, -l, and default behavior to match Unix. Some edge cases may still be missing, of course :)

And new version:

https://kas1e.mikendezign.com/aos4/network/netstat/netstat_v1_1.zip

Thanks for trying !

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: unix like netstat tool for os4, beta
Home away from home
Home away from home


See User information
@kas1e
Quote:
Since begining of my os4 journey i always miss the casual "netstat" tool from unix
As usual on AmigaOS completely different syntax/arguments, but ShowNetStatus should be able to display nearly everything on AmigaOS 4.x a Unix netstat does.

Go to top
Re: unix like netstat tool for os4, beta
Just popping in
Just popping in


See User information
@kas1e

Hi Kas1e,

Very interesting, thanks for sharing, and congratulations on this utility.

Go to top
Re: unix like netstat tool for os4, beta
Just can't stay away
Just can't stay away


See User information
@kas1e

THXaLOt mate!!!
Good job!!!

#c:ShowNetStatus tcpsockets
Local                          Remoto                            Lon.rec    Lon.env Estado                        
192.168.1.204
:1780             103.27.34.17:443                       24          0 Recibido 'FIN'esperando a cerrar
192.168.1.204
:1779             157.180.36.153:443                     24          0 Recibido 'FIN'esperando a cerrar
192.168.1.204
:1778             157.180.36.153:443                     24          0 Recibido 'FIN'esperando a cerrar
192.168.1.204
:1777             103.27.34.17:443                       24          0 Recibido 'FIN'esperando a cerrar
192.168.1.204
:1772             157.180.36.153:443                     24          0 Recibido 'FIN'esperando a cerrar
192.168.1.204
:1771             157.180.36.153:443                     24          0 Recibido 'FIN'esperando a cerrar
127.0.0.1
:1731                 127.0.0.1:1732                          0          0 Establecido
127.0.0.1
:1732                 127.0.0.1:1731                          0          0 Establecido
192.168.1.204
:1704             192.168.1.222:139                       0          0 Establecido
#netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp       24      0 192.168.1.204
:1780      103.27.34.17:443        FIN_WAIT_1  
tcp       24      0 192.168.1.204
:1779      157.180.36.153:443      FIN_WAIT_1  
tcp       24      0 192.168.1.204
:1778      157.180.36.153:443      FIN_WAIT_1  
tcp       24      0 192.168.1.204
:1777      103.27.34.17:443        FIN_WAIT_1  
tcp       24      0 192.168.1.204
:1772      157.180.36.153:443      FIN_WAIT_1  
tcp       24      0 192.168.1.204
:1771      157.180.36.153:443      FIN_WAIT_1  
tcp        0      0 127.0.0.1
:1731          127.0.0.1:1732          ESTABLISHED 
tcp        0      0 127.0.0.1
:1732          127.0.0.1:1731          ESTABLISHED 
tcp        0      0 192.168.1.204
:1704      192.168.1.222:139       ESTABLISHED 
tcp        0      0 0.0.0.0
:21              0.0.0.0:*               LISTEN      
#

Go to top
Re: unix like netstat tool for os4, beta
Home away from home
Home away from home


See User information
@joerg
Quote:

As usual on AmigaOS completely different syntax/arguments, but ShowNetStatus should be able to display nearly everything on AmigaOS 4.x a Unix netstat does.


I come from the *nix world, where dinosaurs like TRU64, IRIX, HPUX, DGUX, and ancient breeds of SunOS roamed free with all exotic CPUs like Alpha, MIPS, PA-Risc, etc. So, constantly switching between them, whenever I needed to check which network ports were open or figure out what kind of chaos was happening on the wire, I’d just run netstat -an (okay, maybe not always -an, but pretty close), and sprinkle some tcpdump on top when things got serious. And I knew netstat would be there.
It was (and still) everywhere. BSDs, Random UNIX clones, my old Cygwin setup and even on Windows now, thanks to WSL2. It’s like the cockroach of networking tools :)

Then when I switched to OS4 and… bam. Brain freeze. What’s the name of the tool again?:) So I had to do a "list c:#?net#? " just to rediscover it. Then squint at "?" help to remember what kind of different flags it wants to just show both tcp and udp ports listened, opened and used.

Sure, this little tool I made doesn’t pretend to replace ShowNetStatus (which has way more features and was written by an actual wizard). But hey, mine is fully native too and uses the mighty Roadshow API under the hood.

@Javier and others
Thanks a tick!

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: unix like netstat tool for os4, beta
Home away from home
Home away from home


See User information
@kas1e

A program with the same name already exists

https://os4depot.net/?function=showfil ... =network/misc/netstat.lha

Go to top
Re: unix like "netstat" tool for os4, v1.1
Home away from home
Home away from home


See User information
@samo79
This one have lots of issues:

1). no options at all (it's mimic "-a" kind of output and that all)
2). support only "tcp" (so no udp)
3). by default it's print with resolved host (can be slow). So no -n option too.
4). no icmp support
5). no stastic support
6). no route support
7). no interface support

It's something very very basic, while my one full clone with only exceptions to groups (igmp).

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: unix like "netstat" tool for os4, v1.1
Site Builder
Site Builder


See User information
@kas1e
Thank you so much for bringing this utility to our systems. Great work pal.

Follow me on
Ko-fi, Twitter, YouTube, Twitch
Go to top
Re: unix like "netstat" tool for os4, v1.1
Quite a regular
Quite a regular


See User information
@kas1e
Nice. Can we also get the source as a network programming example?

Go to top
Re: unix like "netstat" tool for os4, v1.1
Just can't stay away
Just can't stay away


See User information
@kas1e

Thanks for the diagnostic tool Utilitie about the information of the network interfaces, will be packed to SYS:c so that I can access it quickly if I ever need it.

And yes, it works very well and all information can be retrieved via the command option.

MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE / AmigaOne x5000/40 AmigaOs4.1 FE
Go to top
Re: unix like "netstat" tool for os4, v1.1
Home away from home
Home away from home


See User information
@kas1e

Yeah, no doubt
However maybe you can rename as "netstats" so to not conflict with others?

Btw thanks for this util

Go to top
Re: unix like "netstat" tool for os4, v1.1
Quite a regular
Quite a regular


See User information
@samo79
No netstat is the name of this kind of tool on every platform. You can just think of this version as surpassing the existing one so that's now obsoleted by this.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project