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 uint16_t hold;
39 uint16_t keepalive;
40 int connect_retry;
41 int max_purge_time;
42 int disable_time;
43 int min_itad_orig_int;
44 int min_route_advert_int;
45} timers_t;
46
48typedef struct {
49 struct sockaddr_in6 addr;
50
51 uint32_t itad;
52 capinfo_transmode_t transmode;
53
54 /* timers */
55 timers_t timers;
56
57 /* policy */
58 routemap_t *routemap_in, *routemap_out;
59} peer_t;
60
62typedef struct {
63 peer_t *peers;
64 size_t peers_size, peers_capacity;
65} locator_t;
66
67
70
72peer_t *locator_add(locator_t *locator, const struct sockaddr_in6 *addr,
73 uint32_t itad, const timers_t *timers, capinfo_transmode_t transmode);
74
77 const struct sockaddr_in6 *addr);
78
80void locator_destroy(locator_t *locator);
81
82
83#endif /* _LOCATOR_H */
84
peer_t * locator_lookup(locator_t *locator, const struct sockaddr_in6 *addr)
Lookup peer by its address.
Definition locator.c:69
void locator_destroy(locator_t *locator)
Destroy locator object.
Definition locator.c:88
peer_t * locator_add(locator_t *locator, const struct sockaddr_in6 *addr, uint32_t itad, const timers_t *timers, capinfo_transmode_t transmode)
Add a known peer.
Definition locator.c:47
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:62
Known peer info object.
Definition locator.h:48
Route map.
Definition pib.h:79
Timers.
Definition locator.h:37