LCOV - code coverage report
Current view: top level - third_party/heimdal/kdc - kdc-accessors.h (source / functions) Hit Total Coverage
Test: coverage report for fix-15632 9995c5c2 Lines: 14 43 32.6 %
Date: 2024-04-13 12:30:31 Functions: 14 52 26.9 %

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2022, PADL Software Pty Ltd.
       3             :  * All rights reserved.
       4             :  *
       5             :  * Redistribution and use in source and binary forms, with or without
       6             :  * modification, are permitted provided that the following conditions
       7             :  * are met:
       8             :  *
       9             :  * 1. Redistributions of source code must retain the above copyright
      10             :  *    notice, this list of conditions and the following disclaimer.
      11             :  *
      12             :  * 2. Redistributions in binary form must reproduce the above copyright
      13             :  *    notice, this list of conditions and the following disclaimer in the
      14             :  *    documentation and/or other materials provided with the distribution.
      15             :  *
      16             :  * 3. Neither the name of PADL Software nor the names of its contributors
      17             :  *    may be used to endorse or promote products derived from this software
      18             :  *    without specific prior written permission.
      19             :  *
      20             :  * THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
      21             :  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      22             :  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      23             :  * ARE DISCLAIMED.  IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
      24             :  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      25             :  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
      26             :  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
      27             :  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
      28             :  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
      29             :  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
      30             :  * SUCH DAMAGE.
      31             :  */
      32             : 
      33             : #ifndef HEIMDAL_KDC_KDC_ACCESSORS_H
      34             : #define HEIMDAL_KDC_KDC_ACCESSORS_H 1
      35             : 
      36             : /* read-only accessor */
      37             : #ifndef _KDC_REQUEST_GET_ACCESSOR
      38             : #define _KDC_REQUEST_GET_ACCESSOR(R, T, f)                  \
      39             :     KDC_LIB_FUNCTION T KDC_LIB_CALL                         \
      40             :     kdc_request_get_ ## f(R);
      41             : #endif
      42             : 
      43             : #ifndef _KDC_REQUEST_SET_ACCESSOR
      44             : #define _KDC_REQUEST_SET_ACCESSOR(R, T, f)                  \
      45             :     KDC_LIB_FUNCTION void KDC_LIB_CALL                      \
      46             :     kdc_request_set_ ## f(R, T);
      47             : #endif
      48             : 
      49             : #ifndef KDC_REQUEST_GET_ACCESSOR
      50             : #define KDC_REQUEST_GET_ACCESSOR(T, f)                      \
      51             :     _KDC_REQUEST_GET_ACCESSOR(kdc_request_t, T, f)
      52             : #endif
      53             : 
      54             : #ifndef KDC_REQUEST_SET_ACCESSOR
      55             : #define KDC_REQUEST_SET_ACCESSOR(T, f)                      \
      56             :     _KDC_REQUEST_SET_ACCESSOR(kdc_request_t, T, f)
      57             : #endif
      58             : 
      59             : #ifndef ASTGS_REQUEST_GET_ACCESSOR
      60             : #define ASTGS_REQUEST_GET_ACCESSOR(T, f)                    \
      61             :     _KDC_REQUEST_GET_ACCESSOR(astgs_request_t, T, f)
      62             : #endif
      63             : 
      64             : #ifndef ASTGS_REQUEST_SET_ACCESSOR
      65             : #define ASTGS_REQUEST_SET_ACCESSOR(T, f)                    \
      66             :     _KDC_REQUEST_SET_ACCESSOR(astgs_request_t, T, f)
      67             : #endif
      68             : 
      69             : /* get/set accessor for pointer type */
      70             : #ifndef _KDC_REQUEST_GET_ACCESSOR_PTR
      71             : #define _KDC_REQUEST_GET_ACCESSOR_PTR(R, T, f)              \
      72             :     KDC_LIB_FUNCTION const T KDC_LIB_CALL                   \
      73             :     kdc_request_get_ ## f(R);
      74             : #endif
      75             : 
      76             : #ifndef _KDC_REQUEST_SET_ACCESSOR_PTR
      77             : #define _KDC_REQUEST_SET_ACCESSOR_PTR(R, T, t, f)           \
      78             :     KDC_LIB_FUNCTION krb5_error_code KDC_LIB_CALL           \
      79             :     kdc_request_set_ ## f(R, const T);
      80             : #endif
      81             : 
      82             : #ifndef KDC_REQUEST_GET_ACCESSOR_PTR
      83             : #define KDC_REQUEST_GET_ACCESSOR_PTR(T, f)                  \
      84             :     _KDC_REQUEST_GET_ACCESSOR_PTR(kdc_request_t, T, f)
      85             : #endif
      86             : 
      87             : #ifndef KDC_REQUEST_SET_ACCESSOR_PTR
      88             : #define KDC_REQUEST_SET_ACCESSOR_PTR(T, t, f)               \
      89             :     _KDC_REQUEST_SET_ACCESSOR_PTR(kdc_request_t, T, t, f)
      90             : #endif
      91             : 
      92             : #ifndef ASTGS_REQUEST_GET_ACCESSOR_PTR
      93             : #define ASTGS_REQUEST_GET_ACCESSOR_PTR(T, f)                \
      94             :     _KDC_REQUEST_GET_ACCESSOR_PTR(astgs_request_t, T, f)
      95             : #endif
      96             : 
      97             : #ifndef ASTGS_REQUEST_SET_ACCESSOR_PTR
      98             : #define ASTGS_REQUEST_SET_ACCESSOR_PTR(T, t, f)             \
      99             :     _KDC_REQUEST_SET_ACCESSOR_PTR(astgs_request_t, T, t, f)
     100             : #endif
     101             : 
     102             : /* get/set accessor for struct type */
     103             : #ifndef _KDC_REQUEST_GET_ACCESSOR_STRUCT
     104             : #define _KDC_REQUEST_GET_ACCESSOR_STRUCT(R, T, f)           \
     105             :     KDC_LIB_FUNCTION const T * KDC_LIB_CALL                 \
     106             :     kdc_request_get_ ## f(R);
     107             : #endif
     108             : 
     109             : #ifndef _KDC_REQUEST_SET_ACCESSOR_STRUCT
     110             : #define _KDC_REQUEST_SET_ACCESSOR_STRUCT(R, T, t, f)        \
     111             :     KDC_LIB_FUNCTION krb5_error_code KDC_LIB_CALL           \
     112             :     kdc_request_set_ ## f(R, const T *);
     113             : #endif
     114             : 
     115             : #ifndef KDC_REQUEST_GET_ACCESSOR_STRUCT
     116             : #define KDC_REQUEST_GET_ACCESSOR_STRUCT(T, f)               \
     117             :     _KDC_REQUEST_GET_ACCESSOR_STRUCT(kdc_request_t, T, f)
     118             : #endif
     119             : 
     120             : #ifndef KDC_REQUEST_SET_ACCESSOR_STRUCT
     121             : #define KDC_REQUEST_SET_ACCESSOR_STRUCT(T, t, f)            \
     122             :     _KDC_REQUEST_SET_ACCESSOR_STRUCT(kdc_request_t, T, t, f)
     123             : #endif
     124             : 
     125             : #ifndef ASTGS_REQUEST_GET_ACCESSOR_STRUCT
     126             : #define ASTGS_REQUEST_GET_ACCESSOR_STRUCT(T, f)             \
     127             :     _KDC_REQUEST_GET_ACCESSOR_STRUCT(astgs_request_t, T, f)
     128             : #endif
     129             : 
     130             : #ifndef ASTGS_REQUEST_SET_ACCESSOR_STRUCT
     131             : #define ASTGS_REQUEST_SET_ACCESSOR_STRUCT(T, t, f)          \
     132             :     _KDC_REQUEST_SET_ACCESSOR_STRUCT(astgs_request_t, T, t, f)
     133             : #endif
     134             : 
     135             : /*
     136             :  * krb5_context
     137             :  * kdc_request_get_context(kdc_request_t);
     138             :  */
     139             : 
     140      225095 : KDC_REQUEST_GET_ACCESSOR(krb5_context, context)
     141             : 
     142             : /*
     143             :  * krb5_kdc_configuration *
     144             :  * kdc_request_get_config(kdc_request_t);
     145             :  */
     146             : 
     147       49390 : KDC_REQUEST_GET_ACCESSOR(krb5_kdc_configuration *, config)
     148             : 
     149             : /*
     150             :  * heim_log_facility *
     151             :  * kdc_request_get_logf(kdc_request_t);
     152             :  */
     153             : 
     154           0 : KDC_REQUEST_GET_ACCESSOR(heim_log_facility *, logf)
     155             : 
     156             : /*
     157             :  * const char *
     158             :  * kdc_request_get_from(kdc_request_t);
     159             :  */
     160             : 
     161           0 : KDC_REQUEST_GET_ACCESSOR_PTR(char *, from)
     162             : 
     163             : /*
     164             :  * const struct sockaddr *
     165             :  * kdc_request_get_addr(kdc_request_t);
     166             :  */
     167             : 
     168           0 : KDC_REQUEST_GET_ACCESSOR_PTR(struct sockaddr *, addr)
     169             : 
     170             : /*
     171             :  * krb5_data
     172             :  * kdc_request_get_request(kdc_request_t);
     173             :  */
     174             : 
     175           0 : KDC_REQUEST_GET_ACCESSOR(krb5_data, request)
     176             : 
     177             : /*
     178             :  * struct timeval
     179             :  * kdc_request_get_tv_start(kdc_request_t);
     180             :  */
     181             : 
     182           0 : KDC_REQUEST_GET_ACCESSOR(struct timeval, tv_start)
     183             : 
     184             : /*
     185             :  * struct timeval
     186             :  * kdc_request_get_tv_end(kdc_request_t);
     187             :  */
     188             : 
     189           0 : KDC_REQUEST_GET_ACCESSOR(struct timeval, tv_end)
     190             : 
     191             : /*
     192             :  * krb5_error_code
     193             :  * kdc_request_get_error_code(kdc_request_t);
     194             :  */
     195        1104 : KDC_REQUEST_GET_ACCESSOR(krb5_error_code, error_code)
     196             : 
     197             : /*
     198             :  * void
     199             :  * kdc_request_set_error_code(kdc_request_t, krb5_error_code);
     200             :  */
     201           0 : KDC_REQUEST_SET_ACCESSOR(krb5_error_code, error_code)
     202             : 
     203             : /*
     204             :  * const KDC_REQ *
     205             :  * kdc_request_get_req(astgs_request_t);
     206             :  */
     207             : 
     208      307864 : ASTGS_REQUEST_GET_ACCESSOR_STRUCT(KDC_REQ, req)
     209             : 
     210             : /*
     211             :  * const KDC_REP *
     212             :  * kdc_request_get_rep(astgs_request_t);
     213             :  */
     214             : 
     215           0 : ASTGS_REQUEST_GET_ACCESSOR_STRUCT(KDC_REP, rep)
     216             : 
     217             : /*
     218             :  * krb5_error_code
     219             :  * kdc_request_set_rep(astgs_request_t, const KDC_REP *);
     220             :  */
     221             : 
     222           0 : ASTGS_REQUEST_SET_ACCESSOR_STRUCT(KDC_REP, KDC_REP, rep)
     223             : 
     224             : /*
     225             :  * const char *
     226             :  * kdc_request_get_cname(kdc_request_t);
     227             :  */
     228             : 
     229       48162 : KDC_REQUEST_GET_ACCESSOR_PTR(char *, cname)
     230             : 
     231             : /*
     232             :  * krb5_error_code
     233             :  * kdc_request_set_cname(kdc_request_t, const char *);
     234             :  */
     235             : 
     236         790 : KDC_REQUEST_SET_ACCESSOR_PTR(char *, string_ptr, cname)
     237             : 
     238             : /*
     239             :  * const Principal *
     240             :  * kdc_request_get_client_princ(astgs_request_t);
     241             :  */
     242             : 
     243           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(Principal *, client_princ)
     244             : 
     245             : /*
     246             :  * krb5_error_code
     247             :  * kdc_request_set_client_princ(astgs_request_t, const Principal *);
     248             :  */
     249             : 
     250         790 : ASTGS_REQUEST_SET_ACCESSOR_PTR(Principal *, Principal_ptr, client_princ)
     251             : 
     252             : /*
     253             :  * const Principal *
     254             :  * kdc_request_get_canon_client_princ(astgs_request_t);
     255             :  */
     256             : 
     257           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(Principal *, canon_client_princ)
     258             : 
     259             : /*
     260             :  * krb5_error_code
     261             :  * kdc_request_set_canon_client_princ(astgs_request_t, const Principal *);
     262             :  */
     263             : 
     264         790 : ASTGS_REQUEST_SET_ACCESSOR_PTR(Principal *, Principal_ptr, canon_client_princ)
     265             : 
     266             : /*
     267             :  * const HDB *
     268             :  * kdc_request_get_clientdb(astgs_request_t);
     269             :  */
     270             : 
     271           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(HDB *, clientdb)
     272             : 
     273             : /*
     274             :  * const hdb_entry *
     275             :  * kdc_request_get_client(astgs_request_t);
     276             :  */
     277             : 
     278       48424 : ASTGS_REQUEST_GET_ACCESSOR_PTR(hdb_entry *, client)
     279             : 
     280             : /*
     281             :  * See client accessors
     282             :  */
     283             : 
     284           0 : KDC_REQUEST_GET_ACCESSOR_PTR(char *, sname)
     285           0 : KDC_REQUEST_SET_ACCESSOR_PTR(char *, string_ptr, sname)
     286           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(Principal *, server_princ)
     287           0 : ASTGS_REQUEST_SET_ACCESSOR_PTR(Principal *, Principal_ptr, server_princ)
     288           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(HDB *, serverdb)
     289      174160 : ASTGS_REQUEST_GET_ACCESSOR_PTR(hdb_entry *, server)
     290             : 
     291             : /*
     292             :  * See client accessors
     293             :  */
     294             : 
     295           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(Principal *, krbtgt_princ)
     296           0 : ASTGS_REQUEST_SET_ACCESSOR_PTR(Principal *, Principal_ptr, krbtgt_princ)
     297           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(HDB *, krbtgtdb)
     298           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(hdb_entry *, krbtgt)
     299             : 
     300             : /*
     301             :  * krb5_ticket *
     302             :  * kdc_request_get_ticket(astgs_request_t);
     303             :  */
     304             : 
     305           0 : ASTGS_REQUEST_GET_ACCESSOR(krb5_ticket *, ticket)
     306             : 
     307             : /*
     308             :  * const krb5_keyblock *
     309             :  * kdc_request_get_reply_key(astgs_request_t);
     310             :  */
     311             : 
     312           0 : ASTGS_REQUEST_GET_ACCESSOR_STRUCT(krb5_keyblock, reply_key)
     313             : 
     314             : /*
     315             :  * krb5_error_code
     316             :  * kdc_request_set_reply_key(astgs_request_t, const krb5_keyblock *);
     317             :  */
     318             : 
     319           0 : ASTGS_REQUEST_SET_ACCESSOR_STRUCT(krb5_keyblock, keyblock, reply_key)
     320             : 
     321             : /*
     322             :  * krb5_const_pac
     323             :  * kdc_request_get_pac(astgs_request_t);
     324             :  */
     325             : 
     326           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(struct krb5_pac_data *, pac)
     327             : 
     328             : /*
     329             :  * krb5_error_code
     330             :  * kdc_request_set_pac(astgs_request_t, krb5_const_pac);
     331             :  */
     332             : 
     333         790 : ASTGS_REQUEST_SET_ACCESSOR_PTR(struct krb5_pac_data *, pac, pac)
     334             : 
     335             : /*
     336             :  * uint64_t
     337             :  * kdc_request_get_pac_attributes(astgs_request_t);
     338             :  */
     339             : 
     340           0 : ASTGS_REQUEST_GET_ACCESSOR(uint64_t, pac_attributes)
     341             : 
     342             : /*
     343             :  * void
     344             :  * kdc_request_set_pac_attributes(astgs_request_t, uint64_t);
     345             :  */
     346             : 
     347           0 : ASTGS_REQUEST_SET_ACCESSOR(uint64_t, pac_attributes)
     348             : 
     349             : KDC_LIB_FUNCTION const HDB * KDC_LIB_CALL
     350             : kdc_request_get_explicit_armor_clientdb(astgs_request_t);
     351             : 
     352             : KDC_LIB_FUNCTION const hdb_entry * KDC_LIB_CALL
     353             : kdc_request_get_explicit_armor_client(astgs_request_t);
     354             : 
     355             : KDC_LIB_FUNCTION const hdb_entry * KDC_LIB_CALL
     356             : kdc_request_get_explicit_armor_server(astgs_request_t);
     357             : 
     358             : KDC_LIB_FUNCTION krb5_const_pac KDC_LIB_CALL
     359             : kdc_request_get_explicit_armor_pac(astgs_request_t);
     360             : 
     361             : /*
     362             :  * const HDB *
     363             :  * kdc_request_get_armor_clientdb(astgs_request_t);
     364             :  */
     365             : 
     366           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(HDB *, armor_clientdb)
     367             : 
     368             : /*
     369             :  * const hdb_entry *
     370             :  * kdc_request_get_armor_client(astgs_request_t);
     371             :  */
     372       95972 : ASTGS_REQUEST_GET_ACCESSOR_PTR(hdb_entry *, armor_client);
     373             : 
     374             : /*
     375             :  * const hdb_entry *
     376             :  * kdc_request_get_armor_server(astgs_request_t);
     377             :  */
     378         738 : ASTGS_REQUEST_GET_ACCESSOR_PTR(hdb_entry *, armor_server);
     379             : 
     380             : /*
     381             :  * krb5_const_pac
     382             :  * kdc_request_get_armor_pac(astgs_request_t);
     383             :  */
     384             : 
     385       95972 : ASTGS_REQUEST_GET_ACCESSOR_PTR(struct krb5_pac_data *, armor_pac);
     386             : 
     387             : /*
     388             :  * krb5_boolean
     389             :  * kdc_request_get_explicit_armor_present(astgs_request_t);
     390             :  */
     391             : 
     392           0 : ASTGS_REQUEST_GET_ACCESSOR_PTR(krb5_boolean, explicit_armor_present);
     393             : 
     394             : #endif /* HEIMDAL_KDC_KDC_ACCESSORS_H */

Generated by: LCOV version 1.14