]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Structures bytestring and adata merged into adata.
authorkaterina.kubecova <katerina.kubecova@nic.cz>
Mon, 18 Sep 2023 12:43:58 +0000 (14:43 +0200)
committerMaria Matejka <mq@ucw.cz>
Wed, 20 Sep 2023 12:03:05 +0000 (14:03 +0200)
conf/cf-lex.l
conf/conf.h
conf/confbase.Y
filter/data.c
filter/data.h
filter/f-inst.c
proto/radv/config.Y
proto/radv/radv.h

index dd62e31a3821b40e9d13bc1c62e55cf0bb3e8579..28479ff381b56b372699273ca4b94ed4516dd527 100644 (file)
@@ -244,7 +244,7 @@ WHITE [ \t]
 
 ({XIGIT}{2}){16,}|{XIGIT}{2}(:{XIGIT}{2}){15,}|hex:({XIGIT}{2}(:?{XIGIT}{2})*)? {
   char *s = yytext;
-  struct bytestring *bs;
+  struct adata *bs;
 
   /* Skip 'hex:' prefix */
   if (s[0] == 'h' && s[1] == 'e' && s[2] == 'x' && s[3] == ':')
@@ -254,7 +254,7 @@ WHITE [ \t]
   if (len < 0)
     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);
   ASSERT(bs->length == len);
 
index c301df1d286ac2cf2874f9a07d2fd0cedc25b34e..486499ad10a87ebbbb8ee68e18a548fec88b7a89 100644 (file)
@@ -154,10 +154,6 @@ extern struct sym_scope *global_root_scope;
 extern pool *global_root_scope_pool;
 extern linpool *global_root_scope_linpool;
 
-struct bytestring {
-  size_t length;
-  byte data[];
-};
 
 #define SYM_MAX_LEN 64
 
index 7b368fc6d82cb20fd7aefd708a9642455c2265d6..0364bc6e18855df12365a8d6cec018fcf607e6a4 100644 (file)
@@ -94,7 +94,7 @@ CF_DECLS
   struct channel_limit cl;
   struct timeformat *tf;
   mpls_label_stack *mls;
-  const struct bytestring *bs;
+  const struct adata *bs;
 }
 
 %token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT
index deca00e0a3b9032c6e20dd4803994539fd932e1d..89b75e5654dec620ed0348152ab0329d3dbf59fd 100644 (file)
@@ -212,7 +212,7 @@ val_compare(const struct f_val *v1, const struct f_val *v2)
 }
 
 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);
 }
index 574b4a1bafa34f89f58a0f54e9415f40c372b97a..90e779c8c9b7dd210bb7e37b14c11e9eac49af87 100644 (file)
@@ -84,7 +84,7 @@ struct f_val {
     ip_addr ip;
     const net_addr *net;
     const char *s;
-    const struct bytestring *bs;
+    const struct adata *bs;
     const struct f_tree *t;
     const struct f_trie *ti;
     const struct adata *ad;
index 104a05f1a1ae85025d9cba0f289e8d88d7c53058..c56d874b03020dc698fa98fc89885208db8350fb 100644 (file)
     if (len < 0)
       runtime("Invalid hex string");
 
-    struct bytestring *bs;
-    bs = falloc(sizeof(struct bytestring) + len);
+    struct adata *bs;
+    bs = falloc(sizeof(struct adata) + len);
     bs->length = bstrhextobin(v1.val.s, bs->data);
     ASSERT(bs->length == (size_t) len);
 
index c57752d996dab86a5ab1668118a7d962e60bf294..3a898b8d442d953f0a766eb7b693e4a2bea2207e 100644 (file)
@@ -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 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");
   struct radv_custom_config *cf = cfg_allocz(sizeof(struct radv_custom_config));
index 2baf0bad7be7d28c44904b5b4bc57d343394cb02..ba4a1b6c75eb680e393dbb8eca0505c9998529a0 100644 (file)
@@ -129,7 +129,7 @@ struct radv_custom_config
 {
   node n;
   u8 type;                     /* Identifier of the type of option */
-  const struct bytestring *payload;    /* Payload of the option */
+  const struct adata *payload; /* Payload of the option */
 };
 
 /*