TRIP Routing Daemon
TRIP (RFC 3219) Location Server Implementation
Loading...
Searching...
No Matches
locator.h
Go to the documentation of this file.
1/*
2
3 trip: Modern TRIP LS implementation
4 Copyright (C) 2025 arf20 (Ángel Ruiz Fernandez)
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19*/
20
26
27#ifndef _LOCATOR_H
28#define _LOCATOR_H
29
30#include <protocol/protocol.h>
31#include <db/pib.h>
32
33#include <netinet/in.h>
34
35
37typedef struct {
38 struct sockaddr_in6 addr;
39
40 uint32_t itad;
41 capinfo_transmode_t transmode;
42
43 /* timers */
44 uint16_t hold;
45
46 /* policy */
47 routemap_t *routemap_in, *routemap_out;
48} peer_t;
49
51typedef struct {
52 peer_t *peers;
53 size_t peers_size, peers_capacity;
54} locator_t;
55
56
59
61peer_t *locator_add(locator_t *locator, const struct sockaddr_in6 *addr,
62 uint32_t itad, uint16_t hold, capinfo_transmode_t transmode);
63
66 const struct sockaddr_in6 *addr);
67
69void locator_destroy(locator_t *locator);
70
71
72#endif /* _LOCATOR_H */
73
peer_t * locator_add(locator_t *locator, const struct sockaddr_in6 *addr, uint32_t itad, uint16_t hold, capinfo_transmode_t transmode)
Add a known peer.
Definition locator.c:47
peer_t * locator_lookup(locator_t *locator, const struct sockaddr_in6 *addr)
Lookup peer by its address.
Definition locator.c:68
void locator_destroy(locator_t *locator)
Destroy locator object.
Definition locator.c:87
locator_t * locator_new()
Initialize singleton locator known peer list.
Definition locator.c:37
Policy Information Base.
Protocol definition header.
uint32_t capinfo_transmode_t
Capability information transmission mode.
Definition protocol.h:124
Peer locator.
Definition locator.h:51
Known peer info object.
Definition locator.h:37
Route map.
Definition pib.h:79