junos_license.h File Reference

JUNOS SDK licensing library functions. More...

Data Structures

struct  junos_license_feature_s
 Structure to hold information related to licensed features. More...


#define APP_HAS_EXPIRY_CB   0x01
 Expiry event flag.
#define APP_HAS_SCALE_CAP_CB   0x02
 Scale cap event flag.
#define APP_HAS_GRACE_PERIOD_CB   0x04
 Grace period expiry event flag.


typedef int feature_id_t
 Feature ID.
typedef enum junos_license_event_e junos_license_event_t
 License event type.
typedef junos_license_state_s * junos_license_state_handle_t
 Application's license state handle.
typedef void(* junos_license_event_cb_t )(feature_id_t feature_id, junos_license_event_t event, void *data)
 Application's callback for license events.
typedef void(* junos_license_logging_cb_t )(int level, const char *message)
 Application's callback for logging events.
typedef junos_license_feature_s junos_license_feature_t
 Structure to hold information related to licensed features.


enum  junos_license_event_e {
 License event type. More...


junos_license_state_handle_t junos_license_init (evContext ctx, feature_id_t *feature_ids, uint32_t feature_count, junos_license_feature_t **app_feature, junos_license_logging_cb_t logging_cb)
 Initializes SDK licensing library.
bool junos_license_check_validity (junos_license_state_handle_t app_license, feature_id_t feature_id)
 Checks validity of license for a particular feature.
int junos_license_register_notifications (junos_license_feature_t *app_feature, feature_id_t feature_id, uint32_t feature_count, uint16_t cb_mask, junos_license_event_cb_t notify_cb)
 Sets notification callback and mask for events which feature is interested in.
int junos_license_close (junos_license_state_handle_t app_license, junos_license_feature_t *app_feature)
 Closes connection with JUNOS licensing infrastructure.

Detailed Description

JUNOS SDK licensing library functions.

This library provides APIs for checking license validity requests from client.

Typedef Documentation

typedef void(* junos_license_event_cb_t)(feature_id_t feature_id, junos_license_event_t event, void *data)

Application's callback for license events.

[in] feature_id ID of the feature for which the event callback is being called.
[in] event Type of license event defined by junos_license_event_t.
[out] data Pointer to data returned to the application.

typedef void(* junos_license_logging_cb_t)(int level, const char *message)

Application's callback for logging events.

[in] level Log level of this message.
[out] message Pointer to the log message that is being displayed.

Enumeration Type Documentation

enum junos_license_event_e

License event type.

JUNOS_LICENSE_INSTALL  License installation event.
JUNOS_LICENSE_DELETE  License deletion event.
JUNOS_LICENSE_EXPIRY  License expiry event.
JUNOS_LICENSE_GRACE_PERIOD_EXPIRY  Grace period expiry event.
JUNOS_LICENSE_SCALE_CAP  Scale capacity limit event.

Function Documentation

bool junos_license_check_validity junos_license_state_handle_t  app_license,
feature_id_t  feature_id

Checks validity of license for a particular feature.

[in] app_license Pointer to license state structure of the application.
[in] feature_id Feature ID for the license validity that needs to be checked.
TRUE when license is valid; otherwise FALSE.

int junos_license_close junos_license_state_handle_t  app_license,
junos_license_feature_t app_feature

Closes connection with JUNOS licensing infrastructure.

[in] app_license Pointer to license state structure.
[in] app_feature Pointer to array of license feature structure.
0 on success; otherwise -1.

junos_license_state_handle_t junos_license_init evContext  ctx,
feature_id_t feature_ids,
uint32_t  feature_count,
junos_license_feature_t **  app_feature,
junos_license_logging_cb_t  logging_cb

Initializes SDK licensing library.

This function creates an application license state and then connects to the license-check daemon.

[in] ctx Event context of the application.
[in] feature_ids Pointer to array of feature IDs supported by the application.
[in] feature_count Total number of features.
[in,out] app_feature Pointer to a pointer to license feature structure array.
[in] logging_cb Callback provided by application for logging events.
Pointer to license state on success; otherwise NULL.

int junos_license_register_notifications junos_license_feature_t app_feature,
feature_id_t  feature_id,
uint32_t  feature_count,
uint16_t  cb_mask,
junos_license_event_cb_t  notify_cb

Sets notification callback and mask for events which feature is interested in.

[in] app_feature Pointer to application feature array.
[in] feature_id Feature ID for the license events that need to be set.
[in] feature_count Total number of features.
[in] cb_mask Mask indicating license events the application is interested in.
[in] notify_cb Callback provided by the application for receiving these events.
0 on success; otherwise -1.

2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:23:46 2010 for libjunos-license by Doxygen 1.4.5