Main Page | Class List | Directories | File List | Class Members | File Members

ipmi_posix.h File Reference

#include <OpenIPMI/os_handler.h>
#include <OpenIPMI/selector.h>

Go to the source code of this file.

Defines

#define IPMI_TYPE_DEPRECATED
#define IPMI_VAR_DEPRECATED

Functions

void posix_vlog (char *format, enum ipmi_log_type_e log_type, va_list ap)
os_handler_tipmi_posix_setup_os_handler (void)
selector_tipmi_posix_os_handler_get_sel (os_handler_t *os_hnd)
os_handler_tipmi_posix_get_os_handler (void)
void ipmi_posix_free_os_handler (os_handler_t *os_hnd)
void ipmi_posix_os_handler_set_sel (os_handler_t *os_hnd, selector_t *sel)
os_handler_tipmi_posix_thread_setup_os_handler (int wake_sig)
selector_tipmi_posix_thread_os_handler_get_sel (os_handler_t *os_hnd)
os_handler_tipmi_posix_thread_get_os_handler (void)
void ipmi_posix_thread_free_os_handler (os_handler_t *os_hnd)
void ipmi_posix_thread_os_handler_set_sel (os_handler_t *os_hnd, selector_t *sel)
int posix_mutex_alloc (void **)
void posix_mutex_free (void *)
void posix_mutex_lock (void *)
void posix_mutex_unlock (void *)
void ipmi_posix_cleanup_os_handler (os_handler_t *os_hnd) IPMI_FUNC_DEPRECATED
int ipmi_posix_sel_select (os_handler_t *os_hnd, struct timeval *timeout) IPMI_FUNC_DEPRECATED
void ipmi_posix_sel_select_loop (os_handler_t *os_hnd) IPMI_FUNC_DEPRECATED
void ipmi_posix_thread_cleanup_os_handler (os_handler_t *os_hnd) IPMI_FUNC_DEPRECATED
int ipmi_posix_thread_sel_select (os_handler_t *os_hnd, struct timeval *timeout) IPMI_FUNC_DEPRECATED
void ipmi_posix_thread_sel_select_loop (os_handler_t *os_hnd) IPMI_FUNC_DEPRECATED


Define Documentation

typedef ipmi_entity_presence_nd_cb ipmi_entity_presence_cb IPMI_TYPE_DEPRECATED
 

Definition at line 139 of file ipmi_posix.h.

#define IPMI_VAR_DEPRECATED
 

Definition at line 140 of file ipmi_posix.h.


Function Documentation

void ipmi_posix_cleanup_os_handler os_handler_t os_hnd  ) 
 

Definition at line 649 of file posix_os_hnd.c.

References free_os_handler().

00650 {
00651     free_os_handler(os_hnd);
00652 }

void ipmi_posix_free_os_handler os_handler_t os_hnd  ) 
 

Definition at line 555 of file posix_os_hnd.c.

References os_handler_s::internal_data.

Referenced by free_os_handler(), and ipmi_posix_setup_os_handler().

00556 {
00557     iposix_info_t *info = os_hnd->internal_data;
00558 
00559 #ifdef HAVE_GDBM
00560     if (info->gdbm_filename)
00561         free(info->gdbm_filename);
00562     if (info->gdbmf)
00563         gdbm_close(info->gdbmf);
00564 #endif
00565     free(info);
00566     free(os_hnd);
00567 }

os_handler_t* ipmi_posix_get_os_handler void   ) 
 

Definition at line 531 of file posix_os_hnd.c.

Referenced by ipmi_posix_setup_os_handler(), and main().

00532 {
00533     os_handler_t  *rv;
00534     iposix_info_t *info;
00535 
00536     rv = malloc(sizeof(*rv));
00537     if (!rv)
00538         return NULL;
00539 
00540     memcpy(rv, &ipmi_posix_os_handler, sizeof(*rv));
00541 
00542     info = malloc(sizeof(*info));
00543     if (!info) {
00544         free(rv);
00545         return NULL;
00546     }
00547     memset(info, 0, sizeof(*info));
00548 
00549     rv->internal_data = info;
00550 
00551     return rv;
00552 }

selector_t* ipmi_posix_os_handler_get_sel os_handler_t os_hnd  ) 
 

Definition at line 577 of file posix_os_hnd.c.

References os_handler_s::internal_data, and iposix_info_s::sel.

