/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* kprop/kprop.h */2/*3* Copyright 1990,1991 by the Massachusetts Institute of Technology.4* All Rights Reserved.5*6* Export of this software from the United States of America may7* require a specific license from the United States Government.8* It is the responsibility of any person or organization contemplating9* export to obtain such a license before exporting.10*11* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and12* distribute this software and its documentation for any purpose and13* without fee is hereby granted, provided that the above copyright14* notice appear in all copies and that both that copyright notice and15* this permission notice appear in supporting documentation, and that16* the name of M.I.T. not be used in advertising or publicity pertaining17* to distribution of the software without specific, written prior18* permission. Furthermore if you modify this software you must label19* your software as modified software and not distribute it in such a20* fashion that it might be confused with the original M.I.T. software.21* M.I.T. makes no representations about the suitability of22* this software for any purpose. It is provided "as is" without express23* or implied warranty.24*/2526#define KPROP_SERVICE_NAME "host"27#define TGT_SERVICE_NAME "krbtgt"28#define KPROP_SERVICE "krb5_prop"29#define KPROP_PORT 7543031#define KPROP_PROT_VERSION "kprop5_01"3233#define KPROP_BUFSIZ 3276834#define KPROP_DBSIZE_MAX_BUFSIZ 12 /* max length of an encoded DB size */3536/* pathnames are in osconf.h, included via k5-int.h */3738krb5_error_code39sn2princ_realm(krb5_context context, const char *hostname, const char *sname,40const char *realm, krb5_principal *princ_out);4142/*43* Encode size in four bytes (for backward compatibility) if it fits; otherwise44* use the larger encoding. buf must be allocated with at least45* KPROP_DBSIZE_MAX_BUFSIZ bytes.46*/47void encode_database_size(uint64_t size, krb5_data *buf);4849/* Decode a database size. Return KRB5KRB_ERR_GENERIC if buf has an invalid50* length or did not encode a 32-bit size compactly. */51krb5_error_code decode_database_size(const krb5_data *buf, uint64_t *size_out);525354