[
Index ] [ Bottom ]

daqctl v2 library : ksnmplib (Part 2)


[
Top | Index | Bottom | Source ]

int ksnmp_session_add_to_list (struct snmp_session *sess)
---------------------------------------------------------

This function add on open snmp session to an internal list containing all the open sessions. The user can retrieve the session opened on a remote node using ksnmp_session_find. This function should not be called by the user.

    sess :
        pointer to the snmp session

    return value :
        KSNMP_OK or an error code if an error occurred.

[
Top | Index | Bottom | Source ]

struct snmp_session *ksnmp_session_find (char *hostname, char *community)
----------------------------------------------------------------------

This function allows the user to retrieve (if it does exist) the snmp session corresponding to a node and a specified community.

    hostname :
        name (or address in the form xxx.yyy.www.zzz) of host
    community :
        community related to the requested session

    return value :
        pointer to the snmp_session or NULL if it does not exists

[
Top | Index | Bottom | Source ]

int ksnmp_session_close (struct snmp_session *ss)
-------------------------------------------------

This function closes a the session opened by functions in this libraries. The internal session list element is automatically freed.

    ss :
        snmp session to close

    return value :
        KSNMP_OK or KSNMP_ERR_NOSUCHSESS if the session does not
        exist.

[
Top | Index | Bottom | Source ]

void ksnmp_session_close_all (void)
-----------------------------------

This function closes all the sessions opened by functions in this library. The memory allocated by the internal session list is automatically freed.


[ Top | Index | Bottom | Source ]

struct session_list *ksnmp_session_remove_from_list (
                     struct session_list *ss_element)
-----------------------------------------------------

This function is used to remove a session from the session list and to free the memory allocated by its session list element. The user should not call this function directly.

    ss_element :
        address of the session list element to remove

    return value :
        address of the next element in the list.

[
Top | Index | Bottom | Source ]

void ksnmp_session_list_free (void)
-----------------------------------

This function is used to free the memory allocated by the session list. The user should not call this function directly.


[ Top | Index | Bottom | Source ]

struct ksnmp_procvar *ksnmp_vars_find (char *process,
                                       char *remote_variable_name)
------------------------------------------------------------------

This function searches the list of the known remote variable indexes and returns the pointer to the element of the list containing the informations on the variable remote_variable_name owned by the process <process@node> or NULL if the variable have never been addressed.

    process :
        name of the remote process (process@node)
    remote_variable_name :
        remote variable name

    return value :
        pointer to a list element containing the snmp session
        and the snmp name tail of the requested variable.

[
Top | Index | Bottom | Source ]

int ksnmp_vars_add_to_list (char *process,
                            char *remote_variable_name,
                            char *tail, struct snmp_session *ss)
----------------------------------------------------------------

This function adds the variable remote_variable_name owned by the process <process@node> to the internal list of the known variables.

    process :
        name of the remote process (process@node)
    remote_variable_name :
        remote variable name
    tail :
        the tail of the complete snmp address of the variable
    ss :
        the snmp session opened on the node on which the owner
        process is running

    return value :
        KSNMP_OK or KSNMP_ERR_ALLOCFAIL if an allocation error
        occurred.

[
Top | Index | Bottom | Source ]

struct ksnmp_procvar *ksnmp_vars_remove_from_list (
                      struct ksnmp_procvar *element)
----------------------------------------------------

This function remove the variable list element pointed by element and frees its allocated memory.

    element :
        pointer to the list element

    return value :
        new value of element, pointer to the next list element

[
Top | Index | Bottom | Source ]

void ksnmp_vars_free_varlist (void)
-----------------------------------

This function frees the known variable list.


[ Top | Index | Bottom | Source ]

int ksnmp_vars_read_variable (char *process,
                              char *remote_variable_name,
                              short *vtype, char **pointer_to_value)
--------------------------------------------------------------------

This function allows the user to retrieve (if it does exist) a remote variable specifying its name and the owner process in the form <process@node>. It looks for an open snmp session on the remote node and creates it if it does not exist. A local list of the snmp names related to remote variables is kept internally, the first time the variable is addressed ksnmp_search_remote_vlist is called to build the correct snmp name. If the remote variable does not exist, an error is returned.

    process :
        name of the remote process (process@node)
    remote_variable_name :
        remote variable name
    vtype :
        pointer to an integer containing the output variable type
    pointer_to_value :
        a pointer to a buffer containing the output variable value

    return value :
        KSNMP_OK if success, an error code of the following:
        KSNMP_ERR_NOTREMOTE,
        any error returned by ksnmp_session_init,
        any error returned by ksnmp_vars_search_remote_vlist,
        any error returned by ksnmp_vars_add_to_list,
        any error returned by ksnmp_get
        otherwise.

[
Top | Index | Bottom | Source ]

char *ksnmp_vars_search_remote_vlist(struct snmp_session *ss,
                                     char *proc_name,
                                     char *remote_proc_var_name,
                                     char *ksnmp_var_tail)
