krb4.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef __KRB4_H
  2. #define __KRB4_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at http://curl.haxx.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * $Id$
  24. ***************************************************************************/
  25. struct Curl_sec_client_mech {
  26. const char *name;
  27. size_t size;
  28. int (*init)(void *);
  29. int (*auth)(void *, struct connectdata *);
  30. void (*end)(void *);
  31. int (*check_prot)(void *, int);
  32. int (*overhead)(void *, int, int);
  33. int (*encode)(void *, const void*, int, int, void**, struct connectdata *);
  34. int (*decode)(void *, void*, int, int, struct connectdata *);
  35. };
  36. #define AUTH_OK 0
  37. #define AUTH_CONTINUE 1
  38. #define AUTH_ERROR 2
  39. #ifdef HAVE_KRB4
  40. extern struct Curl_sec_client_mech Curl_krb4_client_mech;
  41. #endif
  42. #ifdef HAVE_GSSAPI
  43. extern struct Curl_sec_client_mech Curl_krb5_client_mech;
  44. #endif
  45. CURLcode Curl_krb_kauth(struct connectdata *conn);
  46. int Curl_sec_fflush_fd(struct connectdata *conn, int fd);
  47. int Curl_sec_fprintf (struct connectdata *, FILE *, const char *, ...);
  48. int Curl_sec_getc (struct connectdata *conn, FILE *);
  49. int Curl_sec_putc (struct connectdata *conn, int, FILE *);
  50. int Curl_sec_read (struct connectdata *conn, int, void *, int);
  51. int Curl_sec_read_msg (struct connectdata *conn, char *, int);
  52. int Curl_sec_vfprintf(struct connectdata *, FILE *, const char *, va_list);
  53. int Curl_sec_fprintf2(struct connectdata *conn, FILE *f, const char *fmt, ...);
  54. int Curl_sec_vfprintf2(struct connectdata *conn, FILE *, const char *, va_list);
  55. ssize_t Curl_sec_send(struct connectdata *conn, int, const char *, int);
  56. int Curl_sec_write(struct connectdata *conn, int, const char *, int);
  57. void Curl_sec_end (struct connectdata *);
  58. int Curl_sec_login (struct connectdata *);
  59. void Curl_sec_prot (int, char **);
  60. int Curl_sec_request_prot (struct connectdata *conn, const char *level);
  61. void Curl_sec_set_protection_level(struct connectdata *conn);
  62. void Curl_sec_status (void);
  63. enum protection_level Curl_set_command_prot(struct connectdata *,
  64. enum protection_level);
  65. #endif