From: Nick Porter Date: Wed, 16 Apr 2025 09:47:34 +0000 (+0100) Subject: Define C structures for Python request and pair objects X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e07b6b4f830abe1023465cfbe8b04dde65b753f;p=thirdparty%2Ffreeradius-server.git Define C structures for Python request and pair objects --- diff --git a/src/modules/rlm_python/rlm_python.c b/src/modules/rlm_python/rlm_python.c index 7dbb7e39a12..f51108779ff 100644 --- a/src/modules/rlm_python/rlm_python.c +++ b/src/modules/rlm_python/rlm_python.c @@ -90,6 +90,25 @@ typedef struct { PyThreadState *state; //!< Module instance/thread specific state. } rlm_python_thread_t; +/** Additional fields for pairs + * + */ +typedef struct { + PyObject_HEAD //!< Common fields needed for every python object. + fr_dict_attr_t const *da; //!< dictionary attribute for this pair. + fr_pair_t *vp; //!< Real FreeRADIUS pair for this Python pair. + unsigned int idx; //!< Instance index. + PyObject *parent; //!< Parent object of this pair. +} py_freeradius_pair_t; + +typedef struct { + PyObject_HEAD //!< Common fields needed for every python object. + PyObject *request; //!< Request list. + PyObject *reply; //!< Reply list. + PyObject *control; //!< Control list. + PyObject *state; //!< Session state list. +} py_freeradius_request_t; + static void *python_dlhandle; static PyThreadState *global_interpreter; //!< Our first interpreter.