Age | Commit message (Collapse) | Author |
|
currently wrongly try to match prefixset for v4 to v6 routes, and vice versa.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
len(cur)-len(ps) is negative if the caller tries to remove more than
currently assigned policies.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
|
|
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
|
|
when multiple policies with modification actions are configured, use a path
structure which was applied to the previous policy.
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
|
|
when rpki validation condition is not configured ( c == "" ), don't
create an instance for validation.
this bug was breaking all policy mechanism when rpki server is configured.
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
|
|
before:
```yaml
actions:
route-disposition:
accept-route: true
reject-route: false
```
after
```yaml
action:
router-disposition: accept-route
```
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
|
|
policy can have multiple statements. In each statement, when condition
is matched, route-action is finally evaluated after actions with mods.
When route-action is 'none', we contine to next statement if it exists.
When route-action is 'accept' or 'reject', we stop proceeding.
This patch fixes a bug that route-action can't be set to 'none' which
means route-action always be set to 'accept' or 'reject' and can't proceed
to the next statement.
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
|
|
close #1133
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
|
|
fix handling of prefix-match configuration like below
[[defined-sets.prefix-sets]]
prefix-set-name = "ps1"
[[defined-sets.prefix-sets.prefix-list]]
ip-prefix = "0.0.0.0/0"
masklength-range = "0..7"
[[defined-sets.prefix-sets.prefix-list]]
ip-prefix = "0.0.0.0/0"
masklength-range = "25..32"
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
|
|
MED actions are expected to be int64 and AS are expected to be
uint32. Use ParseInt/ParseUint instead of Atoi for those until the tests
pass on ARM.
|
|
Allow all routes coming in and going out by default
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
// match with routes locally generated
$ gobgp policy statement s0 add condition route-type local
// match with routes received from eBGP peers
$ gobgp policy statement s0 add condition route-type external
// match with routes received from iBGP peers
$ gobgp policy statement s0 add condition route-type internal
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
All the exported methods are properly serialized with mutex.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
It's more logical.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: dsp <dsp@2f30.org>
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Preparation for removing gRPC dependency.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
from configuration file
[policy-definitions.statements.actions.bgp-actions]
set-next-hop = "self"
from cli
$ gobgp policy statement stmt1 add action next-hop self
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
$ gobgp policy statement st01 add action local-pref 110
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
following as-path pattern will be optimized
- ^<asn>_ # left-most
- _<asn>$ # origin
- _<asn>_ # include
- ^<asn>$ # only
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
|
|
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
This reverts commit 76525a966bdfdfd10195e72fffcffbc3a6c69d78.
|
|
cli output of community strings
|
|
Later, we move non-bgp protocol stuff like mrt under their own
direcotries.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
https://github.com/osrg/gobgp/issues/754
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Since communities/ext-communities are tested one by one in policy-condition,
we don't need '^' and '$' around match condition items.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
the result of memory profile (500 route-server-clients each of them
advertises 100 routes)
before:
(pprof) top5
3913.02MB of 3978.69MB total (98.35%)
Dropped 148 nodes (cum <= 19.89MB)
Showing top 10 nodes out of 11 (cum >= 21MB)
flat flat% sum% cum cum%
2970.30MB 74.66% 74.66% 2975.80MB 74.79% github.com/osrg/gobgp/server.filterpath
810.09MB 20.36% 95.02% 810.59MB 20.37% github.com/osrg/gobgp/table.(*AdjRib).Update
115.60MB 2.91% 97.92% 119.10MB 2.99% github.com/osrg/gobgp/table.createUpdateMsgFromPath
10MB 0.25% 98.17% 1878.02MB 47.20% github.com/osrg/gobgp/server.(*BgpServer).propagateUpdate
4.50MB 0.11% 98.29% 144.60MB 3.63% github.com/osrg/gobgp/table.CreateUpdateMsgFromPaths
after:
(pprof) top5
1259.49MB of 1284.27MB total (98.07%)
Dropped 175 nodes (cum <= 6.42MB)
Showing top 10 nodes out of 26 (cum >= 36.51MB)
flat flat% sum% cum cum%
975.81MB 75.98% 75.98% 976.31MB 76.02% github.com/osrg/gobgp/table.(*AdjRib).Update
198.67MB 15.47% 91.45% 208.17MB 16.21% github.com/osrg/gobgp/table.createUpdateMsgFromPath
22MB 1.71% 93.16% 22MB 1.71% github.com/osrg/gobgp/packet.(*IPAddrPrefix).Serialize
20MB 1.56% 94.72% 707.19MB 55.07% github.com/osrg/gobgp/server.(*BgpServer).propagateUpdate
13.50MB 1.05% 95.77% 13.50MB 1.05% github.com/osrg/gobgp/table.NewPath
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
the result of memory profile (500 route-server-clients each of them advertises
100 routes)
before:
(pprof) top5
9330.48MB of 9367.53MB total (99.60%)
Dropped 157 nodes (cum <= 46.84MB)
Showing top 10 nodes out of 17 (cum >= 9334.17MB)
flat flat% sum% cum cum%
6163.04MB 65.79% 65.79% 6163.04MB 65.79% github.com/osrg/gobgp/table.NewPath
1155.05MB 12.33% 78.12% 7302.59MB 77.96% github.com/osrg/gobgp/table.(*Path).Clone
986.31MB 10.53% 88.65% 1388.81MB 14.83% github.com/osrg/gobgp/table.(*AdjRib).Update
402.51MB 4.30% 92.95% 402.51MB 4.30% fmt.Sprintf
402.51MB 4.30% 97.24% 402.51MB 4.30% net.parseIPv4
after:
(pprof) top
3913.02MB of 3978.69MB total (98.35%)
Dropped 148 nodes (cum <= 19.89MB)
Showing top 10 nodes out of 11 (cum >= 21MB)
flat flat% sum% cum cum%
2970.30MB 74.66% 74.66% 2975.80MB 74.79% github.com/osrg/gobgp/server.filterpath
810.09MB 20.36% 95.02% 810.59MB 20.37% github.com/osrg/gobgp/table.(*AdjRib).Update
115.60MB 2.91% 97.92% 119.10MB 2.99% github.com/osrg/gobgp/table.createUpdateMsgFromPath
10MB 0.25% 98.17% 1878.02MB 47.20% github.com/osrg/gobgp/server.(*BgpServer).propagateUpdate
4.50MB 0.11% 98.29% 144.60MB 3.63% github.com/osrg/gobgp/table.CreateUpdateMsgFromPaths
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
you can implement
https://tools.ietf.org/html/draft-kklf-sidr-route-server-rpki-light-00
by following commands
$ gobgp policy statement st0 add condition rpki valid
$ gobgp policy statement st0 add action ext-community add valid
$ gobgp policy statement st1 add condition rpki not-found
$ gobgp policy statement st1 add action ext-community add not-found
$ gobgp policy statement st2 add condition rpki invalid
$ gobgp policy statement st2 add action ext-community add invalid
$ gobgp policy p0 add st0 st1 st2
$ gobgp policy p0
Name p0:
StatementName st0:
Conditions:
RPKI result: valid
Actions:
ExtCommunity: COMMUNITY_ADD[valid]
NONE
StatementName st1:
Conditions:
RPKI result: not-found
Actions:
ExtCommunity: COMMUNITY_ADD[not-found]
NONE
StatementName st2:
Conditions:
RPKI result: invalid
Actions:
ExtCommunity: COMMUNITY_ADD[invalid]
NONE
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
- change config variable name to chaincase from camelcase
- remove unnecessary wrapper structs which only contain one slice field
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
use for the translation between api structs
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
pyang has an internal flag "multiple_modules" to handle multiple yang modules.
use it instead of introducing a new option --augment
also, fix warnings and errors in gobgp.yang which were there but not has been
detected for a while due to the usage of --augment.
by using "multiple_modules" flag, pyang detected them.
most notable error is wrong usage of list, which needs a key in its
substatement.
this patch adds key to some of them, and for others uses leaf-list
instead.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Sprintf() to stringify Fields is heavy
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
// toml by default
$ gobgpd -f gobgpd.toml
// use -t to change configuration type
$ gobgpd -t yaml -f gobgpd.yaml
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
RouteAction is interface. we have to check the contained value is also
nil.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
speed up and reduce memory footprint
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
GetAsSeqList() is used for AsPathSet matching and AsPathPrepend action.
Just eliminating non-seq-as-elems from what GetAsSeqList() returns cause
wrong results for these two match/action.
e.g path A's as-path: {100, 200} 300
currently, action 'as-path-prepend left-most repeat 2' will alter
as-path to 300 300 {100, 200} 300, which is not expected behavior.
To fix this, insert 0 for non-seq-as-elems.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|
|
when matching with single as-path, stop using regexp for speed up
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
|