static void rewrite(char *rule, char *addr, VSTRING *reply) { rewrite_clnt(rule, addr, reply); vstream_printf("%-10s %s\n", "rule", rule); vstream_printf("%-10s %s\n", "address", addr); vstream_printf("%-10s %s\n\n", "result", STR(reply)); vstream_fflush(VSTREAM_OUT); }
VSTRING *rewrite_clnt_internal(const char *ruleset, const char *addr, VSTRING *result) { VSTRING *src = vstring_alloc(100); VSTRING *dst = vstring_alloc(100); /* * Convert the address from internal address form to external RFC822 * form, then rewrite it. After rewriting, convert to internal form. */ quote_822_local(src, addr); rewrite_clnt(ruleset, STR(src), dst); unquote_822_local(result, STR(dst)); vstring_free(src); vstring_free(dst); return (result); }
void cleanup_rewrite_external(VSTRING *result, const char *addr) { rewrite_clnt(REWRITE_CANON, addr, result); }
int cleanup_rewrite_external(const char *context_name, VSTRING *result, const char *addr) { rewrite_clnt(context_name, addr, result); return (strcmp(STR(result), addr) != 0); }