]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit 'fc354788' into thread-next
authorMaria Matejka <mq@ucw.cz>
Fri, 13 Oct 2023 09:32:53 +0000 (11:32 +0200)
committerMaria Matejka <mq@ucw.cz>
Fri, 13 Oct 2023 09:32:53 +0000 (11:32 +0200)
1  2 
bird-gdb.py
conf/cf-lex.l
conf/confbase.Y
filter/config.Y
filter/data.c
filter/f-inst.c
filter/f-inst.h
filter/test.conf
lib/type.h
nest/config.Y
proto/radv/config.Y

diff --cc bird-gdb.py
Simple merge
diff --cc conf/cf-lex.l
Simple merge
diff --cc conf/confbase.Y
Simple merge
diff --cc filter/config.Y
index e6264a83c3c4b97b2dd6e9815dc117630947ee8d,e2d133a9165b7816c813cce44a6231f292dae114..7bf13d9ce47a18ebc922c0162316b0e503b30346
@@@ -330,13 -317,15 +330,14 @@@ CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UN
        MIN, MAX,
        EMPTY,
        FILTER, WHERE, EVAL, ATTRIBUTE,
 -      BT_ASSERT, BT_TEST_SUITE, BT_CHECK_ASSIGN, BT_TEST_SAME, FORMAT)
+       FROM_HEX,
 +      BT_ASSERT, BT_TEST_SUITE, BT_CHECK_ASSIGN, BT_TEST_SAME, FORMAT, STACKS)
  
  %nonassoc THEN
  %nonassoc ELSE
  
  %type <xp> cmds_int cmd_prep
- %type <x> term cmd cmd_var cmds cmds_scoped constant constructor print_list var var_init var_list function_call symbol_value bgp_path_expr bgp_path bgp_path_tail
+ %type <x> term term_bs cmd cmd_var cmds cmds_scoped constant constructor print_list var var_init var_list function_call symbol_value bgp_path_expr bgp_path bgp_path_tail
 -%type <fda> dynamic_attr
  %type <fsa> static_attr
  %type <f> filter where_filter
  %type <fl> filter_body function_body
@@@ -886,6 -869,9 +889,7 @@@ term
  
   | FORMAT '(' term ')' {  $$ = f_new_inst(FI_FORMAT, $3); }
  
 -/* | term '.' LEN { $$->code = P('P','l'); } */
 -
+  | term_bs
   | function_call
   ;
  
diff --cc filter/data.c
index ce8d7561accdde85b213564a7d4e4b444e5ca252,1d740b0d8761898dec10e6f9e08af6ee5b094464..9794f2309210adb3a5c99ed5895bf2bbe84d6e04
@@@ -47,8 -46,8 +47,9 @@@ static const char * const f_type_str[] 
    [T_IP]      = "ip",
    [T_NET]     = "prefix",
    [T_STRING]  = "string",
+   [T_BYTESTRING]      = "bytestring",
    [T_PATH_MASK]       = "bgpmask",
 +  [T_PATH_MASK_ITEM] = "bgpmask item",
    [T_PATH]    = "bgppath",
    [T_CLIST]   = "clist",
    [T_EC]      = "ec",
