Changeset 706:4ffbc9f1e922 in freeDiameter for extensions/dbg_interactive
- Timestamp:
- Feb 9, 2011, 3:26:58 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/dbg_interactive
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/dbg_interactive/dbg_interactive.i
r662 r706 152 152 153 153 /* Overwrite declaration to apply typemaps */ 154 int fd_sess_fromsid ( char * STRING, size_t LENGTH, struct session ** OUTPUT, int * BOOL_OUT);154 int fd_sess_fromsid ( unsigned char * STRING, size_t LENGTH, struct session ** OUTPUT, int * BOOL_OUT); 155 155 156 156 -
extensions/dbg_interactive/messages.i
r688 r706 341 341 342 342 /* Get the source */ 343 char *source() {344 char * s = NULL;345 int ret = fd_msg_source_get($self, &s);346 if (ret != 0) { 347 DI_ERROR(ret, NULL, NULL); 348 return NULL;349 } 350 return s;343 %cstring_output_allocate_size(char ** outid, size_t * outlen, /* do not free */); 344 void source(char ** outid, size_t * outlen) { 345 int ret = fd_msg_source_get($self, outid, outlen); 346 if (ret != 0) { 347 DI_ERROR(ret, NULL, NULL); 348 return; 349 } 350 return; 351 351 } 352 352 -
extensions/dbg_interactive/peers.i
r640 r706 97 97 98 98 %inline %{ 99 static struct peer_hdr * peer_search(char * diamid) {99 static struct peer_hdr * peer_search(char *STRING, size_t LENGTH) { 100 100 struct peer_hdr *r = NULL; 101 int ret = fd_peer_getbyid( diamid, &r );101 int ret = fd_peer_getbyid( STRING, LENGTH, 0, &r ); 102 102 if (ret) { 103 103 DI_ERROR(ret, NULL, NULL); -
extensions/dbg_interactive/routing.i
r640 r706 55 55 fd_rtd_free(&r); 56 56 } 57 void add(char * peerid, char * realm) { 58 int ret = fd_rtd_candidate_add($self, peerid, realm); 57 %apply (char *STRING, int LENGTH) { (char * peerid, size_t peeridlen) }; 58 %apply (char *STRING, int LENGTH) { (char * realm, size_t realmlen) }; 59 void add(char * peerid, size_t peeridlen, char * realm, size_t realmlen) { 60 int ret = fd_rtd_candidate_add($self, peerid, peeridlen, realm, realmlen); 59 61 if (ret != 0) { 60 62 DI_ERROR(ret, NULL, NULL); … … 62 64 } 63 65 void remove(char * STRING, size_t LENGTH) { 64 fd_rtd_candidate_del($self, STRING, LENGTH);65 } 66 void error(char * dest, char * STRING, size_t LENGTH, uint32_t rcode) {67 int ret = fd_rtd_error_add($self, dest, (uint8_t *)STRING, LENGTH, rcode);66 fd_rtd_candidate_del($self, (os0_t)STRING, LENGTH); 67 } 68 void error(char * peerid, size_t peeridlen, char * STRING, size_t LENGTH, uint32_t rcode) { 69 int ret = fd_rtd_error_add($self, peerid, peeridlen, (os0_t)STRING, LENGTH, rcode); 68 70 if (ret != 0) { 69 71 DI_ERROR(ret, NULL, NULL); -
extensions/dbg_interactive/sessions.i
r639 r706 40 40 %{ 41 41 /* call it (might be called from a different thread than the interpreter, when session times out) */ 42 static void call_the_python_cleanup_callback(session_state * state, char *sid, void * cb) {42 static void call_the_python_cleanup_callback(session_state * state, os0_t sid, void * cb) { 43 43 PyObject *result; 44 44 if (!cb) { … … 100 100 int ret; 101 101 struct session * s = NULL; 102 ret = fd_sess_new(&s, fd_g_config->cnf_diamid, "dbg_interactive", sizeof("dbg_interactive"));102 ret = fd_sess_new(&s, fd_g_config->cnf_diamid, fd_g_config->cnf_diamid_len, (os0_t)"dbg_interactive", CONSTSTRLEN("dbg_interactive")); 103 103 if (ret != 0) { 104 104 DI_ERROR(ret, NULL, NULL); … … 110 110 int ret; 111 111 struct session * s = NULL; 112 ret = fd_sess_new(&s, diamid, STRING, LENGTH);112 ret = fd_sess_new(&s, diamid, 0, (os0_t)STRING, LENGTH); 113 113 if (ret != 0) { 114 114 DI_ERROR(ret, NULL, NULL); … … 120 120 int ret, n; 121 121 struct session * s = NULL; 122 ret = fd_sess_fromsid( STRING, LENGTH, &s, &n);122 ret = fd_sess_fromsid((os0_t)STRING, LENGTH, &s, &n); 123 123 if (ret != 0) { 124 124 DI_ERROR(ret, NULL, NULL); … … 144 144 return; 145 145 } 146 char * getsid() { 146 147 %cstring_output_allocate_size(char ** outsid, size_t * sidlen, /* do not free */); 148 void getsid(char ** outsid, size_t * sidlen) { 147 149 int ret; 148 char * sid = NULL; 149 ret = fd_sess_getsid( $self, &sid); 150 ret = fd_sess_getsid( $self, (void *)outsid, sidlen); 150 151 if (ret != 0) { 151 152 DI_ERROR(ret, NULL, NULL); 152 return NULL;153 return; 153 154 } 154 return sid;155 return; 155 156 } 156 157 void settimeout(long seconds) {
Note: See TracChangeset
for help on using the changeset viewer.