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...

Defines

#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.

Typedefs

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.

Enumerations

enum  junos_license_event_e {
  JUNOS_LICENSE_INSTALL, JUNOS_LICENSE_DELETE, JUNOS_LICENSE_EXPIRY, JUNOS_LICENSE_GRACE_PERIOD_EXPIRY,
  JUNOS_LICENSE_SCALE_CAP
}
 License event type. More...

Functions

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.

Parameters:
[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.

Parameters:
[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.

Enumerator:
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.

Parameters:
[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.
Returns:
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.

Parameters:
[in] app_license Pointer to license state structure.
[in] app_feature Pointer to array of license feature structure.
Returns:
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.

Parameters:
[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.
Returns:
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.

Parameters:
[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.
Returns:
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