Lines Matching defs:ctx
50 struct cbctx *ctx = (struct cbctx *)_ctx;
52 int parse_key = (ctx->flags & HKF_WANT_PARSE_KEY) != 0;
53 const int matching = (ctx->flags & HKF_WANT_MATCH) != 0;
58 ctx->i + 1, ctx->nexpected, l->linenum);
61 ASSERT_SIZE_T_LT(ctx->i, ctx->nexpected);
62 expected = ctx->expected + ctx->i++;
66 if (ctx->match_host_p && expected->match_host_p)
68 if (ctx->match_host_s && expected->match_host_s)
70 if (ctx->match_ipv4 && expected->match_ipv4)
72 if (ctx->match_ipv6 && expected->match_ipv6)
79 if (ctx->x && expected->x) { \
876 struct cbctx ctx;
879 memset(&ctx, 0, sizeof(ctx));
880 ctx.expected = expected_full;
881 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
882 ctx.flags = HKF_WANT_PARSE_KEY;
883 prepare_expected(expected_full, ctx.nexpected);
885 check, &ctx, NULL, NULL, ctx.flags, 0), 0);
886 cleanup_expected(expected_full, ctx.nexpected);
890 memset(&ctx, 0, sizeof(ctx));
891 ctx.expected = expected_full;
892 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
893 ctx.flags = 0;
894 prepare_expected(expected_full, ctx.nexpected);
896 check, &ctx, NULL, NULL, ctx.flags, 0), 0);
897 cleanup_expected(expected_full, ctx.nexpected);
901 memset(&ctx, 0, sizeof(ctx));
902 ctx.expected = expected_full;
903 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
904 ctx.flags = 0;
905 ctx.match_host_p = 1;
906 prepare_expected(expected_full, ctx.nexpected);
908 check, &ctx, "prometheus.example.com", NULL, ctx.flags, 0), 0);
909 cleanup_expected(expected_full, ctx.nexpected);
913 memset(&ctx, 0, sizeof(ctx));
914 ctx.expected = expected_full;
915 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
916 ctx.flags = 0;
917 ctx.match_host_s = 1;
918 prepare_expected(expected_full, ctx.nexpected);
920 check, &ctx, "sisyphus.example.com", NULL, ctx.flags, 0), 0);
921 cleanup_expected(expected_full, ctx.nexpected);
925 memset(&ctx, 0, sizeof(ctx));
926 ctx.expected = expected_full;
927 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
928 ctx.flags = HKF_WANT_MATCH;
929 ctx.match_host_p = 1;
930 prepare_expected(expected_full, ctx.nexpected);
932 check, &ctx, "prometheus.example.com", NULL, ctx.flags, 0), 0);
933 cleanup_expected(expected_full, ctx.nexpected);
937 memset(&ctx, 0, sizeof(ctx));
938 ctx.expected = expected_full;
939 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
940 ctx.flags = HKF_WANT_MATCH;
941 ctx.match_host_s = 1;
942 prepare_expected(expected_full, ctx.nexpected);
944 check, &ctx, "sisyphus.example.com", NULL, ctx.flags, 0), 0);
945 cleanup_expected(expected_full, ctx.nexpected);
949 memset(&ctx, 0, sizeof(ctx));
950 ctx.expected = expected_full;
951 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
952 ctx.flags = 0;
953 prepare_expected(expected_full, ctx.nexpected);
955 check, &ctx, "actaeon.example.org", NULL, ctx.flags, 0), 0);
956 cleanup_expected(expected_full, ctx.nexpected);
960 memset(&ctx, 0, sizeof(ctx));
961 ctx.expected = expected_full;
962 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
963 ctx.flags = HKF_WANT_MATCH;
964 prepare_expected(expected_full, ctx.nexpected);
966 check, &ctx, "actaeon.example.org", NULL, ctx.flags, 0), 0);
967 cleanup_expected(expected_full, ctx.nexpected);
971 memset(&ctx, 0, sizeof(ctx));
972 ctx.expected = expected_full;
973 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
974 ctx.flags = 0;
975 ctx.match_ipv4 = 1;
976 prepare_expected(expected_full, ctx.nexpected);
978 check, &ctx, "tiresias.example.org", "192.0.2.1", ctx.flags, 0), 0);
979 cleanup_expected(expected_full, ctx.nexpected);
983 memset(&ctx, 0, sizeof(ctx));
984 ctx.expected = expected_full;
985 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
986 ctx.flags = 0;
987 ctx.match_ipv6 = 1;
988 prepare_expected(expected_full, ctx.nexpected);
990 check, &ctx, "tiresias.example.org", "2001:db8::1",
991 ctx.flags, 0), 0);
992 cleanup_expected(expected_full, ctx.nexpected);
996 memset(&ctx, 0, sizeof(ctx));
997 ctx.expected = expected_full;
998 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
999 ctx.flags = HKF_WANT_MATCH;
1000 ctx.match_ipv4 = 1;
1001 prepare_expected(expected_full, ctx.nexpected);
1003 check, &ctx, "tiresias.example.org", "192.0.2.1", ctx.flags, 0), 0);
1004 cleanup_expected(expected_full, ctx.nexpected);
1008 memset(&ctx, 0, sizeof(ctx));
1009 ctx.expected = expected_full;
1010 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
1011 ctx.flags = HKF_WANT_MATCH;
1012 ctx.match_ipv6 = 1;
1013 prepare_expected(expected_full, ctx.nexpected);
1015 check, &ctx, "tiresias.example.org", "2001:db8::1",
1016 ctx.flags, 0), 0);
1017 cleanup_expected(expected_full, ctx.nexpected);
1021 memset(&ctx, 0, sizeof(ctx));
1022 ctx.expected = expected_full;
1023 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
1024 ctx.flags = 0;
1025 prepare_expected(expected_full, ctx.nexpected);
1027 check, &ctx, "tiresias.example.org", "192.168.0.1",
1028 ctx.flags, 0), 0);
1029 cleanup_expected(expected_full, ctx.nexpected);
1033 memset(&ctx, 0, sizeof(ctx));
1034 ctx.expected = expected_full;
1035 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
1036 ctx.flags = HKF_WANT_MATCH;
1037 prepare_expected(expected_full, ctx.nexpected);
1039 check, &ctx, "tiresias.example.org", "::1", ctx.flags, 0), 0);
1040 cleanup_expected(expected_full, ctx.nexpected);
1044 memset(&ctx, 0, sizeof(ctx));
1045 ctx.expected = expected_full;
1046 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
1047 ctx.flags = 0;
1048 ctx.match_host_s = 1;
1049 ctx.match_ipv4 = 1;
1050 prepare_expected(expected_full, ctx.nexpected);
1052 check, &ctx, "sisyphus.example.com", "192.0.2.1", ctx.flags, 0), 0);
1053 cleanup_expected(expected_full, ctx.nexpected);
1057 memset(&ctx, 0, sizeof(ctx));
1058 ctx.expected = expected_full;
1059 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
1060 ctx.flags = HKF_WANT_MATCH;
1061 ctx.match_host_p = 1;
1062 ctx.match_ipv6 = 1;
1063 prepare_expected(expected_full, ctx.nexpected);
1065 check, &ctx, "prometheus.example.com",
1066 "2001:db8::1", ctx.flags, 0), 0);
1067 cleanup_expected(expected_full, ctx.nexpected);
1071 memset(&ctx, 0, sizeof(ctx));
1072 ctx.expected = expected_full;
1073 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
1074 ctx.flags = HKF_WANT_PARSE_KEY;
1075 ctx.match_host_s = 1;
1076 ctx.match_ipv4 = 1;
1077 prepare_expected(expected_full, ctx.nexpected);
1079 check, &ctx, "sisyphus.example.com", "192.0.2.1", ctx.flags, 0), 0);
1080 cleanup_expected(expected_full, ctx.nexpected);
1084 memset(&ctx, 0, sizeof(ctx));
1085 ctx.expected = expected_full;
1086 ctx.nexpected = sizeof(expected_full)/sizeof(*expected_full);
1087 ctx.flags = HKF_WANT_MATCH|HKF_WANT_PARSE_KEY;
1088 ctx.match_host_p = 1;
1089 ctx.match_ipv6 = 1;
1090 prepare_expected(expected_full, ctx.nexpected);
1092 check, &ctx, "prometheus.example.com",
1093 "2001:db8::1", ctx.flags, 0), 0);
1094 cleanup_expected(expected_full, ctx.nexpected);