summaryrefslogtreecommitdiffhomepage
path: root/tools/pyang_plugins/bgpyang2golang.py
AgeCommit message (Collapse)Author
2019-07-12use tha standard comment for machine-generated filesFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-01-09silence staticcheck warningsFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2018-11-07api: fix regression that match set option has no default valueoc
The commit 000589f3c "api: Implement UpdatePolicy()" introduced a regression: if match-set-options is not defined in config file, gobgpd starts with error: failed to get policy info: not found... This fix set match-set-options to default when needed.
2018-09-12pyang_plugins: Fix an import pathIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-09-12pyang_plugins: Improve pylint and pycodestyle resultsIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-09-14config: Introduce Family field into AfiSafiStateIWASE Yusuke
To reduce the translations of "AfiSafiName" into "bgp.RouteFamily", this patch introduces "Family" field into "AfiSafiState" and stores the translated value. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-07-26config: Insert descriptions extracted from yang filesIWASE Yusuke
This patch fixes pyang_plugins to insert the descriptions which extracted from yang files and helps to enrich the documentation (e.g., godoc). Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-07-26pyang_plugins: RefactorIWASE Yusuke
This patch improves the result of pylint and pep8 checks. For example, this patch fixes; - "multiple_modules" attribute of "GolangPlugin" defined in out-side of "__init__()". - "module" shadows built-in name. - missing whitespace around operator. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-07-26pyang_plugins: Replace map() with list comprehensionIWASE Yusuke
Mostly, using the list comprehension is more efficiently than map() with "lambda". This patch replaces map() + "lambda" by the list comprehension. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-07-26pyang_plugins: Use file descriptor passed to pluginIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2016-11-17config: simplify route-disposition configurationWataru Ishida
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>
2016-11-14config: add json tag for config structuresWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-11-14config: use struct type instead of []byte for capability and open msgWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-11-14config: delete Equal() method for State structuresWataru Ishida
we only use Equal() method for configuration structures Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-07-20remove gRPC dependency from peer.goFUJITA Tomonori
move gRPC dependency from peer.go to grpc_server.go Preparation for the removal of gRPC dependency from packages except for api package. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-28config: handle entry's empty nameFUJITA Tomonori
Equal method assumes that an each entry has unique name and uses it as a key for map. However, currently, an entry is allowed to have an empty name. To work around the problem, uses an index in the list as a key for map. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-28config: fix misuse of pointersFUJITA Tomonori
Equal method for map misuses a pointer; all the entry of the map becomes idential. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-27config: don't take into account State struct in Equal()ISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-21config: simplify config structuresISHIDA Wataru
stop generating self-contained leafref fields in openconfig model. (e.g. bgp:neighbor/bgp:neighbor-address ) Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-19config: generate Equal() methodISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-25config: add openconfig identity structs in bgp_configs.goISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-25config: add go type of embeded enums defined in openconfigISHIDA Wataru
these types are embeded enums of openconfig and were left uint32 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-09config: refactor config structureISHIDA Wataru
- 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>
2016-01-09config: add DO NOT EDIT warningISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-09config: remove unnecessary augmentISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-09config: we don't need to modify origin PeerType nameISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-09config: remove redundant definition in gobgp.yangISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-09config: add FromInt() method to config typedefISHIDA Wataru
use for the translation between api structs Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-09config: catch up with the latest openconfigISHIDA Wataru
using commit 20b9cc544012201069e9d6a159ebab17f4172dfb from github.com/openconfig/public Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-09config: change enum value type to string for ease of configurationISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-01-09tools: avoid adding a new option to bgpyang2golang.py and fix gobgp.yangISHIDA Wataru
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>
2015-12-29config: use viper and support multiple configuration formatsISHIDA Wataru
// 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>
2015-12-28config: make config/state variable name simpleISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-09-25config: add zebra redistribution configurationISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-08-11config: cancel as-path-set-memberHiroshi Yokoi
2015-08-11config: insert gobgp-specific elements with augment statements defined in ↵Hiroshi Yokoi
gobgp.yang
2015-08-05config: change type of Prefix in the PrefixSetNaoto Hanaue
2015-07-31config: use the latest openconfig yangHiroshi Yokoi
2015-05-20config: change SetCommunity.Options's type to stringHiroshi Yokoi
2015-04-24config: add bgp-policy configurationHiroshi Yokoi
2015-03-11config: add routing-policy containersHiroshi Yokoi
2015-03-03config: make a field name same to its type nameHiroshi Yokoi
embedding doesn't work with toml. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-03tools: add README for yang pluginFUJITA Tomonori
also do some cleanups. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-03tools: update pyang plugin for the change of the yang file's nameFUJITA Tomonori
2015-03-03pyang_plugin: remove unused codesHiroshi Yokoi
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-03config: skip identity and use string as the data typeHiroshi Yokoi
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-03pyang_plugin: use struct embedding if it's a child container.Hiroshi Yokoi
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-29config: support enum value and add ietf yang filesHiroshi Yokoi
2014-11-17pyang_plugin: fix bug that prints container type as listHiroshi Yokoi
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-11-17pyang_plugin: modify type translation rule and copyrightHiroshi Yokoi
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>