1 /* 2 * Copyright (c) 2008, Jamie Beverly. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without modification, are 6 * permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, this list of 9 * conditions and the following disclaimer. 10 * 11 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 * of conditions and the following disclaimer in the documentation and/or other materials 13 * provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY Jamie Beverly ``AS IS'' AND ANY EXPRESS OR IMPLIED 16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Jamie Beverly OR 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * 25 * The views and conclusions contained in the software and documentation are those of the 26 * authors and should not be interpreted as representing official policies, either expressed 27 * or implied, of Jamie Beverly. 28 */ 29 30 #ifndef __PAM_STATIC_MACROS_H 31 #define __PAM_STATIC_MACROS_H 32 33 #ifndef PAM_EXTERN 34 35 #ifdef PAM_STATIC 36 37 #define PAM_EXTERN static 38 39 struct pam_module { 40 const char *name; /* Name of the module */ 41 42 /* These are function pointers to the module's key functions. */ 43 44 int (*pam_sm_authenticate)(pam_handle_t *pamh, int flags, 45 int argc, const char **argv); 46 int (*pam_sm_setcred)(pam_handle_t *pamh, int flags, 47 int argc, const char **argv); 48 int (*pam_sm_acct_mgmt)(pam_handle_t *pamh, int flags, 49 int argc, const char **argv); 50 int (*pam_sm_open_session)(pam_handle_t *pamh, int flags, 51 int argc, const char **argv); 52 int (*pam_sm_close_session)(pam_handle_t *pamh, int flags, 53 int argc, const char **argv); 54 int (*pam_sm_chauthtok)(pam_handle_t *pamh, int flags, 55 int argc, const char **argv); 56 }; 57 58 #else /* !PAM_STATIC */ 59 60 #define PAM_EXTERN extern 61 62 #endif /* PAM_STATIC */ 63 64 #endif /* PAM_EXTERN */ 65 66 #endif /* __PAM_STATIC_MACROS_H */ 67 68