From: Nick Porter Date: Wed, 16 Apr 2025 09:56:31 +0000 (+0100) Subject: Add C structure for Python state object X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9441e445a21564e0549acb706c075a3f2d863798;p=thirdparty%2Ffreeradius-server.git Add C structure for Python state object --- diff --git a/src/modules/rlm_python/rlm_python.c b/src/modules/rlm_python/rlm_python.c index f51108779ff..cba7acfd3d0 100644 --- a/src/modules/rlm_python/rlm_python.c +++ b/src/modules/rlm_python/rlm_python.c @@ -109,6 +109,18 @@ typedef struct { PyObject *state; //!< Session state list. } py_freeradius_request_t; +/** Wrapper around a python instance + * + * This is added to the FreeRADIUS module to allow us to + * get at the global and thread local instance data. + */ +typedef struct { + PyObject_HEAD //!< Common fields needed for every python object. + rlm_python_t const *inst; //!< Module instance. + rlm_python_thread_t *t; //!< Thread-specific python instance. + request_t *request; //!< Current request. +} py_freeradius_state_t; + static void *python_dlhandle; static PyThreadState *global_interpreter; //!< Our first interpreter.