summaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
authorYuichi Ito <ito.yuichi0@gmail.com>2013-12-12 15:30:56 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-12-12 18:21:50 +0900
commit3f9a902198dce92f9044f22f34a1b89ab618e29e (patch)
tree011a845141f61fc35806047489957cb0e5d370d2 /bin
parent2eb4f4470fe8f029f8a202abdf49d515dfa2cc14 (diff)
packet lib: packet_base: add a method which makes '_class_prefixes' easy to use
the variable '_class_prefixes' of stringify.StringifyMixin is used to help the method 'from_jsondict()' to create the class instance. '_class_prefixes' requires a list of the class names. some classes have another list of the class names already. this patch adds a method which makes '_class_prefixes' by using the existing list. before applying this patch: (e.g. ryu.lib.packet.ipv6) # append the name to another list @ipv6.register_header_type(inet.IPPROTO_HOPOPTS) class hop_opts(opt_header): ... @ipv6.register_header_type(inet.IPPROTO_DSTOPTS) class dst_opts(opt_header): .... # append the name again ipv6._class_prefixes = ['hop_opts', 'dst_opts', ...] after applying this patch: (e.g. ryu.lib.packet.ipv6) # append the name to another list @ipv6.register_header_type(inet.IPPROTO_HOPOPTS) class hop_opts(opt_header): ... @ipv6.register_header_type(inet.IPPROTO_DSTOPTS) class dst_opts(opt_header): .... # create the new list from another list ipv6.set_classes(ipv6._IPV6_EXT_HEADER_TYPE) Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions