annotate doc/dbg_interactive.py.sample @ 637:22e8fac3b2d6

Split interface file in modules
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 16 Dec 2010 18:56:41 +0900
parents c23ca590fa57
children 9448cba86673
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
1 # Example file for the dbg_interactive.fdx extension.
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
2 #
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
3 # This extension provides an interactive python interpreter console that allows
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
4 # interacting with freeDiameter framework.
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
5 #
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
6 # The adaptation layer between Python and C is provided by SWIG (http://swig.org).
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
7 # You may refer to SWIG documentation for more information on how the wrapper is generated and used.
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
8 # The name of the module wrapping freeDiameter framework is: _fDpy
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
9 #
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
10 # Similar to all freeDiameter extensions, an optional filename can be specified in the
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
11 # main freeDiameter.conf configuration file for the dbg_interactive.fdx extension.
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
12 # If such file is provided, it will be passed to the python interpreter as a python script
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
13 # to execute. Otherwise, the interpreter will be interactive.
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
14 #
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
15 # SWIG deals with structures as follow:
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
16 # Given the structure:
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
17 # struct foo { int a; }
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
18 # The following functions are available to python (their C equivalent processing is given in [ ]):
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
19 # s = new_foo() [ s = calloc(1, sizeof(struct foo)) ]
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
20 # foo_a_set(s, 2) [ s->a = 2 ]
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
21 # foo_a_get(s) [ returns s->a value ]
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
22 # delete_foo(s) [ free(s) ]
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
23 #
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
24 # In addition, thanks to the proxy (aka shadow) class, we can also do the more user-friendly:
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
25 # s = foo()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
26 # s.a = 2
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
27 # s.a
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
28 # del s
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
29 #
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
30
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
31 # The remaining of this file gives some examples of how to use the python interpreter.
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
32 # Note that the support is not yet totally usable. You'll probably have to extend some classes
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
33 # or write some typemaps in the source code of the extension to do what you want.
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
34
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
35
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
36 ############# Compilation-time constants (from freeDiameter-host.h) ############
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
37
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
38 # Display current version
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
39 print "%s %d.%d.%d" % (FD_PROJECT_NAME, FD_PROJECT_VERSION_MAJOR, FD_PROJECT_VERSION_MINOR, FD_PROJECT_VERSION_REV)
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
40
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
41
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
42 ############# Debug ############
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
43
623
fc4f5815f0aa Continued work on dbg_interactive.fdx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 622
diff changeset
44 # Change the global debug level of the framework (cvar contains all global variables)
fc4f5815f0aa Continued work on dbg_interactive.fdx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 622
diff changeset
45 cvar.fd_g_debug_lvl = FULL
fc4f5815f0aa Continued work on dbg_interactive.fdx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 622
diff changeset
46
fc4f5815f0aa Continued work on dbg_interactive.fdx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 622
diff changeset
47
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
48 # Turn on debug for a specific function (if framework compiled with DEBUG support)
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
49 cvar.fd_debug_one_function = "gc_th_fct"
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
50
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
51
623
fc4f5815f0aa Continued work on dbg_interactive.fdx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 622
diff changeset
52 # Print messages to freeDiameter's debug facility
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
53 # Note: the python version does not support printf-like argument list. The formating should be done in python.
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
54 # See SWIG documentation about varargs functions for more information.
624
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 623
diff changeset
55 fd_log_debug("3 + 4 = %d\n" % (7))
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
56
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
57
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
58 # Display some framework state information
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
59 r = fd_event_send(cvar.fd_g_config.cnf_main_ev, FDEV_DUMP_PEERS, 0, None)
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
60 r = fd_event_send(cvar.fd_g_config.cnf_main_ev, FDEV_DUMP_SERV, 0, None)
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
61 r = fd_event_send(cvar.fd_g_config.cnf_main_ev, FDEV_DUMP_EXT, 0, None)
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
62
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
63
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
64 ############# Global variables ############
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
65
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
66 # Display the local Diameter Identity:
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
67 print "Local Diameter Identity:", cvar.fd_g_config.cnf_diamid
637
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
68
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
69 # Display realm, using the low-level functions (skip proxy classe definitions):
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
70 print "Realm:", _fDpy.fd_config_cnf_diamrlm_get(_fDpy.cvar.fd_g_config)
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
71
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
72
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
73
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
74 ############# Lists ############
637
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
75
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
76 # Note: we use different names from the C API here, for usability.
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
77 l1 = fd_list() # Will be our sentinel
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
78 l2 = fd_list()
637
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
79 l3 = fd_list()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
80 l1.isempty()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
81 l1.insert_next(l2) # l1 -> l2
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
82 l1.isempty()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
83 l1.insert_prev(l3) # l1 -> l2 -> l3 (circular list)
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
84 l1.dump()
637
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
85 l3.detach() # l1 -> l2
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
86 l4=fd_list()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
87 l5=fd_list()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
88 l3.insert_next(l4) # l3 -> l4
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
89 l3.insert_next(l5) # l3 -> l5 -> l4
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
90 l1.concat(l3) # l1 -> l2 -> l5 -> l4
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
91
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
92 elements = l1.enum_as() # default: enumerates as fd_list. Warning: this a copy, changing the python list has no effect on the underlying list.
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
93 for li in elements:
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
94 li.dump()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
95
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
96 del elements
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
97 del l2
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
98 del l3
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
99 del l4
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
100 del l5
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
101 l1.isempty() # The destructor has an implicit fd_list_unlink call
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
102 del l1
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
103
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
104
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
105 ############# Hash ############
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
106 hex(fd_hash("hello world")) # A typemap is applied to accept binary data
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
107
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
108
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
109 ############# Dictionary ############
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
110
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
111 ##### Create a dedicated dictionary for our tests
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
112 d = dictionary()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
113 d.dump()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
114
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
115 # New vendor
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
116 v = dict_vendor_data()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
117 v.vendor_id = 123
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
118 v.vendor_name = "My test vendor"
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
119 my_vendor = d.new_obj(DICT_VENDOR, v)
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
120 del v
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
121 d.dump()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
122 d.vendors_list()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
123
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
124 # New application
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
125 a = dict_application_data()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
126 a.application_id = 99
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
127 a.application_name = "My test appl"
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
128 my_appl = d.new_obj(DICT_APPLICATION, a, my_vendor)
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
129 del a
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
130
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
131 # New type (callbacks are not supported yet...)
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
132 t = dict_type_data()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
133 t.type_base = AVP_TYPE_INTEGER32
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
134 t.type_name = "My integer AVP"
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
135 my_type_int = d.new_obj(DICT_TYPE, t, my_appl)
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
136 t.type_base = AVP_TYPE_OCTETSTRING
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
137 t.type_name = "My binary buffer AVP"
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
138 my_type_os = d.new_obj(DICT_TYPE, t, my_appl)
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
139 del t
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
140
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
141 # Constants
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
142 c = dict_enumval_data()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
143 c.enum_name = "AVP_VALUE_TROIS"
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
144 c.enum_value.i32 = 3
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
145 d.new_obj(DICT_ENUMVAL, c, my_type_int)
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
146
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
147 c.enum_name = "A_BUFFER_CONSTANT"
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
148 c.enum_value.os = "This is a very long AVP value that we prefer to represent as a constant"
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
149 c.enum_value.os.dump()
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
150 d.new_obj(DICT_ENUMVAL, c, my_type_os)
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
151 del c
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
152
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
153 # AVP
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
154 a = dict_avp_data()
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
155 a.avp_code = 234
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
156 a.avp_name = "my integer avp"
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
157 a.avp_flag_mask = AVP_FLAG_MANDATORY
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
158 a.avp_basetype = AVP_TYPE_INTEGER32
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
159 my_avp_int = d.new_obj(DICT_AVP, a, my_type_int)
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
160
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
161 a.avp_vendor = 123
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
162 a.avp_name = "my OS avp"
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
163 a.avp_flag_mask = AVP_FLAG_MANDATORY + AVP_FLAG_VENDOR
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
164 a.avp_flag_val = AVP_FLAG_VENDOR
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
165 a.avp_basetype = AVP_TYPE_OCTETSTRING
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
166 my_avp_os = d.new_obj(DICT_AVP, a, my_type_os)
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
167 del a
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
168
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
169 # Command
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
170 c = dict_cmd_data()
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
171 c.cmd_code = 345
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
172 c.cmd_name = "My-Python-Request"
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
173 c.cmd_flag_mask = CMD_FLAG_REQUEST + CMD_FLAG_PROXIABLE
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
174 c.cmd_flag_val = CMD_FLAG_REQUEST + CMD_FLAG_PROXIABLE
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
175 my_req = d.new_obj(DICT_COMMAND, c, my_appl)
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
176 c.cmd_name = "My-Python-Answer"
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
177 c.cmd_flag_val = CMD_FLAG_PROXIABLE
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
178 my_ans = d.new_obj(DICT_COMMAND, c, my_appl)
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
179 del c
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
180
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
181 # Rule
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
182 r = dict_rule_data()
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
183 r.rule_avp = my_avp_int
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
184 r.rule_position = RULE_REQUIRED
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
185 r.rule_min = -1
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
186 r.rule_max = -1
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
187 d.new_obj(DICT_RULE, r, my_req)
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
188 d.new_obj(DICT_RULE, r, my_ans)
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
189 r.rule_avp = my_avp_os
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
190 d.new_obj(DICT_RULE, r, my_req)
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
191 d.new_obj(DICT_RULE, r, my_ans)
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
192 del r
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
193
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
194 d.dump()
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
195 del d
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
196
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
197
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
198 ####### Now play with the "real" dictionary
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
199
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
200 gdict = cvar.fd_g_config.cnf_dict
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
201
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
202 appl = gdict.search ( DICT_APPLICATION, APPLICATION_BY_ID, 3 )
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
203 appl.dump()
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
204 avp = gdict.search ( DICT_AVP, AVP_BY_NAME, "Origin-Host")
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
205 avp.dump()
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
206 errcmd = gdict.error_cmd()
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
207
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
208 v = avp.getval()
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
209 print v.avp_code
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
210 del v
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
211
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
212 t = avp.gettype()
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
213 print t
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
214 del t
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
215
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
216 dict = avp.getdict()
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
217 del dict
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
218
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
219
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
220 ############# Sessions ############
624
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 623
diff changeset
221
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
222 # handler
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
223 def my_cleanup(state,sid):
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
224 print "Cleaning up python state for session:", sid
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
225 print "Received state:", state
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
226 del state
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
227
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
228 hdl = session_handler(my_cleanup)
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
229 hdl.dump()
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
230 del hdl
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
231
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
232 # Session
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
233 hdl = session_handler(my_cleanup)
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
234 s1 = session()
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
235 s1.getsid()
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
236 s2 = session("this.is.a.full.session.id")
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
237 r,s3,isnew = fd_sess_fromsid("this.is.a.full.session.id")
637
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
238 s4 = session("host.id", "optional.part")
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
239 s4.settimeout(30) # the python wrapper takes a number of seconds as parameter for simplicity
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
240 s4.dump()
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
241
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
242 # states
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
243 mystate = [ 34, "blah", [ 32, 12 ] ]
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
244 s1.store(hdl, mystate)
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
245 del mystate
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
246 gotstate = s1.retrieve(hdl)
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
247 print gotstate
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
248 del gotstate
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
249
624
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 623
diff changeset
250
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
251 ############# Routing ############
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
252
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
253 rd = rt_data()
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
254
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
255 rd.add("p1.testbed.aaa", "testbed.aaa")
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
256 rd.add("p2.testbed.aaa", "testbed.aaa")
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
257 rd.add("p3.testbed.aaa", "testbed.aaa")
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
258 rd.add("p4.testbed.aaa", "testbed.aaa")
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
259
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
260 rd.remove("p2.testbed.aaa")
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
261
636
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
262 rd.error("p3.testbed.aaa", "relay.testbed.aaa", 3002)
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
263
c23ca590fa57 Still making progress on the dbg_interactive interface.
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 635
diff changeset
264 list = rd.extract(-1)
637
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
265 for c in list.enum_as("struct rtd_candidate *"):
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
266 print "%s (%s): %s" % (c.diamid, c.realm, c.score)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
267
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
268
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
269
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
270 ############# Messages, AVPs ############
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
271
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
272 ## AVP
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
273
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
274 # Create empty (as for messages, pass None or a dictionary object as 1st param, and flags as optional 2nd param)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
275 blank_avp = avp()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
276 del blank_avp
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
277
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
278 oh = avp(cvar.fd_g_config.cnf_dict.search ( DICT_AVP, AVP_BY_NAME, "Origin-Host")) # Octet String
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
279 vi = avp(cvar.fd_g_config.cnf_dict.search ( DICT_AVP, AVP_BY_NAME, "Vendor-Id")) # U32
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
280 vsai = avp(cvar.fd_g_config.cnf_dict.search ( DICT_AVP, AVP_BY_NAME, "Vendor-Specific-Application-Id")) # Grouped
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
281
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
282 # Set values
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
283 val = avp_value()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
284 val.u32 = 123
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
285 vi.setval(None) # this cleans a previous value (not needed)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
286 vi.setval(val)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
287 val.os = "my.origin.host"
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
288 oh.setval(val)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
289 vsai.add_child(vi) # call as add_child(vi, 1) to add the new AVP at the beginning, default is at the end
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
290
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
291
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
292 ## Messages
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
293
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
294 # Create empty
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
295 a_msg = msg()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
296 a_msg.dump()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
297 del a_msg
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
298
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
299 # It is also possible to pass MSGFL_* flags in second parameter (ALLOC_ETEID is default)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
300 msg_no_eid = msg(None, 0)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
301 msg_no_eid.dump()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
302 del msg_no_eid
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
303
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
304 # Create from dictionary
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
305 dwr_dict = cvar.fd_g_config.cnf_dict.search ( DICT_COMMAND, CMD_BY_NAME, "Device-Watchdog-Request" )
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
306 dwr = msg(dwr_dict)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
307 dwr.dump()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
308
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
309 # Create msg from a binary buffer (then you should call parse_dict and parse_rules methods)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
310 dwr2 = msg("\x01\x00\x00\x14\x80\x00\x01\x18\x00\x00\x00\x00\x00\x00\x00\x00\x1b\xf0\x00\x01")
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
311
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
312 # Create answer from request (optional parameters: dictionary to use, and flags):
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
313 dwr3 = msg(cvar.fd_g_config.cnf_dict.search ( DICT_COMMAND, CMD_BY_NAME, "Device-Watchdog-Request" ))
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
314 dwa3 = dwr3.create_answer()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
315 dwr3cpy = dwa3.get_query()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
316
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
317
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
318 ## Other functions with AVPs & messages
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
319
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
320 # Add the AVPs in the message
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
321 dwr.add_child(oh)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
322 oh.add_next(vsai) # equivalent to add_child on the parent
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
323
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
324 # Create a network byte buffer from the message
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
325 dwr.bufferize()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
326
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
327 # Get first child AVP (fast)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
328 avp = dwr.first_child()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
329
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
330 # then:
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
331 avp = avp.get_next() # when last AVP, returns None
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
332
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
333
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
334 # Get all 1st level children (slower) -- warning, changes to the python list will not be reflected on the underlying message. read-only use.
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
335 dwr.children()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
336 # example use:
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
337 for a in dwr.children()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
338 a.dump(0) # 0 means: dump only this object, do not walk the tree
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
339
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
340
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
341 # Search the first AVP of a given type
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
342 oh_dict = cvar.fd_g_config.cnf_dict.search( DICT_AVP, AVP_BY_NAME, "Origin-Host")
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
343 oh = dwr.search( oh_dict )
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
344
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
345 # After adding AVPs, the length in the message header is outdated, refresh as follow:
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
346 dwr.update_length()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
347
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
348 # Get dictionary model for a message or avp
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
349 dwr.model()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
350 oh.model().dump()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
351
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
352 # Retrieve the header of messages & avp:
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
353 dwr_hdr = dwr.header()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
354 dwr_hdr.msg_version
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
355 dwr_hdr.msg_hbhid
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
356
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
357 oh_hdr = oh.header()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
358 hex(oh_hdr.avp_flags)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
359 oh_hdr.avp_vendor
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
360 oh_hdr.avp_value.os.dump() # The initial avp value must be set with setval(), but then this accessor is allowed.
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
361
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
362 # Get or set the routing data
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
363 rd = rt_data()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
364 dwr.set_rtd(rd)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
365 rd = dwr.get_rtd()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
366
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
367 # Test if message is routable
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
368 dwr.is_routable()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
369
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
370 # Which peer the message was received from (when received from network)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
371 dwr.source()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
372
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
373 # The session corresponding to this message (returns None when no Session-Id AVP is included)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
374 dwr.get_session()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
375
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
376
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
377 # Parse a buffer
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
378 buf = "\x01\x00\x00@\x80\x00\x01\x18\x00\x00\x00\x00\x00\x00\x00\x00N\x10\x00\x00\x00\x00\x01\x08@\x00\x00\x16my.origin.host\x00\x00\x00\x00\x01\x04@\x00\x00\x14\x00\x00\x01\n@\x00\x00\x0c\x00\x00\x00{"
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
379 mydwr = msg(buf)
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
380 # Resolve objects in the dictionary. Return value is None or a struct pei_error in case of problem.
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
381 mydwr.parse_dict() # if not using the fD global dict, pass it as parameter
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
382 err = mydwr.parse_rules()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
383 err.pei_errcode
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
384
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
385
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
386 # Grouped AVPs are browsed with same methods as messages:
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
387 gavp = dwr.children()[1]
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
388 gavp.first_child().dump()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
389 gavp.children()
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
390
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
391
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
392
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 636
diff changeset
393
635
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
394
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
395
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
396
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
397
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
398
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
399
134e4fb9eef5 Continued work on python interface
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 627
diff changeset
400 ######################### old stuff (need update) ######################
622
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
401
cfbf7ed5dccd Added some limited example for dbg_interactive
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
402
627
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
403 # Create a new peer_info structure and add the peer to the framework.
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
404 mypeer = peer_info()
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
405 mypeer.pi_diamid = "nas.testbed.aaa"
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
406 mypeer.config.pic_flags.pro4 = 1 # 1 for TCP, for some reason PI_P4_TCP is not defined
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
407 fd_peer_add(mypeer, "python", None, None)
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
408 del mypeer
330be61dbf43 Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
409
"Welcome to our mercurial repository"