## prelude-client-profile

prelude-client-profile

## Synopsis

    typedef             prelude_gid_t;
    typedef             prelude_uid_t;
    typedef             prelude_client_profile_t;
    int                 prelude_client_profile_new          (prelude_client_profile_t **ret,
                                                             const char *name);
    prelude_client_profile_t * prelude_client_profile_ref   (prelude_client_profile_t *cp);
    void                prelude_client_profile_destroy      (prelude_client_profile_t *cp);
    void                prelude_client_profile_get_config_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_analyzerid_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_tls_key_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_tls_server_ca_cert_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_tls_server_keycert_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_tls_server_crl_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_tls_client_keycert_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_tls_client_trusted_cert_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_backup_dirname
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_profile_dirname
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_get_default_config_dirname
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    int                 prelude_client_profile_set_prefix   (prelude_client_profile_t *cp,
                                                             const char *prefix);
    void                prelude_client_profile_get_prefix   (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);
    void                prelude_client_profile_set_uid      (prelude_client_profile_t *cp,
                                                             prelude_uid_t uid);
    prelude_uid_t       prelude_client_profile_get_uid      (const prelude_client_profile_t *cp);
    void                prelude_client_profile_set_gid      (prelude_client_profile_t *cp,
                                                             prelude_uid_t gid);
    prelude_gid_t       prelude_client_profile_get_gid      (const prelude_client_profile_t *cp);
    int                 prelude_client_profile_set_name     (prelude_client_profile_t *cp,
                                                             const char *name);
    const char *        prelude_client_profile_get_name     (const prelude_client_profile_t *cp);
    uint64_t            prelude_client_profile_get_analyzerid
                                                            (const prelude_client_profile_t *cp);
    void                prelude_client_profile_set_analyzerid
                                                            (prelude_client_profile_t *cp,
                                                             uint64_t analyzerid);
    int                 prelude_client_profile_get_credentials
                                                            (prelude_client_profile_t *cp,
                                                             void **credentials);

## Description

## Details

### prelude_gid_t

### prelude_uid_t

### prelude_client_profile_t

    typedef struct prelude_client_profile prelude_client_profile_t;

### prelude_client_profile_new ()

    int                 prelude_client_profile_new          (prelude_client_profile_t **ret,
                                                             const char *name);

Creates a new prelude_client_profile_t object and store its address into `ret`.

`ret` : | Pointer where to store the address of the created object.
`name` : | Name for this profile.
Returns : | 0 on success or a negative value if an error occured.

### prelude_client_profile_ref ()

    prelude_client_profile_t * prelude_client_profile_ref   (prelude_client_profile_t *cp);

`cp` : |
Returns : |

### prelude_client_profile_destroy ()

    void                prelude_client_profile_destroy      (prelude_client_profile_t *cp);

Destroys `cp`.

`cp` : | Pointer to a prelude_client_profile_t.

### prelude_client_profile_get_config_filename ()

    void                prelude_client_profile_get_config_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Writes the filename used to store `cp` configuration template.

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_get_analyzerid_filename ()

    void                prelude_client_profile_get_analyzerid_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Writes the filename used to store `cp` unique and permanent analyzer ident.

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_get_tls_key_filename ()

    void                prelude_client_profile_get_tls_key_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Writes the filename used to store `cp` private key.

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_get_tls_server_ca_cert_filename ()

    void                prelude_client_profile_get_tls_server_ca_cert_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Writes the filename used to store `cp` related CA certificate. This only apply to `cp` receiving connection from analyzer (server).

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_get_tls_server_keycert_filename ()

    void                prelude_client_profile_get_tls_server_keycert_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Writes the filename used to store certificate for `cp` server. This only apply to `cp` receiving connection from analyzer (server).

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_get_tls_server_crl_filename ()

    void                prelude_client_profile_get_tls_server_crl_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Writes the filename used to store CRL for `cp` server. This only apply to `cp` receiving connection from analyzer (server).

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_get_tls_client_keycert_filename ()

    void                prelude_client_profile_get_tls_client_keycert_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Writes the filename used to store public certificate for `cp` private key. This only apply to client connecting to a peer.

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_get_tls_client_trusted_cert_filename ()

    void                prelude_client_profile_get_tls_client_trusted_cert_filename
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Writes the filename used to store peers public certificates that `cp` trust. This only apply to client connecting to a peer.

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_get_backup_dirname ()

    void                prelude_client_profile_get_backup_dirname
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Writes the directory name where the profile for `cp` is stored. If `cp` is NULL or has no name, then this function will provide the main profile directory.

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_get_profile_dirname ()

    void                prelude_client_profile_get_profile_dirname
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

