|
Revision 919, 1.3 KB
(checked in by shawnw, 19 months ago)
|
|
1.8.3p3
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | ** ident.h |
|---|
| 3 | ** |
|---|
| 4 | ** Author: Peter Eriksson <pen@lysator.liu.se> |
|---|
| 5 | ** Intruder: Pär Emanuelsson <pell@lysator.liu.se> |
|---|
| 6 | ** Vandal: Shawn Wagner <raevnos@pennmush.org> |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | #ifndef __IDENT_H__ |
|---|
| 10 | #define __IDENT_H__ |
|---|
| 11 | |
|---|
| 12 | #include "config.h" |
|---|
| 13 | |
|---|
| 14 | #ifdef I_SYS_TYPES |
|---|
| 15 | #include <sys/types.h> |
|---|
| 16 | #endif |
|---|
| 17 | |
|---|
| 18 | #ifdef I_SYS_SELECT |
|---|
| 19 | #include <sys/select.h> |
|---|
| 20 | #endif |
|---|
| 21 | |
|---|
| 22 | #ifdef I_SYS_SOCKET |
|---|
| 23 | #include <sys/socket.h> |
|---|
| 24 | #endif |
|---|
| 25 | |
|---|
| 26 | #include "mysocket.h" |
|---|
| 27 | |
|---|
| 28 | #ifdef __cplusplus |
|---|
| 29 | extern "C" { |
|---|
| 30 | #endif |
|---|
| 31 | |
|---|
| 32 | #ifndef IDBUFSIZE |
|---|
| 33 | #define IDBUFSIZE 2048 |
|---|
| 34 | #endif |
|---|
| 35 | |
|---|
| 36 | /* Using the "auth" service name would be better, but windoze probably |
|---|
| 37 | doesn't support any notion of getservyname or like functions. |
|---|
| 38 | */ |
|---|
| 39 | #ifndef IDPORT |
|---|
| 40 | #define IDPORT 113 |
|---|
| 41 | #endif |
|---|
| 42 | |
|---|
| 43 | /** Ident call result. |
|---|
| 44 | * This structure stores the result of an ident call. |
|---|
| 45 | */ |
|---|
| 46 | typedef struct { |
|---|
| 47 | char *identifier; /**< Normally user name */ |
|---|
| 48 | char *opsys; /**< Operating system */ |
|---|
| 49 | char *charset; /**< Character set */ |
|---|
| 50 | } IDENT; |
|---|
| 51 | |
|---|
| 52 | /* High-level calls */ |
|---|
| 53 | |
|---|
| 54 | extern char *ident_id(int fd, int *timeout); |
|---|
| 55 | |
|---|
| 56 | extern IDENT *ident_query(struct sockaddr *laddr, socklen_t llen, |
|---|
| 57 | struct sockaddr *raddr, socklen_t rlen, |
|---|
| 58 | int *timeout); |
|---|
| 59 | |
|---|
| 60 | void ident_free(IDENT * id); |
|---|
| 61 | |
|---|
| 62 | #ifdef __cplusplus |
|---|
| 63 | } |
|---|
| 64 | #endif |
|---|
| 65 | #endif |
|---|