blob: 114ac01e06afa333cbb98771198e792bbd8fefa2 [file] [log] [blame]
Sven Eckelmann7db7d9f2017-11-19 15:05:11 +01001/* SPDX-License-Identifier: GPL-2.0 */
Sven Eckelmann7a79d712018-12-31 23:59:59 +01002/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
Markus Pargmann1f8dce42016-05-15 11:07:43 +02003 *
4 * Marek Lindner, Simon Wunderlich
Markus Pargmann1f8dce42016-05-15 11:07:43 +02005 */
6
7#ifndef _NET_BATMAN_ADV_TVLV_H_
8#define _NET_BATMAN_ADV_TVLV_H_
9
10#include "main.h"
11
12#include <linux/types.h>
13
14struct batadv_ogm_packet;
15
16void batadv_tvlv_container_register(struct batadv_priv *bat_priv,
17 u8 type, u8 version,
18 void *tvlv_value, u16 tvlv_value_len);
19u16 batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv,
20 unsigned char **packet_buff,
21 int *packet_buff_len, int packet_min_len);
22void batadv_tvlv_ogm_receive(struct batadv_priv *bat_priv,
23 struct batadv_ogm_packet *batadv_ogm_packet,
24 struct batadv_orig_node *orig_node);
25void batadv_tvlv_container_unregister(struct batadv_priv *bat_priv,
26 u8 type, u8 version);
27
28void batadv_tvlv_handler_register(struct batadv_priv *bat_priv,
29 void (*optr)(struct batadv_priv *bat_priv,
30 struct batadv_orig_node *orig,
31 u8 flags,
32 void *tvlv_value,
33 u16 tvlv_value_len),
34 int (*uptr)(struct batadv_priv *bat_priv,
35 u8 *src, u8 *dst,
36 void *tvlv_value,
37 u16 tvlv_value_len),
38 u8 type, u8 version, u8 flags);
39void batadv_tvlv_handler_unregister(struct batadv_priv *bat_priv,
40 u8 type, u8 version);
41int batadv_tvlv_containers_process(struct batadv_priv *bat_priv,
42 bool ogm_source,
43 struct batadv_orig_node *orig_node,
44 u8 *src, u8 *dst,
45 void *tvlv_buff, u16 tvlv_buff_len);
46void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, u8 *src,
47 u8 *dst, u8 type, u8 version,
48 void *tvlv_value, u16 tvlv_value_len);
49
50#endif /* _NET_BATMAN_ADV_TVLV_H_ */