]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - filter/data.h
Filter: Minor updates to methods
[thirdparty/bird.git] / filter / data.h
index b3767f7bc7d58df3150297923d0551f8cb6f88c1..6420d37337d6091409afa21cac937a3b1b90bd0e 100644 (file)
@@ -20,6 +20,8 @@ enum f_type {
 /* Nothing. Simply nothing. */
   T_VOID = 0,
 
+  T_NONE = 1,          /* Special hack to represent missing arguments */
+
 /* User visible types, which fit in int */
   T_INT = 0x10,
   T_BOOL = 0x11,
@@ -58,11 +60,20 @@ enum f_type {
   T_LCLIST = 0x29,             /* Large community list */
   T_RD = 0x2a,         /* Route distinguisher for VPN addresses */
   T_PATH_MASK_ITEM = 0x2b,     /* Path mask item for path mask constructors */
+  T_BYTESTRING = 0x2c,
 
   T_SET = 0x80,
   T_PREFIX_SET = 0x81,
 } PACKED;
 
+struct f_method {
+  struct symbol *sym;
+  struct f_inst *(*new_inst)(struct f_inst *obj, struct f_inst *args);
+  const struct f_method *next;
+  uint arg_num;
+  enum f_type args_type[];
+};
+
 /* Filter value; size of this affects filter memory consumption */
 struct f_val {
   enum f_type type;    /* T_*  */
@@ -73,6 +84,7 @@ struct f_val {
     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 adata *ad;
@@ -275,8 +287,8 @@ trie_match_next_longest_ip6(net_addr_ip6 *n, ip6_addr *found)
 #define F_CMP_ERROR 999
 
 const char *f_type_name(enum f_type t);
-
 enum f_type f_type_element_type(enum f_type t);
+struct sym_scope *f_type_method_scope(enum f_type t);
 
 int val_same(const struct f_val *v1, const struct f_val *v2);
 int val_compare(const struct f_val *v1, const struct f_val *v2);
@@ -314,7 +326,7 @@ undef_value(struct f_val v)
     (v.val.ad == &null_adata);
 }
 
-extern const struct f_val f_const_empty_path, f_const_empty_clist, f_const_empty_eclist, f_const_empty_lclist, f_const_empty_prefix_set;
+extern const struct f_val f_const_empty_prefix_set;
 
 enum filter_return f_eval(const struct f_line *expr, struct linpool *tmp_pool, struct f_val *pres);