1 # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
2 # Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
19 from ryu.controller import event
24 class _RequestBase(event.EventRequestBase):
26 self.dst = 'ofctl_service'
29 class _ReplyBase(event.EventReplyBase):
35 class GetDatapathRequest(_RequestBase):
36 def __init__(self, dpid=None):
37 assert dpid is None or isinstance(dpid, numbers.Integral)
38 super(GetDatapathRequest, self).__init__()
44 class SendMsgRequest(_RequestBase):
45 def __init__(self, msg, reply_cls=None, reply_multi=False):
46 super(SendMsgRequest, self).__init__()
48 self.reply_cls = reply_cls
49 self.reply_multi = reply_multi
54 class Reply(_ReplyBase):
55 def __init__(self, result=None, exception=None):
57 self.exception = exception