---
name: "loc_database_get_as"
section: "3"
platform: "linux"
package: "libloc"
version: "0.9.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/loc_database_get_as"
---

# loc\_database\_get\_as(3)

Fetch an AS from the database

## NAME

loc\_database\_get\_as - Fetch an AS from the database

## SYNOPSIS

```
#include <libloc/database.h>
```

int loc\_database\_get\_as(struct loc\_database\* db, struct loc\_as\*\* as, uint32\_t number);

## DESCRIPTION

This function retrieves an Autonomous System with the matching *number* from the database and stores it in *as*.

## RETURN VALUE

On success, zero is returned. Otherwise non-zero is being returned and *errno* is set accordingly.

## SEE ALSO

[**libloc**(3)](/libloc/3.md)

## AUTHORS

Michael Tremer
