Mercurial > hg > freeDiameter
comparison doc/dbg_interactive.py.sample @ 1169:11724ff78638
Some cleanups in dbg_interactive extension
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Fri, 31 May 2013 20:23:55 +0200 |
parents | 74bba7975864 |
children | f0b328ea2fdb |
comparison
equal
deleted
inserted
replaced
1168:a4604f98adae | 1169:11724ff78638 |
---|---|
27 # s.a | 27 # s.a |
28 # del s | 28 # del s |
29 # | 29 # |
30 | 30 |
31 # The remaining of this file gives some examples of how to use the python interpreter. | 31 # The remaining of this file gives some examples of how to use the python interpreter. |
32 # Note that the support is not yet totally usable. You'll probably have to extend some classes | 32 # Note that at the moment not 100% of the framework is usable. |
33 # or write some typemaps in the source code of the extension to do what you want. | 33 # You may have to extend some classes or write some typemaps in the source code |
34 # of the extension to do what you want. | |
34 | 35 |
35 | 36 |
36 ############# Compilation-time constants (from freeDiameter-host.h) ############ | 37 ############# Compilation-time constants (from freeDiameter-host.h) ############ |
37 | 38 |
38 # Display current version | 39 # Display current version |
40 | 41 |
41 | 42 |
42 ############# Debug ############ | 43 ############# Debug ############ |
43 | 44 |
44 # Change the global debug level of the framework (cvar contains all global variables) | 45 # Change the global debug level of the framework (cvar contains all global variables) |
45 cvar.fd_g_debug_lvl = FULL | 46 cvar.fd_g_debug_lvl = 1 |
46 | 47 |
47 | 48 |
48 # Turn on debug for a specific function (if framework compiled with DEBUG support) | 49 # Turn on debug for a specific function (if framework compiled with DEBUG support) |
49 cvar.fd_debug_one_function = "gc_th_fct" | 50 cvar.fd_debug_one_function = "gc_th_fct" |
50 | 51 |
51 | 52 |
52 # Print messages to freeDiameter's debug facility | 53 # Print messages to freeDiameter's debug facility |
53 # Note: the python version does not support printf-like argument list. The formating should be done in python. | 54 # Note: the python version does not support printf-like argument list. The formating should be done in python. |
54 # See SWIG documentation about varargs functions for more information. | 55 # See SWIG documentation about varargs functions for more information. |
55 fd_log_debug_fstr(None, "3 + 4 = %d" % (7)) | 56 fd_log(FD_LOG_NOTICE, "3 + 4 = %d" % (7)) |
56 | 57 |
57 | 58 |
58 # Display some framework state information | 59 # Display some framework state information |
59 r = fd_event_send(cvar.fd_g_config.cnf_main_ev, FDEV_DUMP_PEERS, 0, None) | 60 conf = fd_conf_dump(); |
60 r = fd_event_send(cvar.fd_g_config.cnf_main_ev, FDEV_DUMP_SERV, 0, None) | 61 print conf; |
61 r = fd_event_send(cvar.fd_g_config.cnf_main_ev, FDEV_DUMP_EXT, 0, None) | 62 |
63 fd_peer_dump_list(0) | |
64 fd_servers_dump(0) | |
65 fd_ext_dump(0) | |
62 | 66 |
63 | 67 |
64 ############# Global variables ############ | 68 ############# Global variables ############ |
65 | 69 |
66 # Display the local Diameter Identity: | 70 # Display the local Diameter Identity: |
656 myqueue.timedget(3, "struct fd_event *") | 660 myqueue.timedget(3, "struct fd_event *") |
657 | 661 |
658 del myqueue | 662 del myqueue |
659 | 663 |
660 | 664 |
665 ############# HOOKS ############ | |
666 | |
667 # TODO | |
661 | 668 |
662 ############# PEERS ############ | 669 ############# PEERS ############ |
663 | 670 |
664 # Get the list of peers defined in the system | 671 # Get the list of peers defined in the system |
665 # (we are supposed to readlock fd_g_peers_rw before accessing this list) | 672 # (we are supposed to readlock fd_g_peers_rw before accessing this list) |