0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-10-18 18:08:45 +00:00
bird/lib/cbor_shortcuts.h
Katerina Kubecova 9f27bfc6fc Porting the CBOR encoder from the YANG branch
Minor cleanups by commiter.

(source commit 43ff10204b but expected
to be rebased later, don't worry if you fail to find it)
2024-10-01 14:26:00 +02:00

27 lines
1.0 KiB
C

#ifndef CBOR_SHORTCUTS_H
#define CBOR_SHORTCUTS_H
#include "lib/cbor.h"
#include "sysdep/config.h"
#include "lib/birdlib.h"
#include "nest/protocol.h"
#include "lib/ip.h"
void cbor_string_string(struct cbor_writer *writer, char *key, const char *value);
void cbor_string_int(struct cbor_writer *writer, char *key, int64_t value);
void cbor_string_epoch_time(struct cbor_writer *writer, char *key, int64_t time, int shift);
void cbor_string_relativ_time(struct cbor_writer *writer, char *key, int64_t time, int shift);
void cbor_string_uint(struct cbor_writer *writer, char *key, u64 value);
void cbor_string_ip(struct cbor_writer *writer, char *key, ip_addr);
void cbor_string_ipv4(struct cbor_writer *writer, char *key, ip4_addr);
void cbor_string_ipv6(struct cbor_writer *writer, char *key, ip6_addr);
void cbor_named_block_two_ints(struct cbor_writer *writer, char *key, char *name1, int val1, char *name2, int val2);
void cbor_write_to_file(struct cbor_writer *writer, char *filename);
void cbor_add_net(struct cbor_writer *writer, const net_addr *N);
#endif