Referenced by main().

00578 {
00579     iposix_info_t *info = os_hnd->internal_data;
00580     return info->sel;
00581 }

void ipmi_posix_os_handler_set_sel os_handler_t os_hnd,
selector_t sel
 

Definition at line 570 of file posix_os_hnd.c.

References os_handler_s::internal_data, and iposix_info_s::sel.

Referenced by main().

00571 {
00572     iposix_info_t *info = os_hnd->internal_data;
00573     info->sel = sel;
00574 }

int ipmi_posix_sel_select os_handler_t os_hnd,
struct timeval *  timeout
 

Definition at line 636 of file posix_os_hnd.c.

References perform_one_op().

00638 {
00639     return perform_one_op(os_hnd, timeout);
00640 }

void ipmi_posix_sel_select_loop os_handler_t os_hnd  ) 
 

Definition at line 643 of file posix_os_hnd.c.

References operation_loop().

00644 {
00645     operation_loop(os_hnd);
00646 }

os_handler_t* ipmi_posix_setup_os_handler void   ) 
 

Definition at line 584 of file posix_os_hnd.c.

References os_handler_s::internal_data, ipmi_posix_free_os_handler(), ipmi_posix_get_os_handler(), sel, iposix_info_s::sel, and sel_alloc_selector().

Referenced by main().

00585 {
00586     os_handler_t  *os_hnd;
00587     selector_t    *sel;
00588     int           rv;
00589     iposix_info_t *info;
00590 
00591     os_hnd = ipmi_posix_get_os_handler();
00592     if (!os_hnd)
00593         return NULL;
00594 
00595     rv = sel_alloc_selector(os_hnd, &sel);
00596     if (rv) {
00597         ipmi_posix_free_os_handler(os_hnd);
00598         os_hnd = NULL;
00599         goto out;
00600     }
00601 
00602     info = os_hnd->internal_data;
00603     info->sel = sel;
00604 
00605  out:
00606     return os_hnd;
00607 }

void ipmi_posix_thread_cleanup_os_handler os_handler_t os_hnd  ) 
 

Definition at line 960 of file posix_thread_os_hnd.c.

References free_os_handler().

00961 {
00962     free_os_handler(os_hnd);
00963 }

void ipmi_posix_thread_free_os_handler os_handler_t os_hnd  ) 
 

Definition at line 585 of file posix_thread_os_hnd.c.

References os_handler_s::internal_data.

Referenced by free_os_handler(), and ipmi_posix_thread_setup_os_handler().

00586 {
00587     pt_os_hnd_data_t *info = os_hnd->internal_data;
00588 
00589 #ifdef HAVE_GDBM
00590     pthread_mutex_destroy(&info->gdbm_lock);
00591     if (info->gdbm_filename)
00592         free(info->gdbm_filename);
00593     if (info->gdbmf)
00594         gdbm_close(info->gdbmf);
00595 #endif
00596     free(info);
00597     free(os_hnd);
00598 }

os_handler_t* ipmi_posix_thread_get_os_handler void   ) 
 

Definition at line 836 of file posix_thread_os_hnd.c.

Referenced by ipmi_posix_thread_setup_os_handler().

00837 {
00838     os_handler_t     *rv;
00839     pt_os_hnd_data_t *info;
00840 #ifdef HAVE_GDBM
00841     int              err;
00842 #endif
00843 
00844     rv = malloc(sizeof(*rv));
00845     if (!rv)
00846         return NULL;
00847 
00848     memcpy(rv, &ipmi_posix_thread_os_handler, sizeof(*rv));
00849 
00850     info = malloc(sizeof(pt_os_hnd_data_t));
00851     if (!info) {
00852         free(rv);
00853         return NULL;
00854     }
00855     memset(info, 0, sizeof(*info));
00856     rv->internal_data = info;
00857 
00858 #ifdef HAVE_GDBM
00859     err = pthread_mutex_init(&info->gdbm_lock, NULL);
00860     if (err) {
00861         free(info);
00862         free(rv);
00863         return NULL;
00864     }
00865 #endif
00866 
00867     return rv;
00868 }

selector_t* ipmi_posix_thread_os_handler_get_sel os_handler_t os_hnd  ) 
 

Definition at line 609 of file posix_thread_os_hnd.c.

References os_handler_s::internal_data, and pt_os_hnd_data_s::sel.

