mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 01:31:55 +00:00
Structures bytestring and adata merged into adata.
This commit is contained in:
parent
9ffea830b6
commit
bb8e28248b
@ -244,7 +244,7 @@ WHITE [ \t]
|
|||||||
|
|
||||||
({XIGIT}{2}){16,}|{XIGIT}{2}(:{XIGIT}{2}){15,}|hex:({XIGIT}{2}(:?{XIGIT}{2})*)? {
|
({XIGIT}{2}){16,}|{XIGIT}{2}(:{XIGIT}{2}){15,}|hex:({XIGIT}{2}(:?{XIGIT}{2})*)? {
|
||||||
char *s = yytext;
|
char *s = yytext;
|
||||||
struct bytestring *bs;
|
struct adata *bs;
|
||||||
|
|
||||||
/* Skip 'hex:' prefix */
|
/* Skip 'hex:' prefix */
|
||||||
if (s[0] == 'h' && s[1] == 'e' && s[2] == 'x' && s[3] == ':')
|
if (s[0] == 'h' && s[1] == 'e' && s[2] == 'x' && s[3] == ':')
|
||||||
@ -254,7 +254,7 @@ WHITE [ \t]
|
|||||||
if (len < 0)
|
if (len < 0)
|
||||||
cf_error("Invalid hex string");
|
cf_error("Invalid hex string");
|
||||||
|
|
||||||
bs = cfg_allocz(sizeof(struct bytestring) + len);
|
bs = cfg_allocz(sizeof(struct adata) + len);
|
||||||
bs->length = bstrhextobin(s, bs->data);
|
bs->length = bstrhextobin(s, bs->data);
|
||||||
ASSERT(bs->length == len);
|
ASSERT(bs->length == len);
|
||||||
|
|
||||||
|
@ -154,10 +154,6 @@ extern struct sym_scope *global_root_scope;
|
|||||||
extern pool *global_root_scope_pool;
|
extern pool *global_root_scope_pool;
|
||||||
extern linpool *global_root_scope_linpool;
|
extern linpool *global_root_scope_linpool;
|
||||||
|
|
||||||
struct bytestring {
|
|
||||||
size_t length;
|
|
||||||
byte data[];
|
|
||||||
};
|
|
||||||
|
|
||||||
#define SYM_MAX_LEN 64
|
#define SYM_MAX_LEN 64
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ CF_DECLS
|
|||||||
struct channel_limit cl;
|
struct channel_limit cl;
|
||||||
struct timeformat *tf;
|
struct timeformat *tf;
|
||||||
mpls_label_stack *mls;
|
mpls_label_stack *mls;
|
||||||
const struct bytestring *bs;
|
const struct adata *bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
%token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT
|
%token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT
|
||||||
|
@ -212,7 +212,7 @@ val_compare(const struct f_val *v1, const struct f_val *v2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
bs_same(const struct bytestring *bs1, const struct bytestring *bs2)
|
bs_same(const struct adata *bs1, const struct adata *bs2)
|
||||||
{
|
{
|
||||||
return (bs1->length == bs2->length) && !memcmp(bs1->data, bs2->data, bs1->length);
|
return (bs1->length == bs2->length) && !memcmp(bs1->data, bs2->data, bs1->length);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ struct f_val {
|
|||||||
ip_addr ip;
|
ip_addr ip;
|
||||||
const net_addr *net;
|
const net_addr *net;
|
||||||
const char *s;
|
const char *s;
|
||||||
const struct bytestring *bs;
|
const struct adata *bs;
|
||||||
const struct f_tree *t;
|
const struct f_tree *t;
|
||||||
const struct f_trie *ti;
|
const struct f_trie *ti;
|
||||||
const struct adata *ad;
|
const struct adata *ad;
|
||||||
|
@ -1522,8 +1522,8 @@
|
|||||||
if (len < 0)
|
if (len < 0)
|
||||||
runtime("Invalid hex string");
|
runtime("Invalid hex string");
|
||||||
|
|
||||||
struct bytestring *bs;
|
struct adata *bs;
|
||||||
bs = falloc(sizeof(struct bytestring) + len);
|
bs = falloc(sizeof(struct adata) + len);
|
||||||
bs->length = bstrhextobin(v1.val.s, bs->data);
|
bs->length = bstrhextobin(v1.val.s, bs->data);
|
||||||
ASSERT(bs->length == (size_t) len);
|
ASSERT(bs->length == (size_t) len);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ static list radv_dns_list; /* Used by radv_rdnss and radv_dnssl */
|
|||||||
static u8 radv_mult_val; /* Used by radv_mult for second return value */
|
static u8 radv_mult_val; /* Used by radv_mult for second return value */
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
radv_add_to_custom_list(list *l, int type, const struct bytestring *payload)
|
radv_add_to_custom_list(list *l, int type, const struct adata *payload)
|
||||||
{
|
{
|
||||||
if (type < 0 || type > 255) cf_error("RA cusom type must be in range 0-255");
|
if (type < 0 || type > 255) cf_error("RA cusom type must be in range 0-255");
|
||||||
struct radv_custom_config *cf = cfg_allocz(sizeof(struct radv_custom_config));
|
struct radv_custom_config *cf = cfg_allocz(sizeof(struct radv_custom_config));
|
||||||
|
@ -129,7 +129,7 @@ struct radv_custom_config
|
|||||||
{
|
{
|
||||||
node n;
|
node n;
|
||||||
u8 type; /* Identifier of the type of option */
|
u8 type; /* Identifier of the type of option */
|
||||||
const struct bytestring *payload; /* Payload of the option */
|
const struct adata *payload; /* Payload of the option */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user