TRIP Routing Daemon
TRIP (RFC 3219) Location Server Implementation
Loading...
Searching...
No Matches
parser.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
21#ifndef _PARSER_H
22#define _PARSER_H
23
24#include <functions/manager.h>
25
26#include <stdio.h>
27
31
39
41typedef struct {
42 int enabled;
43 cmd_context_t ctx;
44
45 uint32_t itad;
47
49typedef struct {
50 parser_state_t state;
51 FILE *outf;
52
53 struct sockaddr_in6 listen_addr;
54 manager_t *manager;
55} parser_t;
56
57
59char *strip(char *s);
60
62parser_t *parser_init(FILE *outf);
64int parser_parse_cmd(parser_t *parser, char *cmd);
66int parser_parse_file(parser_t *parser, FILE *f);
67
68
69#endif /* _PARSER_H */
70
Session manager.
cmd_context_t
Command context structure.
Definition parser.h:33
@ CTX_ROOT
Definition parser.h:34
@ CTX_CONFIG
Definition parser.h:35
@ CTX_PREFIXLIST
Definition parser.h:36
@ CTX_TRIP
Definition parser.h:37
int parser_parse_file(parser_t *parser, FILE *f)
Parse file.
Definition parser.c:88
parser_t * parser_init(FILE *outf)
Initialize parser state and output file.
Definition parser.c:44
int parser_parse_cmd(parser_t *parser, char *cmd)
Parse single command.
Definition parser.c:58
char * strip(char *s)
Skip white characters.
Definition parser.c:35
Manager object.
Definition manager.h:38
Parser state.
Definition parser.h:41
uint32_t itad
Definition parser.h:45
Parser object.
Definition parser.h:49