Changeset 979:b90cb4c07160 in freeDiameter for extensions/dbg_interactive
- Timestamp:
- Mar 15, 2013, 2:45:03 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/dbg_interactive
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/dbg_interactive/dbg_interactive.i
r788 r979 70 70 static const char * wrapper_error_txt; /* if NULL, use strerror(errno) */ 71 71 #define DI_ERROR(code, pycode, str) { \ 72 fd_log_debug("[dbg_interactive] ERROR: %s: %s \n", __PRETTY_FUNCTION__, str ? str : strerror(code)); \72 fd_log_debug("[dbg_interactive] ERROR: %s: %s", __PRETTY_FUNCTION__, str ? str : strerror(code)); \ 73 73 wrapper_errno = code; \ 74 74 wrapper_errno_py = pycode; \ -
extensions/dbg_interactive/dictionary.i
r972 r979 240 240 for (i=0; i < n; i++) 241 241 fd_log_debug("%02.2X", $self->data[i]); 242 fd_log_debug("] '%.*s%s' \n", n, $self->data, n == LEN_MAX ? "..." : "");242 fd_log_debug("] '%.*s%s'", n, $self->data, n == LEN_MAX ? "..." : ""); 243 243 } 244 244 %cstring_output_allocate_size(char ** outbuffer, size_t * outlen, free(*$1)); -
extensions/dbg_interactive/dispatch.i
r741 r979 47 47 48 48 if (!pycb) { 49 fd_log_debug("Internal error: missing the callback! \n");49 fd_log_debug("Internal error: missing the callback!"); 50 50 return ENOTSUP; 51 51 } … … 63 63 /* The result is supposedly composed of: [ ret, *msg, *action ] */ 64 64 if ((result == NULL) || (!PyList_Check(result)) || (PyList_Size(result) != 3)) { 65 fd_log_debug("Error: The Python callback did not return [ ret, msg, action ]. \n");65 fd_log_debug("Error: The Python callback did not return [ ret, msg, action ]."); 66 66 ret = EINVAL; 67 67 goto out; … … 70 70 /* Convert the return values */ 71 71 if (!SWIG_IsOK(SWIG_AsVal_int(PyList_GetItem(result, 0), &ret))) { 72 fd_log_debug("Error: Cannot convert the first return value to integer. \n");72 fd_log_debug("Error: Cannot convert the first return value to integer."); 73 73 ret = EINVAL; 74 74 goto out; 75 75 } 76 76 if (ret) { 77 TRACE_DEBUG(INFO, "The Python callback returned the error code %d (%s) \n", ret, strerror(ret));77 TRACE_DEBUG(INFO, "The Python callback returned the error code %d (%s)", ret, strerror(ret)); 78 78 goto out; 79 79 } 80 80 81 81 if (!SWIG_IsOK(SWIG_ConvertPtr(PyList_GetItem(result, 1), (void *)msg, SWIGTYPE_p_msg, SWIG_POINTER_DISOWN))) { 82 fd_log_debug("Error: Cannot convert the second return value to message. \n");82 fd_log_debug("Error: Cannot convert the second return value to message."); 83 83 ret = EINVAL; 84 84 goto out; … … 86 86 87 87 if (!SWIG_IsOK(SWIG_AsVal_int(PyList_GetItem(result, 2), (int *)action))) { 88 fd_log_debug("Error: Cannot convert the third return value to integer. \n");88 fd_log_debug("Error: Cannot convert the third return value to integer."); 89 89 ret = EINVAL; 90 90 goto out; 91 91 } 92 92 93 TRACE_DEBUG(FULL, "Python callback return: *action = %d \n", *action);93 TRACE_DEBUG(FULL, "Python callback return: *action = %d", *action); 94 94 out: 95 95 Py_XDECREF(result); -
extensions/dbg_interactive/lists.i
r741 r979 57 57 /* For debug, show the values of the list */ 58 58 void dump() { 59 fd_log_debug("list: %p \n", $self);60 fd_log_debug(" - next: %p \n", $self->next);61 fd_log_debug(" - prev: %p \n", $self->prev);62 fd_log_debug(" - head: %p \n", $self->head);63 fd_log_debug(" - o : %p \n", $self->o);59 fd_log_debug("list: %p", $self); 60 fd_log_debug(" - next: %p", $self->next); 61 fd_log_debug(" - prev: %p", $self->prev); 62 fd_log_debug(" - head: %p", $self->head); 63 fd_log_debug(" - o : %p", $self->o); 64 64 } 65 65 /* Insert before/after wrapper */ -
extensions/dbg_interactive/messages.i
r740 r979 51 51 52 52 if (!l) { 53 fd_log_debug("Internal error! Python callback disappeared... \n");53 fd_log_debug("Internal error! Python callback disappeared..."); 54 54 return; 55 55 } … … 72 72 /* The callback is supposed to return a message or NULL */ 73 73 if (!SWIG_IsOK(SWIG_ConvertPtr(result, (void *)msg, SWIGTYPE_p_msg, SWIG_POINTER_DISOWN))) { 74 fd_log_debug("Error: Cannot convert the return value to message. \n");74 fd_log_debug("Error: Cannot convert the return value to message."); 75 75 *msg = NULL; 76 76 } -
extensions/dbg_interactive/peers.i
r740 r979 45 45 46 46 if (!data) { 47 TRACE_DEBUG(INFO, "Internal error: missing callback \n");47 TRACE_DEBUG(INFO, "Internal error: missing callback"); 48 48 return; 49 49 } … … 119 119 120 120 if (!validate_cb2_py) { 121 fd_log_debug("Internal error: missing the callback2! \n");121 fd_log_debug("Internal error: missing the callback2!"); 122 122 return ENOTSUP; 123 123 } … … 132 132 /* The result is an integer */ 133 133 if ((result == NULL) || !SWIG_IsOK(SWIG_AsVal_int(result, &ret))) { 134 fd_log_debug("Error: The Python callback did not return an integer. \n");134 fd_log_debug("Error: The Python callback did not return an integer."); 135 135 ret = EINVAL; 136 136 goto out; … … 150 150 151 151 if (!validate_cb_py) { 152 fd_log_debug("Internal error: missing the callback! \n");152 fd_log_debug("Internal error: missing the callback!"); 153 153 return ENOTSUP; 154 154 } … … 163 163 /* The result is supposedly -1, 1, or a cb2 */ 164 164 if (result == NULL) { 165 fd_log_debug("Error: The Python callback did not return a value. \n");165 fd_log_debug("Error: The Python callback did not return a value."); 166 166 ret = EINVAL; 167 167 goto out; … … 171 171 if (cb2) { 172 172 if (validate_cb2_py && (validate_cb2_py != result)) { 173 fd_log_debug("Only 1 register callback2 is supported currently \n");173 fd_log_debug("Only 1 register callback2 is supported currently"); 174 174 ret = ENOTSUP; 175 175 goto out; … … 185 185 } else { /* In this case, the return value must be -1, 0, or 1 */ 186 186 if (!SWIG_IsOK(SWIG_AsVal_int(result, auth))) { 187 fd_log_debug("Error: Cannot convert the return value to integer. \n");187 fd_log_debug("Error: Cannot convert the return value to integer."); 188 188 ret = EINVAL; 189 189 goto out; -
extensions/dbg_interactive/routing.i
r740 r979 83 83 %extend rtd_candidate { 84 84 void dump() { 85 fd_log_debug("candidate %p \n", $self);86 fd_log_debug(" id : %s \n", $self->diamid);87 fd_log_debug(" rlm: %s \n", $self->realm);88 fd_log_debug(" sc : %d \n", $self->score);85 fd_log_debug("candidate %p", $self); 86 fd_log_debug(" id : %s", $self->diamid); 87 fd_log_debug(" rlm: %s", $self->realm); 88 fd_log_debug(" sc : %d", $self->score); 89 89 } 90 90 } … … 99 99 100 100 if (!pycb) { 101 fd_log_debug("Internal error: missing the callback! \n");101 fd_log_debug("Internal error: missing the callback!"); 102 102 return ENOTSUP; 103 103 } … … 113 113 /* The result is supposedly composed of: [ ret, *msg ] */ 114 114 if ((result == NULL) || (!PyList_Check(result)) || (PyList_Size(result) != 2)) { 115 fd_log_debug("Error: The Python callback did not return [ ret, msg ]. \n");115 fd_log_debug("Error: The Python callback did not return [ ret, msg ]."); 116 116 ret = EINVAL; 117 117 goto out; … … 120 120 /* Convert the return values */ 121 121 if (!SWIG_IsOK(SWIG_AsVal_int(PyList_GetItem(result, 0), &ret))) { 122 fd_log_debug("Error: Cannot convert the first return value to integer. \n");122 fd_log_debug("Error: Cannot convert the first return value to integer."); 123 123 ret = EINVAL; 124 124 goto out; 125 125 } 126 126 if (ret) { 127 TRACE_DEBUG(INFO, "The Python callback returned the error code %d (%s) \n", ret, strerror(ret));127 TRACE_DEBUG(INFO, "The Python callback returned the error code %d (%s)", ret, strerror(ret)); 128 128 goto out; 129 129 } 130 130 131 131 if (!SWIG_IsOK(SWIG_ConvertPtr(PyList_GetItem(result, 1), (void *)msg, SWIGTYPE_p_msg, SWIG_POINTER_DISOWN))) { 132 fd_log_debug("Error: Cannot convert the second return value to message. \n");132 fd_log_debug("Error: Cannot convert the second return value to message."); 133 133 ret = EINVAL; 134 134 goto out; … … 183 183 184 184 if (!pycb) { 185 fd_log_debug("Internal error: missing the callback! \n");185 fd_log_debug("Internal error: missing the callback!"); 186 186 return ENOTSUP; 187 187 } … … 198 198 /* The result is supposedly composed of: [ ret, *msg ] */ 199 199 if (result == NULL){ 200 fd_log_debug("Error: The Python callback raised an exception. \n");200 fd_log_debug("Error: The Python callback raised an exception."); 201 201 ret = EINVAL; 202 202 goto out; … … 205 205 /* Convert the return values */ 206 206 if (!SWIG_IsOK(SWIG_AsVal_int(result, &ret))) { 207 fd_log_debug("Error: Cannot convert the return value to integer. \n");207 fd_log_debug("Error: Cannot convert the return value to integer."); 208 208 ret = EINVAL; 209 209 goto out; -
extensions/dbg_interactive/sessions.i
r740 r979 43 43 PyObject *result; 44 44 if (!cb) { 45 fd_log_debug("Internal error: missing callback object! \n");45 fd_log_debug("Internal error: missing callback object!"); 46 46 return; 47 47 } … … 128 128 #if 0 129 129 if (n) { 130 fd_log_debug("A new session has been created \n");130 fd_log_debug("A new session has been created"); 131 131 } else { 132 fd_log_debug("A session with same id already existed \n");132 fd_log_debug("A session with same id already existed"); 133 133 } 134 134 #endif /* 0 */
Note: See TracChangeset
for help on using the changeset viewer.