Previous section.

Authorization (AZN) API
Copyright © 2000 The Open Group

Header File


/*
 * FILENAME
 *      ogauthzn.h
 *
 * DESCRIPTION
 *
 * COPYRIGHT NOTICE
 *      Copyright (c) 1999 DASCOM Inc.  All Rights Reserved.
 */

/*
 * HISTORY
 * $Log: ogauthzn.h,v $
 * $EndLog$
 */

#ifndef OGAUTHZN_H
#define OGAUTHZN_H

#ifdef __cplusplus
extern "C" {
#endif

/* defined constants */

#define  AZN_C_PERMITTED         0
#define  AZN_C_NOT_PERMITTED     1

#define  AZN_C_EMPTY_BUFFER      NULL
#define  AZN_C_NO_BUFFER         NULL

#define  AZN_C_INITIATOR_INDEX   0
#define  AZN_C_AUDIT_ID          "AZN_AUDIT_ID"
#define  AZN_C_REQUEST_TIME      "AZN_REQUEST_TIME"
#define  AZN_C_AUTHN_QUALITY     "AZN_AUTHN_QUALITY"
#define  AZN_C_REQUESTER_LOC     "AZN_REQUESTER_LOC"
#define  AZN_C_REQUEST_ROUTE_QOP "AZN_REQUEST_ROUTE_QOP"
#define  AZN_C_VERSION           "AZN_VERSION"

/* status codes */

#define  AZN_S_COMPLETE                     0
#define  AZN_S_FAILURE                      1
#define  AZN_S_AUTHORIZATION_FAILURE        2
#define  AZN_S_INVALID_CREDS_HDL            3
#define  AZN_S_INVALID_NEW_CREDS_HDL        4
#define  AZN_S_INVALID_ENTITLEMENTS_SVC     5
#define  AZN_S_INVALID_COMB_CREDS_HDL       6
#define  AZN_S_INVALID_MECHANISM_INFO       7
#define  AZN_S_INVALID_MECHANISM            8
#define  AZN_S_INVALID_STRING_VALUE         9
#define  AZN_S_UNKNOWN_LABEL               10
#define  AZN_S_INVALID_ADDED_CREDS_HDL     11
#define  AZN_S_INVALID_PROTECTED_RESOURCE  12
#define  AZN_S_INVALID_OPERATION           13
#define  AZN_S_INVALID_PAC                 14
#define  AZN_S_INVALID_PAC_SVC             15
#define  AZN_S_INVALID_APP_CONTEXT_HDL     16
#define  AZN_S_INVALID_MOD_FUNCTION        17
#define  AZN_S_INVALID_SUBJECT_INDEX       18
#define  AZN_S_UNIMPLEMENTED_FUNCTION      19
#define  AZN_S_INVALID_ATTRLIST_HDL        20
#define  AZN_S_INVALID_ATTR_NAME           21
#define  AZN_S_INVALID_BUFFER              22
#define  AZN_S_INVALID_BUFFER_REF          23
#define  AZN_S_INVALID_STRING_REF          24
#define  AZN_S_ATTR_VALUE_NOT_STRING_TYPE  25
#define  AZN_S_ATTR_INVALID_INDEX          26
#define  AZN_S_INVALID_INTEGER_REF         27
#define  AZN_S_INVALID_PERMISSION_REF      28
#define  AZN_S_INVALID_AUTHORITY           29
#define  AZN_S_INVALID_APP_CONTEXT_HDL     30
#define  AZN_S_INVALID_ENTITLEMENTS_HDL    31
#define  AZN_S_INVALID_LABELING_SCHEME     32
#define  AZN_S_INVALID_INIT_DATA_HDL       33
#define  AZN_S_INVALID_INIT_INFO_HDL       34
#define  AZN_S_ATTR_VALUE_NOT_STRING_TYPE  35

/* Null ID; used to specify defaults for authority and mechanism IDs */

#define  AZN_NULL_ID                       ""

/* type definitions */

/* implementation specific status and handle definitions */

typedef unsigned long azn_status_t; 
typedef long azn_creds_h_t;
typedef long azn_attrlist_h_t;

/* standard data types */

typedef struct azn_buffer_desc_struct {
    size_t             length;
    void               *value;
} azn_buffer_desc, *azn_buffer_t;

typedef char *azn_string_t;

/* function prototypes */

azn_status_t
azn_attrlist_add_entry(
    azn_attrlist_h_t   attr_list     /* in */,
    azn_string_t       attr_name     /* in */,
    azn_string_t       string_value  /* in */
);

azn_status_t
azn_attrlist_add_entry_buffer(
    azn_attrlist_h_t   attr_list     /* in */,
    azn_string_t       attr_name     /* in */,
    azn_buffer_t       buffer_value  /* in */
);

azn_status_t
azn_attrlist_create(
    azn_attrlist_h_t   *attrlist_list  /* out */
);

azn_status_t
azn_attrlist_delete(
    azn_attrlist_h_t   *attrlist_list  /* in, out */
);

azn_status_t
azn_attrlist_get_entry_buffer_value(
    azn_attrlist_h_t   attr_list      /* in */,
    azn_string_t       attr_name      /* in */,
    unsigned int       value_index    /* in */,
    azn_buffer_t       *buffer_value  /* out */
);

azn_status_t
azn_attrlist_get_entry_string_value(
    azn_attrlist_h_t   attr_list      /* in */,
    azn_string_t       attr_name      /* in */,
    unsigned int       value_index    /* in */,
    azn_string_t       *string_value  /* out */
);

azn_status_t
azn_attrlist_get_names(
    azn_attrlist_h_t   attr_list      /* in */,
    azn_string_t       *attr_names[]  /* out */
);

azn_status_t
azn_attrlist_name_get_num(
    azn_attrlist_h_t   attr_list    /* in */,
    azn_string_t       attr_name    /* in */,
    unsigned int       *num_values  /* out */
);

azn_status_t
azn_authority_get_authorities(
    azn_string_t   *azn_authorities[]      /* out */
);

azn_status_t
azn_authority_get_entitlements_svcs(
    azn_string_t   *entitlements_svc_ids[] /* out */
);

azn_status_t
azn_authority_get_labeling_schemes(
    azn_string_t   *labeling_scheme_ids[]   /* out */
);

azn_status_t
azn_authority_get_mechanisms(
    azn_string_t   azn_authority           /* in */,
    azn_string_t   *mechanism_ids[]        /* out */
);

azn_status_t
azn_authority_get_mod_svcs(
    azn_string_t   azn_authority           /* in */,
    azn_string_t   *mod_svc_ids[]          /* out */
);

azn_status_t
azn_authority_get_pac_svcs(
    azn_string_t   azn_authority         /* in */,
    azn_string_t   *pac_svc_ids[]        /* out */
);

azn_status_t
azn_creds_combine(
    azn_creds_h_t   creds             /* in */,
    azn_creds_h_t   creds_to_add      /* in */,
    azn_creds_h_t   *combined_creds   /* out */
);

azn_status_t
azn_creds_create(
    azn_creds_h_t   *creds  /* out */
);

azn_status_t
azn_creds_delete(
    azn_creds_h_t   *creds  /* in, out */
);

azn_status_t
azn_creds_for_subject(
    azn_creds_h_t   creds           /* in */,
    unsigned int    subject_index   /* in */,
    azn_creds_h_t   *subject_creds  /* out */
);

azn_status_t
azn_creds_get_attrlist_for_subject(
    azn_creds_h_t      creds            /* in */,
    unsigned int       subject_index    /* in */,
    azn_attrlist_h_t   *creds_attrlist  /* out */
);

azn_status_t 
azn_creds_get_pac(
    azn_creds_h_t   creds       /* in */,
    azn_string_t    pac_svc_id  /* in */,
    azn_buffer_t    *pac        /* out */
);

azn_status_t
azn_creds_modify(
    azn_creds_h_t      creds       /* in */,
    azn_string_t       mod_svc_id  /* in */,
    azn_attrlist_h_t   mod_info    /* in */,
    azn_creds_h_t      *new_creds  /* out */
);

azn_status_t
azn_creds_num_subjects(
    azn_creds_h_t   creds              /* in */,
    unsigned int    *num_of_subjects   /* out */
);


azn_status_t
azn_decision_access_allowed(
    azn_creds_h_t   creds               /* in */,
    azn_string_t    protected_resource  /* in */,
    azn_string_t    operation           /* in */,
    int             *permission         /* out */
);

azn_status_t
azn_decision_access_allowed_ext(
    azn_creds_h_t      creds               /* in */,
    azn_string_t       protected_resource  /* in */,
    azn_string_t       operation           /* in */,
    azn_attrlist_h_t   app_context         /* in */,
    int                *permission         /* out */,
    azn_attrlist_h_t   *permission_info    /* in, out */
);

azn_status_t
azn_decision_has_clearance(
    azn_creds_h_t   creds               /* in */,
    azn_string_t    labeling_scheme_id  /* in */,
    azn_string_t    protected_resource  /* in */,
    azn_string_t    operation           /* in */,
    azn_string_t    label               /* in */,
    int             *permission         /* out */
);


azn_status_t
azn_entitlement_get_entitlements(
    azn_creds_h_t      creds                /* in */,
    azn_string_t       entitlements_svc_id  /* in */,
    azn_attrlist_h_t   app_context          /* in */,
    azn_attrlist_h_t   *entitlements        /* out */
);

azn_status_t
azn_entitlement_get_labels(
    azn_creds_h_t   creds               /* in */,
    azn_string_t    labeling_scheme_id  /* in */,
    azn_string_t    operation           /* in */,
    azn_string_t    *labels[]           /* out */
);

azn_status_t
azn_entitlement_get_operations(
    azn_creds_h_t   creds               /* in */,
    azn_string_t    protected_resource  /* in */,
    int             permission          /* in */,
    azn_string_t    *operations[]       /* out */
);

azn_status_t
azn_entitlement_get_operations_ext(
    azn_creds_h_t      creds               /* in */,
    azn_string_t       protected_resource  /* in */,
    azn_attrlist_h_t   app_context         /* in */,
    int                permission          /* in */,
    azn_string_t       *operations[]       /* out */,
    azn_attrlist_h_t   *permission_info    /* in, out */
);

unsigned int
azn_error_major(
    azn_status_t   azn_status  /* in */
);

unsigned int
azn_error_minor(
    azn_status_t   azn_status  /* in */
);

azn_status_t
azn_error_minor(
    unsigned int   minor_error           /* in */,
    azn_string_t   *minor_error_string   /* out */
);

azn_status_t
azn_id_get_creds(
    azn_string_t    authority  /* in */,
    azn_string_t    mechanism_id      /* in */,
    azn_buffer_t    mechanism_info    /* in */,
    azn_creds_h_t   *new_creds     /* out */
);


azn_status_t
azn_initialize(
    azn_attrlist_h_t  init_data           /* in */,
    azn_attrlist_h_t  *init_info          /* in, out */
);


azn_status_t
azn_pac_get_creds(
    azn_buffer_t    pac         /* in */,
    azn_string_t    pac_svc_id  /* in */,
    azn_creds_h_t   *new_creds      /* out */
);

azn_status_t
azn_release_buffer(
    azn_buffer_t   *buffer     /* in, out */
);

azn_status_t
azn_release_string(
    azn_string_t   *string     /* in, out */
);

azn_status_t
azn_release_strings(
    azn_string_t   *strings[]  /* in, out */
);

azn_status_t
azn_shutdown(
    void
);


#ifdef __cplusplus
}
#endif

#endif /* OGAUTHZN_H */



Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index