• Main Page
  • Data Structures
  • Files
  • File List
  • Globals

include/pam_netns.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: pam_netns.h 47 2010-11-24 01:59:04Z julianthome $
00003  *
00004  *   pam_netns - Linux-PAM module for instantiating session network namespaces
00005  *
00006  *   Copyright (C) 2010 Wilhelm Meier (wilhelm.meier@informatik.fh-kl.de)
00007  *
00008  *   This program is free software; you can redistribute it and/or modify it under the terms of
00009  *   the GNU General Public License as published by the Free Software Foundation;
00010  *   either version 3 of the License, or (at your option) any later version.
00011  *
00012  *   This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
00013  *   without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00014  *   See the GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License along with this program;
00017  *   if not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00027 #ifndef PAM_NETNS_H
00028 #define PAM_NETNS_H PAM_NETNS_H
00029 
00030 // all POSIX stuff
00031 #include "common.h"
00032 #include <security/pam_ext.h>
00033 
00034 // should this be in sched.h ?
00035 #ifndef CLONE_NEWNET
00036 #include <linux/sched.h>
00037 #endif
00038 
00039 #include "util.h"
00040 #include "pexec.h"
00041 #define MAX_NUMBER_OF_PROXIES 10
00042 #define DEFAULT_SESID_LEN 48
00043 
00048 typedef struct {
00049         pam_handle_t *pamh;
00051         bool debug;
00053         char before_script[UNIX_PATH_MAX];
00055         char after_script[UNIX_PATH_MAX];
00057         char setup_script[UNIX_PATH_MAX];
00059         char cleanup_script[UNIX_PATH_MAX];
00061         char shm_name[UNIX_PATH_MAX];
00063         char shm_hlpr_name[UNIX_PATH_MAX];
00066         int nodaemon;
00069         int timeout;
00072         char prefix[NAME_MAX];
00075         int ns_id;
00079         char helper[UNIX_PATH_MAX];
00081         const char *user;
00083         int out_sfd;
00086         char out_socket[UNIX_PATH_MAX];
00088         bool bind_mount;
00091         bool shm_del;
00093         bool unshare_fs;
00095         bool affect_root;
00097 } options_t;
00098 
00099 #define DEFAULT_BEFORE_SCRIPT           "/etc/security/netns_before"
00100 #define DEFAULT_AFTER_SCRIPT            "/etc/security/netns_after"
00101 #define DEFAULT_SETUP_SCRIPT            "/etc/security/netns_setup"
00102 #define DEFAULT_CLEANUP_SCRIPT          "/etc/security/netns_cleanup"
00103 #define DEFAULT_SHM_NAME                "/tmp/pam_netns_shmXXXXXX"
00104 #define DEFAULT_TIMEOUT_SECS            4
00105 #define DEFAULT_PREFIX                  "ns"
00106 #define DEFAULT_HELPER                  "/lib/security/pam_netns_helper"
00107 
00108 #ifdef _POSIX_THREADS
00109 
00110 #else                           // _POSIX_THREADS
00111 #error "No Posix Threads available"
00112 #endif
00113 
00114 void parse_options(int argc, const char **argv);
00115 
00116 typedef int (*cb_ft) (const void *param1, ...);
00117 
00118 #endif

Generated on Thu Dec 2 2010 13:12:28 for pam_netns by  doxygen 1.7.1