4 * Copyright 2002 by the Massachusetts Institute of Technology.
7 * Export of this software from the United States of America may
8 * require a specific license from the United States Government.
9 * It is the responsibility of any person or organization contemplating
10 * export to obtain such a license before exporting.
12 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13 * distribute this software and its documentation for any purpose and
14 * without fee is hereby granted, provided that the above copyright
15 * notice appear in all copies and that both that copyright notice and
16 * this permission notice appear in supporting documentation, and that
17 * the name of M.I.T. not be used in advertising or publicity pertaining
18 * to distribution of the software without specific, written prior
19 * permission. Furthermore if you modify this software you must label
20 * your software as modified software and not distribute it in such a
21 * fashion that it might be confused with the original M.I.T. software.
22 * M.I.T. makes no representations about the suitability of
23 * this software for any purpose. It is provided "as is" without express
24 * or implied warranty.
27 /* Since fd_set is large on some platforms (8K on AIX 5.2), this
28 probably shouldn't be allocated in automatic storage. */
31 fd_set rfds
, wfds
, xfds
;
32 struct timeval end_time
; /* magic: tv_sec==0 => never time out */
36 /* Select state flags. */
38 #define SSF_WRITE 0x02
39 #define SSF_EXCEPTION 0x04
42 static const char *const state_strings
[] = {
43 "INITIALIZING", "CONNECTING", "WRITING", "READING", "FAILED"
47 /* connection states */
48 enum conn_states
{ INITIALIZING
, CONNECTING
, WRITING
, READING
, FAILED
};
49 struct incoming_krb5_message
{
50 size_t bufsizebytes_read
;
54 unsigned char bufsizebytes
[4];
60 enum conn_states state
;
61 unsigned int is_udp
: 1;
62 int (*service
)(struct conn_state
*, struct select_state
*, int);
63 struct addrinfo
*addr
;
69 unsigned char msg_len_buf
[4];
71 struct incoming_krb5_message in
;
75 struct sendto_callback_info
{
76 int (*pfn_callback
) (struct conn_state
*, void *, krb5_data
*);
77 void (*pfn_cleanup
) (void *, krb5_data
*);
82 krb5_error_code
krb5int_cm_call_select (const struct select_state
*,
83 struct select_state
*, int *);