#include <common/mini-clist.h>
#include <types/vars.h>
+#include <types/protocol_buffers.h>
/* encoding of each arg type : up to 31 types are supported */
#define ARGT_BITS 5
ARGT_MAP, /* a pointer to a map descriptor */
ARGT_REG, /* a pointer to a regex */
ARGT_VAR, /* contains a variable description. */
+ ARGT_PBUF_FNUM, /* a protocol buffer field number */
/* please update arg_type_names[] in args.c if you add entries here */
};
struct userlist *usr;
struct map_descriptor *map;
struct my_regex *reg;
+ struct pbuf_fid fid;
struct var_desc var;
};
--- /dev/null
+/*
+ * include/types/protocol_buffers.h
+ * This file contains structure declarations for protocol buffers.
+ *
+ * Copyright 2012 Willy Tarreau <w@1wt.eu>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _TYPES_PROTOCOL_BUFFERS_H
+#define _TYPES_PROTOCOL_BUFFERS_H
+
+struct pbuf_fid {
+ unsigned int *ids;
+ size_t sz;
+};
+
+#endif /* _TYPES_PROTOCOL_BUFFERS_H */
+
+/*
+ * Local variables:
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * End:
+ */
[ARGT_MAP] = "map",
[ARGT_REG] = "regex",
[ARGT_VAR] = "variable",
+ [ARGT_PBUF_FNUM] = "Protocol buffers field number",
/* Unassigned types must never happen. Better crash during parsing if they do. */
};
arg->type = ARGT_SINT;
break;
+ case ARGT_PBUF_FNUM:
+ if (!parse_dotted_uints(word, &arg->data.fid.ids, &arg->data.fid.sz))
+ goto parse_err;
+
+ break;
+
/* FIXME: other types need to be implemented here */
default:
goto not_impl;