mirror of
https://github.com/sheumann/hush.git
synced 2025-01-04 22:34:37 +00:00
- route metric support (Natanael Copa)
Adds about 75b
This commit is contained in:
parent
2239f81941
commit
578de8644c
@ -1992,7 +1992,8 @@
|
|||||||
" [oif STRING] [tos TOS]\n" \
|
" [oif STRING] [tos TOS]\n" \
|
||||||
"iproute { add | del | change | append | replace | monitor } ROUTE\n" \
|
"iproute { add | del | change | append | replace | monitor } ROUTE\n" \
|
||||||
" SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n" \
|
" SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n" \
|
||||||
" ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]" \
|
" ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]\n" \
|
||||||
|
" [metric METRIC]" \
|
||||||
|
|
||||||
#define iprule_trivial_usage \
|
#define iprule_trivial_usage \
|
||||||
"{[list | add | del] RULE}"
|
"{[list | add | del] RULE}"
|
||||||
|
@ -291,7 +291,7 @@ static int iproute_modify(int cmd, unsigned flags, char **argv)
|
|||||||
{
|
{
|
||||||
static const char keywords[] ALIGN1 =
|
static const char keywords[] ALIGN1 =
|
||||||
"src\0""via\0""mtu\0""lock\0""protocol\0"USE_FEATURE_IP_RULE("table\0")
|
"src\0""via\0""mtu\0""lock\0""protocol\0"USE_FEATURE_IP_RULE("table\0")
|
||||||
"dev\0""oif\0""to\0";
|
"dev\0""oif\0""to\0""metric\0";
|
||||||
enum {
|
enum {
|
||||||
ARG_src,
|
ARG_src,
|
||||||
ARG_via,
|
ARG_via,
|
||||||
@ -300,7 +300,8 @@ static int iproute_modify(int cmd, unsigned flags, char **argv)
|
|||||||
USE_FEATURE_IP_RULE(ARG_table,)
|
USE_FEATURE_IP_RULE(ARG_table,)
|
||||||
ARG_dev,
|
ARG_dev,
|
||||||
ARG_oif,
|
ARG_oif,
|
||||||
ARG_to
|
ARG_to,
|
||||||
|
ARG_metric,
|
||||||
};
|
};
|
||||||
enum {
|
enum {
|
||||||
gw_ok = 1 << 0,
|
gw_ok = 1 << 0,
|
||||||
@ -387,6 +388,12 @@ USE_FEATURE_IP_RULE(ARG_table,)
|
|||||||
} else if (arg == ARG_dev || arg == ARG_oif) {
|
} else if (arg == ARG_dev || arg == ARG_oif) {
|
||||||
NEXT_ARG();
|
NEXT_ARG();
|
||||||
d = *argv;
|
d = *argv;
|
||||||
|
} else if (arg == ARG_metric) {
|
||||||
|
uint32_t metric;
|
||||||
|
NEXT_ARG();
|
||||||
|
if (get_u32(&metric, *argv, 0))
|
||||||
|
invarg(*argv, "metric");
|
||||||
|
addattr32(&req.n, sizeof(req), RTA_PRIORITY, metric);
|
||||||
} else {
|
} else {
|
||||||
int type;
|
int type;
|
||||||
inet_prefix dst;
|
inet_prefix dst;
|
||||||
|
Loading…
Reference in New Issue
Block a user