`cp` : |
`buf` : |
`size` : |

### prelude_client_profile_get_default_config_dirname ()

    void                prelude_client_profile_get_default_config_dirname
                                                            (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

`cp` : |
`buf` : |
`size` : |

### prelude_client_profile_set_prefix ()

    int                 prelude_client_profile_set_prefix   (prelude_client_profile_t *cp,
                                                             const char *prefix);

This function allow to dynamically change the prefix used to acess libprelude related file. This is particularly usefull in case of application running under certain condition (chroot).

`cp` : | pointer on a prelude_client_profile_t object.
`prefix` : | Prefix to use for various libprelude files.
Returns : | 0 on success, a negative value if an error occured.

### prelude_client_profile_get_prefix ()

    void                prelude_client_profile_get_prefix   (const prelude_client_profile_t *cp,
                                                             char *buf,
                                                             size_t size);

Retrieve current prefix used with this profile.

`cp` : | pointer on a prelude_client_profile_t object.
`buf` : | buffer to write the returned filename to.
`size` : | size of `buf`.

### prelude_client_profile_set_uid ()

    void                prelude_client_profile_set_uid      (prelude_client_profile_t *cp,
                                                             prelude_uid_t uid);

Sets the UID used by `cp` to `uid`.

`cp` : | Pointer to a prelude_client_profile_t object.
`uid` : | UID to be used by `cp`.

### prelude_client_profile_get_uid ()

    prelude_uid_t       prelude_client_profile_get_uid      (const prelude_client_profile_t *cp);

Gets the UID associated with `cp`.

`cp` : | Pointer to a prelude_client_profile_t object.
Returns : | the UID associated used by `cp`.

### prelude_client_profile_set_gid ()

    void                prelude_client_profile_set_gid      (prelude_client_profile_t *cp,
                                                             prelude_uid_t gid);

Sets the GID used by `cp` to `gid`.

`cp` : | Pointer to a prelude_client_profile_t object.
`gid` : | GID to be used by `cp`.

### prelude_client_profile_get_gid ()

    prelude_gid_t       prelude_client_profile_get_gid      (const prelude_client_profile_t *cp);

Gets the GID associated with `cp`.

`cp` : | Pointer to a prelude_client_profile_t object.
Returns : | the GID associated used by `cp`.

### prelude_client_profile_set_name ()

    int                 prelude_client_profile_set_name     (prelude_client_profile_t *cp,
                                                             const char *name);

Sets the prelude client profile name.

`cp` : | Pointer to a prelude_client_profile_t object.
`name` : | Name to associate the profile with.
Returns : | 0 on success or a negative value if an error occured.

### prelude_client_profile_get_name ()

    const char *        prelude_client_profile_get_name     (const prelude_client_profile_t *cp);

Gets the name of `cp` client profile.

`cp` : | Pointer to a prelude_client_profile_t object.
Returns : | the name used by `cp`.

### prelude_client_profile_get_analyzerid ()

    uint64_t            prelude_client_profile_get_analyzerid
                                                            (const prelude_client_profile_t *cp);

Gets the unique and permanent analyzer ident associated with `cp`.

`cp` : | Pointer to a prelude_client_profile_t object.
Returns : | the analyzer ident used by `cp`.

### prelude_client_profile_set_analyzerid ()

    void                prelude_client_profile_set_analyzerid
                                                            (prelude_client_profile_t *cp,
                                                             uint64_t analyzerid);

Sets the Analyzer ID used by `cp` to `analyzerid`.

`cp` : | Pointer to a prelude_client_profile_t object.
`analyzerid` : | Analyzer ID to be used by `cp`.

### prelude_client_profile_get_credentials ()

    int                 prelude_client_profile_get_credentials
                                                            (prelude_client_profile_t *cp,
                                                             void **credentials);

`cp` : |
`credentials` : |
Returns : |