/[pdpsoft]/trunk/grid-mw-security/ees/include/common/pdl.h
ViewVC logotype

Diff of /trunk/grid-mw-security/ees/include/common/pdl.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1122 by aramv, Thu Nov 12 15:51:05 2009 UTC revision 1123 by aramv, Fri Nov 13 16:00:45 2009 UTC
# Line 43  Line 43 
43   * \brief Structure for symbols used by the parser internally   * \brief Structure for symbols used by the parser internally
44   */   */
45  typedef struct record_s {  typedef struct record_s {
46    char* string;                 /*!<  Hold the symbol that lex has found. */    char*             string;       /*!<  Hold the symbol that lex has found. */
47    int   lineno;                 /*!<  Hold the line number the symbol has been found. */    int               lineno;       /*!<  Hold the line number the symbol has been found. */
48  } record_t;  } record_t;
49    
50    
# Line 52  typedef struct record_s { Line 52  typedef struct record_s {
52   *  \brief Structure keeps track of the variables, their value and the line number they are defined on.   *  \brief Structure keeps track of the variables, their value and the line number they are defined on.
53   */   */
54  typedef struct var_s {  typedef struct var_s {
55    char*           name;         /*!<  Name of the variable. */    char*             name;         /*!<  Name of the variable. */
56    char*           value;        /*!<  Value of the variable. */    char*             value;        /*!<  Value of the variable. */
57    unsigned int    lineno;       /*!<  Line number the variable appears on. */    unsigned int      lineno;       /*!<  Line number the variable appears on. */
58    struct var_s*   next;         /*!<  Next variable, or 0 if none. */    struct var_s*     next;         /*!<  Next variable, or 0 if none. */
59  } var_t;  } var_t;
60    
61  /*!  /*!
# Line 63  typedef struct var_s { Line 63  typedef struct var_s {
63   *   *
64   */   */
65  typedef struct rule_s {  typedef struct rule_s {
66    unsigned int    lineno;       /*!<  Line number where rule appeared. */    unsigned int      lineno;       /*!<  Line number where rule appeared. */
67    char*           state;        /*!<  Name of the state.*/    char*             state;        /*!<  Name of the state.*/
68    /*char*           true_branch;  *//*!<  Name of the true_branch, or 0 if none. */    struct rule_s*    true_branch;  /*!<  True branch or NULL if none */
69    /*char*           false_branch; *//*!<  Name of the false_branch, or 0 if none. */    struct rule_s*    false_branch; /*!<  False branch or NULL if none */
70    struct rule_s*  true_branch;    struct rule_s*    next;         /*!<  Next rule, or NULL if none */
   struct rule_s*  false_branch;  
   struct rule_s*  next;         /*!<  Next rule, or NULL if none */  
71  } rule_t;  } rule_t;
72    
73  /*!  /*!
74   *  \brief Structure to build a tree of plugins as defined in a policy in the config file   *  \brief Structure to build a tree of plugins as defined in a policy in the config file
75   */   */
76  typedef struct policy_s {  typedef struct policy_s {
77    eef_plugindl_t* current;      /*!<  Pointer to the plug-in described by this policy rule */    /*eef_plugindl_t* current;      *//*!<  Pointer to the plug-in described by this policy rule */
78    eef_plugindl_t* next_success; /*!<  Pointer to the next plug-in if the last one exited successfully */    /*eef_plugindl_t* next_success; *//*!<  Pointer to the next plug-in if the last one exited successfully */
79    eef_plugindl_t* next_failure; /*!<  Pointer to the next plug-in if the last one exited unsuccessfully */    /*eef_plugindl_t* next_failure; *//*!<  Pointer to the next plug-in if the last one exited unsuccessfully */
80    struct rule_s*  head_rule;    /*!<  ??? */    char*             name;
81      unsigned int      lineno;
82      rule_t*           rules;
83      struct policy_s*  next;
84      /*struct policy_s*  prev;*/
85  } policy_t;  } policy_t;
86    
87  /* lifecycle functions */  /* lifecycle functions */
88  EES_RC            pdl_init(const char*);  EES_RC              pdl_init(const char*);
89  EES_RC            pdl_term(void);  EES_RC              pdl_term(void);
90  EES_RC            initialize_plugins(void);  EES_RC              initialize_plugins(void);
91  EES_RC            clean_variables_list(void);  EES_RC              clean_variables_list(void);
92  EES_RC            clean_rules_list(void);  EES_RC              clean_rules_list(void);
93    
94  /* callback functions */  /* callback functions */
95  void              set_modules_path(record_t*);  void                set_modules_path(record_t*);
96  void              add_policy(record_t*, rule_t*);  void                add_policy(record_t*, rule_t*);
97  rule_t *          add_rule(record_t*, record_t*, record_t*);  rule_t *            add_rule(record_t*, record_t*, record_t*);
98  const char *      get_pdl_path(void);  const char *        get_pdl_path(void);
99  void              remove_policy(record_t* policy);  void                remove_policy(record_t* policy);
100  void              add_variable(record_t* name, record_t* value);  void                add_variable(record_t* name, record_t* value);
101  EES_RC            allow_rules(int);  EES_RC              allow_rules(int);
102  EES_RC            allowed_policy_rule(const char* label);  EES_RC              allowed_policy_rule(const char* label);
103    
104  /* convenience methods used by the lexer */  /* convenience methods used by the lexer */
105  record_t *        concat_strings(record_t*, record_t*);  record_t *          concat_strings(record_t*, record_t*);
106  record_t *        concat_strings_with_space(record_t*, record_t*);  record_t *          concat_strings_with_space(record_t*, record_t*);
107  char **           _var_to_argv(char*, int*);  char **             _var_to_argv(char*, int*);
108  var_t*            get_variable_by_name(char*);  var_t*              get_variable_by_name(char*);
109  rule_t*           find_state(rule_t* rule, const char* state);  rule_t*             find_state(rule_t* rule, const char* state);
110  rule_t*           check_for_recursion(rule_t*, rule_t*);  rule_t*             check_for_recursion(rule_t*, rule_t*);
111    
112    
113  /* Lex/Yacc stuff */  /* Lex/Yacc stuff */
114  int               yyerror(char*);  int                 yyerror(char*);
115  void              set_yylval(record_t* r);  void                set_yylval(record_t* r);
116    
117    /* debug functions */
118    void                print_policies(void);
119    
120  #endif  #endif

Legend:
Removed from v.1122  
changed lines
  Added in v.1123

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28