Lines Matching defs:table

111 static struct table	*table = NULL;
137 struct table *table_inherit(struct table *);
149 struct table *table;
185 %type <v.string> context hostname interface table value path
196 %type <v.table> tablespec
373 table->sendbuf = NULL;
376 table->sendbuf = strdup($1);
377 if (table->sendbuf == NULL)
384 table->sendbinbuf = NULL;
392 table->sendbuf = strdup($1);
393 if (table->sendbuf == NULL)
395 table->sendbinbuf = string2binary($1);
396 if (table->sendbinbuf == NULL)
508 if (rdr->table == NULL) {
509 yyerror("redirection %s has no table",
524 rdr->table->conf.port) {
526 "ports for its table and backup table",
582 yyerror("table %s has no check", $3->conf.name);
587 yyerror("only one backup table is allowed");
591 if (rdr->table) {
595 yyerror("backup table for %s with "
600 rdr->table = $3;
665 table : '<' STRING '>' {
667 yyerror("invalid table name");
675 tabledef : TABLE table {
676 struct table *tb;
687 yyerror("table %s defined twice", $2);
697 yyerror("table name truncated");
707 table = tb;
710 if (TAILQ_EMPTY(&table->hosts)) {
711 yyerror("table %s has no hosts",
712 table->conf.name);
716 TAILQ_INSERT_TAIL(conf->sc_tables, table, entry);
724 tabledefopts : DISABLE { table->conf.flags |= F_DISABLE; }
733 $1->conf.tableid = table->conf.id;
734 $1->tablename = table->conf.name;
735 TAILQ_INSERT_TAIL(&table->hosts, $1, entry);
740 tablespec : table {
741 struct table *tb;
746 yyerror("table name truncated");
751 table = tb;
755 struct table *tb;
756 if (table->conf.port == 0)
757 table->conf.port = tableport;
759 table->conf.flags |= F_PORT;
760 if ((tb = table_inherit(table)) == NULL)
776 table->conf.port = $1.val[0];
779 bcopy(&$2, &table->conf.timeout,
783 table->conf.flags |= F_DEMOTE;
784 if (strlcpy(table->conf.demote_group, $2,
785 sizeof(table->conf.demote_group))
786 >= sizeof(table->conf.demote_group)) {
792 if (carp_demote_init(table->conf.demote_group, 1)
795 "'%s'", table->conf.demote_group);
802 yyerror("table interval must be "
806 table->conf.skip_cnt =
903 tablecheck : ICMP { table->conf.check = CHECK_ICMP; }
904 | TCP { table->conf.check = CHECK_TCP; }
906 table->conf.check = CHECK_TCP;
908 table->conf.flags |= F_TLS;
913 table->conf.flags |= F_TLS;
915 table->conf.check = CHECK_HTTP_CODE;
916 if ((table->conf.retcode = $5) <= 0) {
922 if (asprintf(&table->sendbuf,
928 if (table->sendbuf == NULL)
934 table->conf.flags |= F_TLS;
936 table->conf.check = CHECK_HTTP_DIGEST;
937 if (asprintf(&table->sendbuf,
943 if (table->sendbuf == NULL)
945 if (strlcpy(table->conf.digest, $4.digest,
946 sizeof(table->conf.digest)) >=
947 sizeof(table->conf.digest)) {
952 table->conf.digest_type = $4.type;
956 table->conf.check = CHECK_SEND_EXPECT;
959 table->conf.flags |= F_TLS;
961 if (strlcpy(table->conf.exbuf, $4,
962 sizeof(table->conf.exbuf))
963 >= sizeof(table->conf.exbuf)) {
968 translate_string(table->conf.exbuf);
972 table->conf.check = CHECK_BINSEND_EXPECT;
975 table->conf.flags |= F_TLS;
982 if (strlcpy(table->conf.exbuf, $5,
983 sizeof(table->conf.exbuf))
984 >= sizeof(table->conf.exbuf)) {
996 memcpy(table->conf.exbinbuf, ibuf_data(ibuf),
1002 table->conf.check = CHECK_SCRIPT;
1003 if (strlcpy(table->conf.path, $2,
1004 sizeof(table->conf.path)) >=
1005 sizeof(table->conf.path)) {
1643 | FORWARD TO table {
1645 yyerror("undefined forward table");
1652 yyerror("invalid forward table name");
1859 "or table", rlay->rl_conf.name);
2027 yyerror("failed to allocate table reference");
2155 yyerror("router %s table already specified",
2497 { "table", TABLE },
2904 struct table *nexttb;
2917 table = NULL;
2972 /* Verify that every table is used */
2973 for (table = TAILQ_FIRST(conf->sc_tables); table != NULL;
2974 table = nexttb) {
2975 nexttb = TAILQ_NEXT(table, entry);
2976 if (table->conf.port == 0) {
2977 TAILQ_REMOVE(conf->sc_tables, table, entry);
2978 while ((h = TAILQ_FIRST(&table->hosts)) != NULL) {
2979 TAILQ_REMOVE(&table->hosts, h, entry);
2982 if (table->sendbuf != NULL)
2983 free(table->sendbuf);
2984 if (table->sendbinbuf != NULL)
2985 ibuf_free(table->sendbinbuf);
2986 free(table);
2990 TAILQ_FOREACH(h, &table->hosts, entry) {
3009 if (!(table->conf.flags & F_USED)) {
3010 log_warnx("unused table: %s", table->conf.name);
3013 if (timercmp(&table->conf.timeout,
3015 log_warnx("table timeout exceeds interval: %s",
3016 table->conf.name);
3293 struct table *
3294 table_inherit(struct table *tb)
3298 struct table *dsttb, *oldtb;
3300 /* Get the table or table template */
3302 yyerror("unknown table %s", tb->conf.name);
3306 fatal("invalid table"); /* should not happen */
3313 /* Check if a matching table already exists */
3316 yyerror("invalid table name");
3321 yyerror("invalid table mame");
3329 /* Create a new table */
3337 /* Inherit global table options */
3429 yyerror("cannot allocate relay table");