----------------------------------------------------------------

This function allows the user to retrieve (if it does exist) the tail of the complete name of the snmp variable containing the value of the remote variable specified by name (remote_proc_var_name) and owned by the process proc_name.

    ss :
        snmp session opened on the host
    proc_name :
        name of the remote process
    remote_proc_var_name :
        remote variable name
    ksnmp_var_tail :
        pointer to an allocated string where the tail of the
        snmp_variable will be put.

    return value :
        pointer to the string containing the tail of the full specified
        snmp variable corresponding to the given variable.

[
Top | Index | Bottom | Source ]

int ksnmp_vars_get_remote_process_index (struct snmp_session *ss,
                                         char *proc_name)
-----------------------------------------------------------------

This function allows the user to retrieve (if it does exist) the index corresponding to a remote process.

    ss :
        snmp session opened on the host
    proc_name :
        name of the remote process

    return value :
        process index, (int) NULL the process does not exist.

[
Top | Index | Bottom | Source ]

int ksnmp_vars_get_remote_variable_index (struct snmp_session *ss,
                                          int proc_index,
                                          char *remote_proc_var_name)
---------------------------------------------------------------------

This function allows the user to retrieve (if it does exist) the index corresponding to a variable owned by a remote process specified by index.

    ss :
        snmp session opened on the host
    proc_index :
        index of the remote process
    remote_proc_var_name :
        remote variable name

    return value :
        variable index, (int) NULL if it does not exist.

[
Top | Index | Bottom | Source ]

ksnmplib_protos.h

The prototypes of the KLOE DAQ snmp routines version 2.

File name : ksnmplib_protos.h

Author : Enrico Pasqualucci

Header file containing the prototypes for the ksnmp function. Should be included in each file where a function in that library is called.


[ Top | Index | Bottom | Source ]

ksnmp_api_protos.h

The prototypes of the application interface functions in the KLOE DAQ snmp library version 2.

File name : ksnmp_api_protos.h

Author : Enrico Pasqualucci

Header file containing the prototypes for the ksnmp_api functions. Should be included in each file where a function in that library is called.


[ Top | Index | Bottom | Source ]

ksnmp_environment_protos.h

The prototypes of the environment management functions KLOE DAQ snmp library version 2.

File name : ksnmp_environment_protos.h

Author : Enrico Pasqualucci

Header file containing the prototypes for the ksnmp_getenv function. Should be included in each file where a function in that library is called.


[ Top | Index | Bottom | Source ]

ksnmp_map_protos.h

The prototypes of the network map mangement functions in the KLOE DAQ snmp library version 2.

File name : ksnmp_map_protos.h

Author : Enrico Pasqualucci

Header file containing the prototypes for the ksnmp_map functions. Should be included in each file where a function in that library is called.


[ Top | Index | Bottom | Source ]

ksnmp_message_system_interface_protos.h

The prototypes of the message system functions of the KLOE DAQ snmp library version 2.

File name : ksnmp_message_system_interface_protos.h

Author : Enrico Pasqualucci

Header file containing the prototypes for the ksnmp message system functions. Should be included in each file where a function in that library is called.


[ Top | Index | Bottom | Source ]

ksnmp_session_protos.h

The prototypes of the session management functions KLOE DAQ snmp library version 2.

File name : ksnmp_session_protos.h

Author : Enrico Pasqualucci

Header file containing the prototypes for the ksnmp_session function. Should be included in each file where a function in that library is called.


[ Top | Index | Bottom | Source ]

ksnmp_vars_protos.h

The prototypes of the remote variable management functions in the KLOE DAQ snmp libraries version 2.

File name : ksnmp_vars_protos.h

Author : Enrico Pasqualucci

Header file containing the prototypes for the ksnmp functions dedicated to remote variable management. Should be included in each file where a function in that library is called.


[ Top | Index | Bottom | Source ]

netmap.h

File name: netmap.h

Structure and constants for the KLOE network map

Author: E. Pasqualucci

This file contains the internal structure of the KLOE network map used by the run control and dfc programs. The network map is seen by the program as a list of switch ports, each port contains a list of the related connected nodes. The map structure includes also the pointers to the snmp session structures for each host.


[ Top | Index | Bottom | Source ]

default_parameters.h

Default parameters of the KLOE DAQ snmp library.

File name : default_parameters.h

Author: E. Pasqualucci

This file contains the default values of some constant parameters used in ksnmplib, such as the name of the gigaswitch, the arp server or the name of the KLOE community. All these values can be changed at run time by setting the appropriate environment variables. The corresponding global variables are also defined here; to use them in files other than ksnmp_environment.c the header file environmental.h must be included.


[ Top | Index | Bottom | Source ]

environmental.h

Environmental variables definition.

File name : environmental.h

Author: E. Pasqualucci

In this file the environmental variable used in the ksnmplib libraries are declared.


[ Index ] [ Top ]
Created 29/05/97 17:31 by source2html v0.9