00610 {
00611     pt_os_hnd_data_t  *info = os_hnd->internal_data;
00612 
00613     return info->sel;
00614 }

void ipmi_posix_thread_os_handler_set_sel os_handler_t os_hnd,
selector_t sel
 

Definition at line 601 of file posix_thread_os_hnd.c.

References os_handler_s::internal_data, and pt_os_hnd_data_s::sel.

00602 {
00603     pt_os_hnd_data_t  *info = os_hnd->internal_data;
00604 
00605     info->sel = sel;
00606 }

int ipmi_posix_thread_sel_select os_handler_t os_hnd,
struct timeval *  timeout
 

Definition at line 947 of file posix_thread_os_hnd.c.

References perform_one_op().

00949 {
00950     return perform_one_op(os_hnd, timeout);
00951 }

void ipmi_posix_thread_sel_select_loop os_handler_t os_hnd  ) 
 

Definition at line 954 of file posix_thread_os_hnd.c.

References operation_loop().

00955 {
00956     operation_loop(os_hnd);
00957 }

os_handler_t* ipmi_posix_thread_setup_os_handler int  wake_sig  ) 
 

Definition at line 871 of file posix_thread_os_hnd.c.

References os_handler_s::internal_data, ipmi_posix_thread_free_os_handler(), ipmi_posix_thread_get_os_handler(), pt_os_hnd_data_s::oldact, posix_thread_sighandler(), pt_os_hnd_data_s::sel, sel_alloc_selector(), and pt_os_hnd_data_s::wake_sig.

Referenced by main().

00872 {
00873     os_handler_t     *os_hnd;
00874     pt_os_hnd_data_t *info;
00875     struct sigaction act;
00876     int              rv;
00877 
00878     os_hnd = ipmi_posix_thread_get_os_handler();
00879     if (!os_hnd)
00880         return NULL;
00881 
00882     info = os_hnd->internal_data;
00883     info->wake_sig = wake_sig;
00884 
00885     rv = sel_alloc_selector(os_hnd, &info->sel);
00886     if (rv) {
00887         ipmi_posix_thread_free_os_handler(os_hnd);
00888         os_hnd = NULL;
00889         goto out;
00890     }
00891 
00892     act.sa_handler = posix_thread_sighandler;
00893     sigemptyset(&act.sa_mask);
00894     act.sa_flags = 0;
00895     rv = sigaction(wake_sig, &act, &info->oldact);
00896     if (rv) {
00897         ipmi_posix_thread_free_os_handler(os_hnd);
00898         os_hnd = NULL;
00899         goto out;
00900     }
00901 
00902  out:
00903     return os_hnd;
00904 }

int posix_mutex_alloc void **   ) 
 

Definition at line 614 of file posix_os_hnd.c.

Referenced by sel_alloc_selector().

00615 {
00616     *val = NULL;
00617     return 0;
00618 }

void posix_mutex_free void *   ) 
 

Definition at line 620 of file posix_os_hnd.c.

Referenced by sel_alloc_selector(), and sel_free_selector().

00621 {
00622 }

void posix_mutex_lock void *   ) 
 

Definition at line 624 of file posix_os_hnd.c.

Referenced by ipmi_sel_set_read_fds_handler(), process_fds(), process_timers(), sel_clear_fd_handlers(), sel_free_timer(), sel_select(), sel_select_loop(), sel_set_fd_except_handler(), sel_set_fd_handlers(), sel_set_fd_read_handler(), sel_set_fd_write_handler(), sel_start_timer(), sel_stop_timer(), and wake_sel_thread_lock().

00625 {
00626 }

void posix_mutex_unlock void *   ) 
 

Definition at line 628 of file posix_os_hnd.c.

Referenced by ipmi_sel_set_read_fds_handler(), process_fds(), process_timers(), sel_clear_fd_handlers(), sel_free_timer(), sel_select(), sel_select_loop(), sel_set_fd_except_handler(), sel_set_fd_handlers(), sel_set_fd_read_handler(), sel_set_fd_write_handler(), sel_start_timer(), sel_stop_timer(), and wake_sel_thread_lock().

00629 {
00630 }

void posix_vlog char *  format,
enum ipmi_log_type_e  log_type,
va_list  ap
 

Definition at line 68 of file basic_ui.c.

Referenced by sposix_vlog().

00071 {
00072 }


© sourcejam.com 2005-2008