Drop DX packets (DX de ...)

This commit is contained in:
Heikki Hannikainen 2013-12-19 22:51:38 +02:00
parent cf6f6e2ed7
commit f08cee43bc
5 changed files with 15 additions and 3 deletions

View File

@ -77,7 +77,8 @@ const char *inerr_labels[] = {
"q_nonval_multi_q_calls",
"q_i_no_viacall",
"inerr_empty",
"dis_srccall"
"disallow_srccall",
"disallow_dx"
};
#define incoming_strerror(i) ((i <= 0 && i >= INERR_MIN) ? inerr_labels[i * -1] : inerr_labels[0])

View File

@ -1216,6 +1216,12 @@ static int parse_aprs_body(struct pbuf_t *pb, const char *info_start)
return parse_aprs_item(pb, body, body_end);
}
return 0;
case 'D':
/* we drop DX beacon packets, they start with "DX de " */
if (strncmp(body, "X de ", 5) == 0)
return INERR_DIS_DX;
break;
case 'T':
if (body_end - body > 18) {

View File

@ -219,7 +219,9 @@ var rx_err_strings = {
"q_newq_buffer_small": 'New Q construct too big',
"q_nonval_multi_q_calls": 'Multiple callsigns in Q path from unverified client',
"q_i_no_viacall": 'I path has no viacall',
"inerr_empty": 'Empty packet'
"inerr_empty": 'Empty packet',
"disallow_srcall": 'Disallowed source callsign (N0CALL or such)',
"disallow_dx": 'DX beacon packet'
};
var key_translate = {

View File

@ -219,8 +219,9 @@ struct client_heard_t {
#define INERR_Q_I_NO_VIACALL -30
#define INERR_EMPTY -31
#define INERR_DIS_SRCCALL -32
#define INERR_DIS_DX -33
#define INERR_MIN -32 /* MINIMUM VALUE FOR INERR, GROW WHEN NEEDED! */
#define INERR_MIN -33 /* MINIMUM VALUE FOR INERR, GROW WHEN NEEDED! */
/* WHEN ADDING STUFF HERE, REMEMBER TO UPDATE inerr_labels IN incoming.c. Thanks! */
#define INERR_BUCKETS (INERR_MIN*-1 + 1)

View File

@ -85,6 +85,8 @@ my @pkts = (
"N0CALL>DST,DIGI,qAR,$login:>should drop, N0CALL as source callsign",
"NOCALL>DST,DIGI,qAR,$login:>should drop, NOCALL as source callsign",
"SERVER>DST,DIGI,qAR,$login:>should drop, SERVER as source callsign",
# DX spots
"SRC>DST,DIGI,qAR,$login:DX de FOO: BAR - should drop",
);
# send the packets