2 * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 // the label argument in pushRoute can use these
10 const i32 LBL_NO_LABEL = 0
11 const i32 LBL_EXPLICIT_NULL = 3
14 const i32 BGP_RT_ADD = 0
15 const i32 BGP_RT_DEL = 1
17 // FIB table iteration op
18 const i32 GET_RTS_INIT = 0
19 const i32 GET_RTS_NEXT = 1
24 * ERR_FAILED because something not permitted
25 * was attempted, such as deleting a route
27 * ERR_ACTIVE when session is sought to be created
28 * when it is already running.
29 * ERR_INACTIVE when an RPC is called but there is
31 * ERR_NOT_ITER when GET_RTS_NEXT is called without
32 * initializing with GET_RTS_INIT
33 * ERR_PARAM when there is an issue with params
36 const i32 BGP_ERR_FAILED = 1
37 const i32 BGP_ERR_ACTIVE = 10
38 const i32 BGP_ERR_INACTIVE = 11
39 const i32 BGP_ERR_NOT_ITER = 15
40 const i32 BGP_ERR_PARAM = 100
42 // these are the supported afi-safi combinations
48 SAFI_IPV4_LABELED_UNICAST = 4,
54 * type is either RT_ADD(0) or RT_DEL(1)
68 * A sequence of FIB updates, valid only if errcode
69 is zero. Returned as a result of iteration using
70 getRoutes() (ie, a database read). more=0 signals
76 2: optional list<Update> updates,
80 service BgpConfigurator {
82 * startBgp() starts a BGP instance on the BGP VM. Graceful Restart
83 * also must be configured (stalepathTime > 0). If local BGP is
84 * restarting, announceFlush tells neighbor to flush all routes
85 * previously advertised by us. This is the F bit of RFC 4724.
87 i32 startBgp(1:i32 asNumber, 2:string routerId, 3: i32 port,
88 4:i32 holdTime, 5:i32 keepAliveTime,
89 6:i32 stalepathTime, 7:bool announceFlush),
90 i32 stopBgp(1:i32 asNumber),
91 i32 createPeer(1:string ipAddress, 2:i32 asNumber),
92 i32 deletePeer(1:string ipAddress)
93 i32 addVrf(1:string rd, 2:list<string> irts, 3:list<string> erts),
94 i32 delVrf(1:string rd),
97 * IPv6 is not supported.
98 * 'nexthop' cannot be null for VPNv4 and LU.
99 * 'rd' is null for LU (and unicast).
100 * 'label' cannot be NO_LABEL for VPNv4 and LU.
101 * ipv4 unicast is not fully supported.
103 i32 pushRoute(1:string prefix, 2:string nexthop, 3:string rd, 4:i32 label),
106 * Second argument is either 'rd' (VPNv4) or
107 * label (LU) as a string (eg: "2500")
109 i32 withdrawRoute(1:string prefix, 2:string rd),
110 i32 setEbgpMultihop(1:string peerIp, 2:i32 nHops),
111 i32 unsetEbgpMultihop(1:string peerIp),
112 i32 setUpdateSource(1:string peerIp, 2:string srcIp),
113 i32 unsetUpdateSource(1:string peerIp),
114 i32 enableAddressFamily(1:string peerIp, 2:af_afi afi, 3:af_safi safi),
115 i32 disableAddressFamily(1:string peerIp, 2:af_afi afi, 3:af_safi safi),
116 i32 setLogConfig(1:string logFileName, 2:string logLevel),
117 i32 enableGracefulRestart(1:i32 stalepathTime),
118 i32 disableGracefulRestart(),
121 * optype is one of: GET_RTS_INIT: initialize iteration,
122 * GET_RTS_NEXT: get next bunch of routes. winSize is
123 * the size of the buffer that caller has allocated to
124 * receive the array. QBGP sends no more than the number
125 * of routes that would fit in this buffer, but not
126 * necessarily the maximum number that would fit.
127 * Calling INIT when NEXT is expected causes reinit.
129 Routes getRoutes(1:i32 optype, 2:i32 winSize)
133 oneway void onUpdatePushRoute(1:string rd, 2:string prefix,
134 3:i32 prefixlen, 4:string nexthop,
136 oneway void onUpdateWithdrawRoute(1:string rd, 2:string prefix,
138 oneway void onStartConfigResyncNotification(),
139 /* communicate to ODL a BGP Notification received from peer */
140 oneway void onNotificationSendEvent(1:string prefix,
141 2:byte errCode, 3:byte errSubcode)