/*1* SPDX-License-Identifier: ISC2*3* Copyright (c) 2014 Todd C. Miller <[email protected]>4*5* Permission to use, copy, modify, and distribute this software for any6* purpose with or without fee is hereby granted, provided that the above7* copyright notice and this permission notice appear in all copies.8*9* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES10* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF11* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR12* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES13* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN14* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF15* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.16*/1718#ifndef SUDO_PYTHON_DEBUG_H19#define SUDO_PYTHON_DEBUG_H2021#include <sudo_debug.h>2223/*24* Sudo python plugin debug subsystems.25* Note that python_subsystem_ids[] is filled in at debug registration time.26*/27extern unsigned int python_subsystem_ids[];28#define PYTHON_DEBUG_PY_CALLS (python_subsystem_ids[0])29#define PYTHON_DEBUG_C_CALLS (python_subsystem_ids[1])30#define PYTHON_DEBUG_PLUGIN_LOAD (python_subsystem_ids[2])31#define PYTHON_DEBUG_CALLBACKS (python_subsystem_ids[3])32#define PYTHON_DEBUG_INTERNAL (python_subsystem_ids[4])33#define PYTHON_DEBUG_PLUGIN (python_subsystem_ids[5])3435bool python_debug_parse_flags(struct sudo_conf_debug_file_list *debug_files, const char *entry);36bool python_debug_register(const char *program, struct sudo_conf_debug_file_list *debug_files);37void python_debug_deregister(void);3839#define debug_return_ptr_pynone \40do { \41Py_INCREF(Py_None); \42debug_return_ptr(Py_None); \43} while(0)4445#endif /* SUDO_PYTHON_DEBUG_H */464748