Navigation


Changeset 1169:11724ff78638 in freeDiameter


Ignore:
Timestamp:
Jun 1, 2013, 3:23:55 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Some cleanups in dbg_interactive extension

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • doc/dbg_interactive.py.sample

    r1078 r1169  
    3030
    3131# 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
    33 # or write some typemaps in the source code of the extension to do what you want.
     32# Note that at the moment not 100% of the framework is usable.
     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.
    3435
    3536
     
    4344
    4445# Change the global debug level of the framework (cvar contains all global variables)
    45 cvar.fd_g_debug_lvl = FULL
     46cvar.fd_g_debug_lvl = 1
    4647
    4748
     
    5354# Note: the python version does not support printf-like argument list. The formating should be done in python.
    5455#       See SWIG documentation about varargs functions for more information.
    55 fd_log_debug_fstr(None, "3 + 4 = %d" % (7))
     56fd_log(FD_LOG_NOTICE, "3 + 4 = %d" % (7))
    5657
    5758
    5859# Display some framework state information
    59 r = fd_event_send(cvar.fd_g_config.cnf_main_ev, FDEV_DUMP_PEERS, 0, None)
    60 r = fd_event_send(cvar.fd_g_config.cnf_main_ev, FDEV_DUMP_SERV, 0, None)
    61 r = fd_event_send(cvar.fd_g_config.cnf_main_ev, FDEV_DUMP_EXT, 0, None)
     60conf = fd_conf_dump();
     61print conf;
     62
     63fd_peer_dump_list(0)
     64fd_servers_dump(0)
     65fd_ext_dump(0)
    6266
    6367
     
    659663
    660664
     665############# HOOKS ############
     666
     667# TODO
    661668
    662669############# PEERS ############
  • extensions/dbg_interactive/dbg_interactive.c

    r1127 r1169  
    8080        /* Upon exit, issue the order of terminating to fD, if the interpreter was started without a file */
    8181        if (!arg) {
    82                 CHECK_FCT_DO(fd_event_send(fd_g_config->cnf_main_ev, FDEV_TERMINATE, 0, NULL), );
     82                (void)fd_core_shutdown();
    8383        }
    8484
  • extensions/dbg_interactive/dbg_interactive.i

    r1127 r1169  
    122122}
    123123
     124/* Case of the fd_*_dump functions */
     125%typemap(in,noblock=1,numinputs=0) (char ** buf, size_t *len, size_t *offset) ($*1_ltype temp = NULL, $*2_ltype tempn) {
     126        $1 = &temp; $2 = &tempn; $3 = NULL;
     127}
     128%typemap(freearg,match="in") (char ** buf, size_t *len, size_t *offset) "";
     129%typemap(argout,noblock=1,fragment="SWIG_FromCharPtr")(char ** buf, size_t *len, size_t *offset) {
     130  if (*$1) {
     131    %append_output(SWIG_FromCharPtr(*$1));
     132    free(*$1);                                               
     133  }                                                 
     134}                                                           
     135
    124136/* Typemap to return a boolean value as output parameter */
    125137%typemap(in, numinputs=0,noblock=1) int * BOOL_OUT (int temp) {
  • include/freeDiameter/libfdcore.h

    r1164 r1169  
    808808/* The "old" FD_EV_DUMP_* events are replaced with direct calls to the following dump functions */
    809809DECLARE_FD_DUMP_PROTOTYPE(fd_conf_dump);
     810#else /* SWIG */
     811DECLARE_FD_DUMP_PROTOTYPE_simple(fd_event_trig_dump);
     812DECLARE_FD_DUMP_PROTOTYPE_simple(fd_conf_dump);
     813#endif /* SWIG */
    810814DECLARE_FD_DUMP_PROTOTYPE(fd_ext_dump, int indent_next);
    811815DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump, int details);
    812 #endif /* SWIG */
    813816DECLARE_FD_DUMP_PROTOTYPE(fd_peer_dump_list, int details);
    814817DECLARE_FD_DUMP_PROTOTYPE(fd_peer_dump, struct peer_hdr * p, int details);
  • include/freeDiameter/libfdproto.h

    r1167 r1169  
    239239#define DECLARE_FD_DUMP_PROTOTYPE( function_name, args... )     \
    240240        char * function_name(char ** buf, size_t *len, size_t *offset, ##args)
     241
     242#ifdef SWIG
     243#define DECLARE_FD_DUMP_PROTOTYPE_simple( function_name )       \
     244        char * function_name(char ** buf, size_t *len, size_t *offset)
     245#endif /* SWIG */
    241246       
    242247
Note: See TracChangeset for help on using the changeset viewer.