summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/src/exim.c12
-rw-r--r--src/src/functions.h1
-rw-r--r--src/src/ip.c44
-rw-r--r--src/src/smtp_out.c2
4 files changed, 38 insertions, 21 deletions
diff --git a/src/src/exim.c b/src/src/exim.c
index 9f6f3d8c3..d20f938e6 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -57,7 +57,7 @@ store_free(block);
*************************************************/
enum commandline_info { CMDINFO_NONE=0,
- CMDINFO_HELP, CMDINFO_SIEVE };
+ CMDINFO_HELP, CMDINFO_SIEVE, CMDINFO_DSCP };
@@ -1044,6 +1044,7 @@ switch(request)
"If the string is not recognised, you'll get this help (on stderr).\n"
"\n"
" exim -bI:help this information\n"
+" exim -bI:dscp dscp value keywords known\n"
" exim -bI:sieve list of supported sieve extensions, one per line.\n"
);
return;
@@ -1051,7 +1052,9 @@ switch(request)
for (pp = exim_sieve_extension_list; *pp; ++pp)
fprintf(stream, "%s\n", *pp);
return;
-
+ case CMDINFO_DSCP:
+ dscp_list_to_stream(stream);
+ return;
}
}
@@ -1987,6 +1990,11 @@ for (i = 1; i < argc; i++)
info_flag = CMDINFO_SIEVE;
info_stdout = TRUE;
}
+ else if (strcmpic(p, CUS"dscp") == 0)
+ {
+ info_flag = CMDINFO_DSCP;
+ info_stdout = TRUE;
+ }
else if (strcmpic(p, CUS"help") == 0)
{
info_stdout = TRUE;
diff --git a/src/src/functions.h b/src/src/functions.h
index dd9549b18..7fea6ff5c 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -109,6 +109,7 @@ extern int dns_lookup(dns_answer *, uschar *, int, uschar **);
extern int dns_special_lookup(dns_answer *, uschar *, int, uschar **);
extern dns_record *dns_next_rr(dns_answer *, dns_scan *, int);
extern uschar *dns_text_type(int);
+extern void dscp_list_to_stream(FILE *);
extern BOOL dscp_lookup(const uschar *, int, int *, int *, int *);
extern void enq_end(uschar *);
diff --git a/src/src/ip.c b/src/src/ip.c
index 66a750dfd..be4511dfa 100644
--- a/src/src/ip.c
+++ b/src/src/ip.c
@@ -372,29 +372,29 @@ struct dscp_name_tableentry {
/* Keep both of these tables sorted! */
static struct dscp_name_tableentry dscp_table[] = {
#ifdef IPTOS_DSCP_AF11
- { "af11", IPTOS_DSCP_AF11 },
- { "af12", IPTOS_DSCP_AF12 },
- { "af13", IPTOS_DSCP_AF13 },
- { "af21", IPTOS_DSCP_AF21 },
- { "af22", IPTOS_DSCP_AF22 },
- { "af23", IPTOS_DSCP_AF23 },
- { "af31", IPTOS_DSCP_AF31 },
- { "af32", IPTOS_DSCP_AF32 },
- { "af33", IPTOS_DSCP_AF33 },
- { "af41", IPTOS_DSCP_AF41 },
- { "af42", IPTOS_DSCP_AF42 },
- { "af43", IPTOS_DSCP_AF43 },
- { "ef", IPTOS_DSCP_EF },
+ { CUS"af11", IPTOS_DSCP_AF11 },
+ { CUS"af12", IPTOS_DSCP_AF12 },
+ { CUS"af13", IPTOS_DSCP_AF13 },
+ { CUS"af21", IPTOS_DSCP_AF21 },
+ { CUS"af22", IPTOS_DSCP_AF22 },
+ { CUS"af23", IPTOS_DSCP_AF23 },
+ { CUS"af31", IPTOS_DSCP_AF31 },
+ { CUS"af32", IPTOS_DSCP_AF32 },
+ { CUS"af33", IPTOS_DSCP_AF33 },
+ { CUS"af41", IPTOS_DSCP_AF41 },
+ { CUS"af42", IPTOS_DSCP_AF42 },
+ { CUS"af43", IPTOS_DSCP_AF43 },
+ { CUS"ef", IPTOS_DSCP_EF },
#endif
#ifdef IPTOS_LOWCOST
- { "lowcost", IPTOS_LOWCOST },
+ { CUS"lowcost", IPTOS_LOWCOST },
#endif
- { "lowdelay", IPTOS_LOWDELAY },
+ { CUS"lowdelay", IPTOS_LOWDELAY },
#ifdef IPTOS_MINCOST
- { "mincost", IPTOS_MINCOST },
+ { CUS"mincost", IPTOS_MINCOST },
#endif
- { "reliability", IPTOS_RELIABILITY },
- { "throughput", IPTOS_THROUGHPUT }
+ { CUS"reliability", IPTOS_RELIABILITY },
+ { CUS"throughput", IPTOS_THROUGHPUT }
};
static int dscp_table_size =
sizeof(dscp_table) / sizeof(struct dscp_name_tableentry);
@@ -468,5 +468,13 @@ while (last > first)
return FALSE;
}
+void
+dscp_list_to_stream(FILE *stream)
+{
+int i;
+for (i=0; i < dscp_table_size; ++i)
+ fprintf(stream, "%s\n", dscp_table[i].name);
+}
+
/* End of ip.c */
diff --git a/src/src/smtp_out.c b/src/src/smtp_out.c
index 7b58b4a74..42a889aa6 100644
--- a/src/src/smtp_out.c
+++ b/src/src/smtp_out.c
@@ -212,7 +212,7 @@ bomb out, just log it and continue in default traffic class. */
if (dscp && dscp_lookup(dscp, host_af, &dscp_level, &dscp_option, &dscp_value))
{
HDEBUG(D_transport|D_acl|D_v)
- debug_printf("DSCP \"%s\"=%d ", dscp, dscp_value);
+ debug_printf("DSCP \"%s\"=%x ", dscp, dscp_value);
if (setsockopt(sock, dscp_level, dscp_option, &dscp_value, sizeof(dscp_value)) < 0)
HDEBUG(D_transport|D_acl|D_v)
debug_printf("failed to set DSCP: %s ", strerror(errno));