---
name: "lc_hashtoaddr"
section: "3"
platform: "linux"
package: "liblibrecast-dev"
version: "0.9.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/lc_hashtoaddr"
---

# lc\_hashtoaddr(3)

create IPv6 multicast addr from supplied hash and flags

## NAME

lc\_hashtoaddr - create IPv6 multicast addr from supplied hash and flags

## 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

The **lc\_hashtoaddr**() function creates and returns an IPv6 multicast address in *addr* from the supplied *hash* of length *hashlen* and *flags*.

The address returned in *addr* is a valid IPv6 multicast address. The first 8 bits are set to 1. The following 8 bits are set to *flags*, which 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 *hash* are used for the remaining 14 bytes of the address.

## RETURN VALUE

The lc\_hashtoaddr () function returns no value.

## ERRORS

None.

## SEE ALSO

**lc\_channel\_new**(3), **lc\_channel\_close**(3), [**lc\_ctx\_new**(3)](/lc_ctx_new/3.md), [**lc\_socket\_new**(3)](/lc_socket_new/3.md), **lc\_channel\_new**(3)
