ud3tn/include/routing/compat/config_parser.h
Felix Walter 87be9749af Re-integrate v0.13.0 routing code as "integrated default BDM"
This makes µD3TN behave the same as v0.13.0 when executed without an
additional commandline argument. A new commandline argument `-d` /
`--external-dispatch` is added, which enables the use of external BDMs.
The default forwarding implementation is now again provided using the
v0.13 code, extracted from e1621765a4 and
adapted to the new agent-based forwarding implementation.

Central changes to the old code include:

- A new "Routing Agent" that handles incoming configuration commands,
  FIB updates, and BDM dispatch requests.
- The use of the BDM authorization flag to authorize contact
  configuration commands.
- The Contact Manager now only triggers the creation and removal of
  links / FIB entries; bundle dispatch is triggered through the FIB and
  BDM callback functions of the Routing Agent.
- The fragmentation logic is adapted to store the original bundle along
  with an offset and length value, instead of pre-creating and storing
  the fragments.
- The bundle re-scheduling logic integrated into the Routing Agent is
  simplified and does not support changing the fragmentation parameters.
  A new function is added to the Router that searches for a new route
  for such fragments that were already scheduled at some point,
  considering them as un-fragmentable bundle with overridden fragment
  offset and length.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-07-15 00:46:14 +02:00

56 lines
1.6 KiB
C

// SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0
#ifndef RTCOMPAT_CONFIGPARSER_H_INCLUDED
#define RTCOMPAT_CONFIGPARSER_H_INCLUDED
#include "ud3tn/parser.h"
#include "ud3tn/result.h"
#include "routing/compat/router.h"
#include <stdint.h>
enum config_parser_stage {
RP_EXPECT_COMMAND_TYPE,
RP_EXPECT_NODE_CONF_START_DELIMITER,
RP_EXPECT_NODE_CONF_EID,
RP_EXPECT_NODE_CONF_RELIABILITY_SEPARATOR,
RP_EXPECT_NODE_CONF_RELIABILITY,
RP_EXPECT_NODE_CONF_CLA_ADDR_SEPARATOR,
RP_EXPECT_CLA_ADDR_START_DELIMITER,
RP_EXPECT_CLA_ADDR,
RP_EXPECT_CLA_ADDR_NODES_SEPARATOR,
RP_EXPECT_NODE_LIST_START_DELIMITER,
RP_EXPECT_NODE_START_DELIMITER,
RP_EXPECT_NODE_EID,
RP_EXPECT_NODE_SEPARATOR,
RP_EXPECT_NODES_CONTACTS_SEPARATOR,
RP_EXPECT_CONTACT_LIST_START_DELIMITER,
RP_EXPECT_CONTACT_START_DELIMITER,
RP_EXPECT_CONTACT_START_TIME,
RP_EXPECT_CONTACT_END_TIME,
RP_EXPECT_CONTACT_BITRATE,
RP_EXPECT_CONTACT_NODE_LIST_START_DELIMITER,
RP_EXPECT_CONTACT_NODE_START_DELIMITER,
RP_EXPECT_CONTACT_NODE_EID,
RP_EXPECT_CONTACT_NODE_SEPARATOR,
RP_EXPECT_CONTACT_END_DELIMITER,
RP_EXPECT_CONTACT_SEPARATOR,
RP_EXPECT_COMMAND_END_MARKER
};
struct config_parser {
struct parser *basedata;
enum config_parser_stage stage;
struct router_command *router_command;
int current_index;
char *current_int_data;
struct endpoint_list *current_eid;
struct contact_list *current_contact;
};
struct parser *config_parser_init(struct config_parser *parser);
size_t config_parser_read(struct config_parser *parser,
const uint8_t *buffer, size_t length);
enum ud3tn_result config_parser_reset(struct config_parser *parser);
#endif // RTCOMPAT_CONFIGPARSER_H_INCLUDED