diff --cc filter/f-inst.c
Simple merge
diff --cc filter/f-inst.h
Simple merge
Simple merge
diff --cc lib/type.h
index b54744c1b6e5455cf7df02808e746d4f0bcc4218,0000000000000000000000000000000000000000..232e7aef27130a49c584bfe24a5530ac61d52c3b
mode 100644,000000..100644
--- /dev/null
@@@ -1,112 -1,0 +1,114 @@@
 +/*
 + *     BIRD Internet Routing Daemon -- Internal Data Types
 + *
 + *     (c) 2022 Maria Matejka <mq@jmq.cz>
 + *
 + *     Can be freely distributed and used under the terms of the GNU GPL.
 + */
 +
 +#ifndef _BIRD_TYPE_H_
 +#define _BIRD_TYPE_H_
 +
 +#include "lib/birdlib.h"
 +#include "lib/attrs.h"
 +
 +union bval {
 +#define BVAL_ITEMS                                                                    \
 +  struct {                                                                            \
 +    u32 data;                 /* Integer type inherited from eattrs */                \
 +    PADDING(data, 0, 4);      /* Must be padded on 64-bits */                         \
 +  };                                                                                  \
 +  struct {                                                                            \
 +    u32 i;                    /* Integer type inherited from filters */               \
 +    PADDING(i, 0, 4);         /* Must be padded on 64-bits */                         \
 +  };                                                                                  \
 +  const struct adata *ptr;    /* Generic attribute data inherited from eattrs */      \
 +  const struct adata *ad;             /* Generic attribute data inherited from filters */     \
 +
 +  BVAL_ITEMS;
 +};
 +
 +union bval_long {
 +  union bval bval;            /* For direct assignments */
 +  BVAL_ITEMS;                 /* For item-wise access */
 +
 +  u64 ec;
 +  lcomm lc;
 +  ip_addr ip;
 +  const net_addr *net;
 +  const char *s;
++  const struct bytestring *bs;
 +  const struct f_tree *t;
 +  const struct f_trie *ti;
 +  const struct f_path_mask *path_mask;
 +  struct f_path_mask_item pmi;
 +};
 +
 +
 +/* Internal types */
 +enum btype {
 +/* Nothing. Simply nothing. */
 +  T_VOID = 0,
 +
 +/* Something but inaccessible. */
 +  T_OPAQUE = 0x02,            /* Opaque byte string (not filterable) */
 +  T_IFACE = 0x0c,             /* Pointer to an interface (inside adata) */
 +  T_NEXTHOP_LIST = 0x2c,      /* The whole nexthop block */
 +  T_HOSTENTRY = 0x2e,         /* Hostentry with possible MPLS labels */
 +
 +/* Types shared with eattrs */
 +  T_INT = 0x01,                       /* 32-bit unsigned integer number */
 +  T_IP = 0x04,                        /* IP address */
 +  T_QUAD = 0x05,              /* Router ID (IPv4 address) */
 +  T_PATH = 0x06,              /* BGP AS path (encoding per RFC 1771:4.3) */
 +  T_CLIST = 0x0a,             /* Set of u32's (e.g., a community list) */
 +  T_ECLIST = 0x0e,            /* Set of pairs of u32's - ext. community list */
 +  T_LCLIST = 0x08,            /* Set of triplets of u32's - large community list */
 +
 +  T_ENUM_BGP_ORIGIN = 0x11,   /* BGP Origin enum */
 +  T_ENUM_RA_PREFERENCE = 0x13,        /* RA Preference enum */
 +  T_ENUM_FLOWSPEC_VALID = 0x15,       /* Flowspec validation result */
 +
 +#define EAF_TYPE__MAX 0x1f
 +#define EAF_EMBEDDED 0x01             /* Data stored in eattr.u.data (part of type spec) */
 +                                      /* Otherwise, attribute data is adata */
 +
 +/* Other user visible types which fit in int */
 +  T_BOOL = 0xa0,
 +  T_PAIR = 0xa4,  /*  Notice that pair is stored as integer: first << 16 | second */
 +
 +/* Put enumerational types in 0x20..0x3f range */
 +  T_ENUM_LO = 0x10,
 +  T_ENUM_HI = 0x3f,
 +
 +  T_ENUM_RTS = 0x31,
 +  T_ENUM_SCOPE = 0x33,
 +  T_ENUM_RTD = 0x37,
 +  T_ENUM_ROA = 0x39,
 +  T_ENUM_NETTYPE = 0x3b,
 +  T_ENUM_AF = 0x3d,
 +
 +/* new enums go here */
 +
 +#define T_ENUM T_ENUM_LO ... T_ENUM_HI
 +
 +/* Bigger ones */
 +  T_NET = 0xb0,
 +  T_STRING = 0xb4,
 +  T_PATH_MASK = 0xb8, /* mask for BGP path */
 +  T_EC = 0xbc,                /* Extended community value, u64 */
 +  T_LC = 0xc0,                /* Large community value, lcomm */
 +  T_RD = 0xc4,                /* Route distinguisher for VPN addresses */
 +  T_PATH_MASK_ITEM = 0xc8,    /* Path mask item for path mask constructors */
++  T_BYTESTRING = 0xcc,
 +
 +  T_SET = 0x80,
 +  T_PREFIX_SET = 0x84,
 +} PACKED;
 +
 +typedef enum btype btype;
 +
 +STATIC_ASSERT(sizeof(btype) == sizeof(byte));
 +
 +
 +#endif
diff --cc nest/config.Y
Simple merge
Simple merge