flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > [fasmg] IPv6 and IPv4 tools for Linux shell and bash scripts

Author
Thread Post new topic Reply to topic
Jessé



Joined: 03 May 2025
Posts: 59
Location: Brazil
Jessé 20 Jun 2025, 23:10
I made these useful tools using fasm2, guided by lack of numeric interpretation for IPs under Linux shell. And I already use them in a production scenario, with IPv4 networks. They're great (for network administration purposes based on scripts, or for curious minds that want to dig into IP x number correspondence)!
You can get it here: https://github.com/Jesse-6/shell-ip-number-tools

There are 4 binaries (so far):

- ip6tonum -> converts IPv6 address to decimal number (this is huge!);
- ip4tonum -> converts IPv4 address to decimal number;
- numtoip6 -> converts decimal number to IPv6;
- numtoip4 -> converts decimal number to IPv4.

And, the best part is: all of those binaries together occupies less space than the average 'helloworld' C program! 🤓
That's why I love assembly, folks.

_________________
jesse6
Post 20 Jun 2025, 23:10
View user's profile Send private message Visit poster's website Reply with quote
jbirddog



Joined: 10 May 2025
Posts: 4
jbirddog 21 Jun 2025, 11:54
I cloned your repo and ran a couple tests from the README, all seem to work as expected. Cool to see the fastcall from previous posts in action, I'll have to study that and the anon label stuff some more.

Just to pass along something I picked up while looking at dosmancer's fasm68k https://github.com/fredrik-hjarner/fasm68k - you can add the fasm2 repo as a submodule (and similarly for your fastcall repo) and configure a shell script with the correct include paths. I ended up doing this (with a fork that has some executable bits set) in one of my projects in hopes that it makes it easier for others to clone and build the code. If in the future you ever wanted a CI job it would help there as well. In this beautiful fasm world the tools are small enough that doing this is no big deal imho - can't imagine trying to add LLVM as a submodule for every C project...

Anyway good job, code looks clean and really just wanted to pass along the submodule idea in case you haven't considered it yet and it may be helpful.
Post 21 Jun 2025, 11:54
View user's profile Send private message Reply with quote
Jessé



Joined: 03 May 2025
Posts: 59
Location: Brazil
Jessé 21 Jun 2025, 19:23
Thanks for the advice, jbirddog.
I was really concerned about "inflating" the repository too much by always add the whole fasm2 package plus fastcall_v1 toolkit.
But this linking approach appears to be another level.
I might issue a commit with these inclusions soon.


Quote:

In this beautiful fasm world the tools are small enough that doing this is no big deal imho

I agree with you, just average fasm2 stuff... Cool
But I'm still on that "initial delight" with fasm2 self linking capabilities, and its unrivaled efficient binary generation.


Quote:

Cool to see the fastcall from previous posts in action, I'll have to study that and the anon label stuff some more.


If you like it, I recommend keeping an eye on my repository for it. I have issued recent updates, and, probably, anything new will be there, too. For example, my plan on making a fastcall_v2, which will fully support dynamic executables, in the standard object generation method (format ELF64) and external link.
Post 21 Jun 2025, 19:23
View user's profile Send private message Visit poster's website Reply with quote
sylware



Joined: 23 Oct 2020
Posts: 497
Location: Marseille/France
sylware 22 Jun 2025, 10:41
Those are really cool commands. Nice!
Post 22 Jun 2025, 10:41
View user's profile Send private message Reply with quote
Jessé



Joined: 03 May 2025
Posts: 59
Location: Brazil
Jessé 22 Jun 2025, 14:59
Thanks, sylware. I appreciated it.
I hope they are useful, because I did them to supply a specific need I had, and they came very handy to that purpose: sweep across a big network (which I manage at the ISP I'm working), and create a list of a specific device that has outdated firmware version in a txt file. Without them, this will be a very hard task to do with shell, if not impossible.
Post 22 Jun 2025, 14:59
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.