LC_HASHTOADDR(3)
π LC_HASHTOADDR(3) π
okay so bestie, we're in the Librecast Programmer's Manual today and the page we're reading is lc_hashtoaddr β and ngl it's a little one but she's important, so let's get into it β¨
πΈ NAME πΈ
lc_hashtoaddr β create IPv6 multicast addr from supplied hash and flags
like. it literally does what it says on the tin. a hash goes in, an address comes out. the way that she's just a converter and she's still the moment?? π
π LIBRARY π
Librecast library (liblibrecast, -llibrecast)
π SYNOPSIS π
#include <librecast/net.h>
void lc_hashtoaddr(struct in6_addr *addr, unsigned char *hash, size_t hashlen,
unsigned char flags);
Compile and link with -llibrecast. π«Ά
β¨ DESCRIPTION β¨
so the lc_hashtoaddr() function creates and returns an IPv6 multicast address in addr, built from the supplied hash of length hashlen plus your flags. it's giving assembly line but make it networking π
the address that lands back in addr is a valid IPv6 multicast address. here's the breakdown, no cap:
- the first 8 bits are set to
1β - the following 8 bits are set to
flagsβ and lowkey important: this should be the valid IPv6 multicast 4-bit flags field as defined in IETF RFC 4291, followed by the 4 bits for multicast scope π - the first 14 bytes of
hashare used for the remaining 14 bytes of the address π¦
so yeah, 14 + 2 = 16 bytes, a whole IPv6 address, slay π
π«§ RETURN VALUE π«§
the lc_hashtoaddr () function returns no value. it's a void girlie. she does the work and says nothing. iconic, honestly π
π ERRORS π
None. not a single one. she simply does not miss β¨
π₯ SEE ALSO π₯
lc_channel_new(3)lc_channel_close(3)lc_ctx_new(3)lc_socket_new(3)lc_channel_new(3)
(yes bestie, lc_channel_new(3) is listed twice in the original and I am not the one who's gonna touch that. we respect the source material fr fr ππ)
and that's the whole page! short, sweet, absolutely ate. go build some multicast addresses and be the main character of your own network π
LIBRECAST Β· 2023-07-23 Β· LC_HASHTOADDR(3) β mwah, love u, bye ππβ¨
π¦ where this page comes from
- debian trixie: liblibrecast-dev 0.9.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: librecast 0.11.2
- nixpkgs unstable: librecast 0.11.2
- ubuntu noble: liblibrecast-dev 0.8.0-1.1build1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: liblibrecast-dev 0.9.1-1
- ubuntu resolute: liblibrecast-dev 0.11.2-2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblibrecast-dev 0.11.2-2build1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms