packet: fix strange flow spec fragment keywords

"not-a-fragment" and "is-a-fragment" are renamed to "dont-fragment"
and "is-fragment" respectively.

Signed-off-by: FUJITA Tomonori <[email protected]>
This commit is contained in:
FUJITA Tomonori
2016-02-25 18:28:21 +09:00
parent 633e14d4d7
commit e97594e021
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ CLI syntax to add flowspec is
protocol <PROTO>... | fragment <FRAGMENT_TYPE> | tcp-flags <TCPFLAG>... |
{ port | destination-port | source-port | icmp-type | icmp-code | packet-length | dscp } <ITEM>... }...
<PROTO> : ipip, sctp, unknown, igmp, tcp, egp, rsvp, pim, icmp, igp, udp, gre, ospf
<FRAGMENT_TYPE> : not-a-fragment, is-a-fragment, first-fragment, last-fragment
<FRAGMENT_TYPE> : dont-fragment, is-fragment, first-fragment, last-fragment
<TCPFLAG> : push, ack, urgent, fin, syn, rst
<ITEM> : &?{<|>|=}<value>
<THEN_EXPR> : { accept | discard | rate-limit <value> | redirect <RT> | mark <value> | action { sample | terminal | sample-terminal } | rt <RT>... }...
+1 -1
View File
@@ -657,7 +657,7 @@ usage: %s rib %s match <MATCH_EXPR> then <THEN_EXPR> -a %%s
%s <PROTO>... | %s <FRAGMENT_TYPE> | %s [not] [match] <TCPFLAG>... |
{ %s | %s | %s | %s | %s | %s | %s | %s } <ITEM>... }...
<PROTO> : %s
<FRAGMENT_TYPE> : not-a-fragment, is-a-fragment, first-fragment, last-fragment
<FRAGMENT_TYPE> : dont-fragment, is-fragment, first-fragment, last-fragment
<TCPFLAG> : %s
<ITEM> : &?{<|>|=}<value>
<THEN_EXPR> : { %s | %s | %s <value> | %s <RT> | %s <value> | %s { sample | terminal | sample-terminal } | %s <RT>... }...
+5 -5
View File
@@ -2268,12 +2268,12 @@ func flowSpecFragmentParser(rf RouteFamily, args []string) (FlowSpecComponentInt
value := 0
for _, a := range args[1:] {
switch a {
case "not-a-fragment":
case "dont-fragment":
if afi, _ := RouteFamilyToAfiSafi(rf); afi == AFI_IP6 {
return nil, fmt.Errorf("can't specify not-a-fragment for ipv6")
return nil, fmt.Errorf("can't specify dont-fragment for ipv6")
}
value |= 0x1
case "is-a-fragment":
case "is-fragment":
value |= 0x2
case "first-fragment":
value |= 0x4
@@ -2630,10 +2630,10 @@ func formatFlag(op int, value int) string {
func formatFragment(op int, value int) string {
ss := make([]string, 0, 4)
if value&0x1 > 0 {
ss = append(ss, "not-a-fragment")
ss = append(ss, "dont-fragment")
}
if value&0x2 > 0 {
ss = append(ss, "is-a-fragment")
ss = append(ss, "is-fragment")
}
if value&0x4 > 0 {
ss = append(ss, "first-fragment")