Imported Upstream version 3.2.0
[debian/amanda] / common-src / security-util.h
index 6c5c41f0e771f225871f09ab02712f71c46ee820..9fa67701a6a48d53d3fa5a6382de3787daa5153f 100644 (file)
 } while (0)
 
 
+/*
+ * Magic values for sec_conn->handle
+ */
+#define H_TAKEN -1             /* sec_conn->tok was already read */
+#define H_EOF   -2             /* this connection has been shut down */
+
 #ifdef KRB5_SECURITY
 #  define KRB5_DEPRECATED 1
 #  ifndef KRB5_HEIMDAL_INCLUDES
@@ -84,9 +90,14 @@ struct tcp_conn {
     int                        auth;
     char *              (*conf_fn)(char *, void *);
     void *              datap;
+    time_t              logstamp;
 #ifdef KRB5_SECURITY
     gss_ctx_id_t       gss_context;
 #endif
+    unsigned int       netint[2];
+    char *              buffer;
+    ssize_t             size_header_read;
+    ssize_t             size_buffer_read;
 };
 
 
@@ -211,7 +222,8 @@ void        tcpm_stream_read(void *, void (*)(void *, void *, ssize_t), void *);
 ssize_t        tcpm_stream_read_sync(void *, void **);
 void   tcpm_stream_read_cancel(void *);
 ssize_t        tcpm_send_token(struct tcp_conn *, int, int, char **, const void *, size_t);
-ssize_t        tcpm_recv_token(struct tcp_conn *, int, int *, char **, char **, ssize_t *, int);
+ssize_t        tcpm_recv_token_timeout(struct tcp_conn *, int, int *, char **, char **, ssize_t *, int);
+ssize_t        tcpm_recv_token(struct tcp_conn *, int, int *, char **, char **, ssize_t *);
 void   tcpm_close_connection(void *, char *);
 
 int    tcpma_stream_accept(void *);
@@ -262,6 +274,7 @@ void        show_stat_info(char *a, char *b);
 int     check_name_give_sockaddr(const char *hostname, struct sockaddr *addr,
                                 char **errstr);
 in_port_t find_port_for_service(char *service, char *proto);
-
+char   *sec_get_authenticated_peer_name_localhost(security_handle_t *);
+char   *sec_get_authenticated_peer_name_hostname(security_handle_t *);
 
 #endif /* _SECURITY_INFO_H */