Beispiel #1
0
def get_req():
    req = cp_route_pb2.CPStaticRouteRequest()
    req_msg = req.Request.add()
    req_msg.DestAddr.Af = 1
    req_msg.DestAddr.V4Addr = destaddr
    req_msg.NextHopAddr.Af = 1
    req_msg.NextHopAddr.V4Addr = nhaddr
    req_msg.PrefixLen = prefixlen
    resp = stub.CPStaticRouteGet(req)
    process_response(req, resp)
    return
Beispiel #2
0
def update_req():
    req = cp_route_pb2.CPStaticRouteRequest()
    req_msg = req.Request.add()
    req_msg.RouteTableId = RouteTableId
    req_msg.DestAddr.Af = 1
    req_msg.DestAddr.V4Addr = destaddr
    req_msg.NextHopAddr.Af = 1
    req_msg.NextHopAddr.V4Addr = nhaddr
    req_msg.PrefixLen = prefixlen
    req_msg.State = state
    req_msg.Override = override
    req_msg.AdminDist = admindist
    resp = stub.CPStaticRouteUpdate(req)
    process_response(req, resp)
    return
Beispiel #3
0
def get_all_req():
    req = cp_route_pb2.CPStaticRouteRequest()
    resp = stub.CPStaticRouteGet(req)
    process_response(req, resp)
    return