| 2 * It contains source for the internal Zephyr routines. |
2 * It contains source for the internal Zephyr routines. |
| 3 * |
3 * |
| 4 * Created by: Robert French |
4 * Created by: Robert French |
| 5 * |
5 * |
| 6 * $Source$ |
6 * $Source$ |
| 7 * $Author: warmenhoven $ |
7 * $Author: faceprint $ |
| 8 * |
8 * |
| 9 * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of |
9 * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of |
| 10 * Technology. |
10 * Technology. |
| 11 * For copying and distribution information, see the file |
11 * For copying and distribution information, see the file |
| 12 * "mit-copyright.h". |
12 * "mit-copyright.h". |
| 18 #include <sys/socket.h> |
18 #include <sys/socket.h> |
| 19 #include <utmp.h> |
19 #include <utmp.h> |
| 20 |
20 |
| 21 #ifndef lint |
21 #ifndef lint |
| 22 static const char rcsid_Zinternal_c[] = |
22 static const char rcsid_Zinternal_c[] = |
| 23 "$Id: Zinternal.c 2432 2001-10-03 19:38:28Z warmenhoven $"; |
23 "$Id: Zinternal.c 5500 2003-04-15 04:18:00Z faceprint $"; |
| 24 static const char copyright[] = |
24 static const char copyright[] = |
| 25 "Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology."; |
25 "Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology."; |
| 26 #endif |
26 #endif |
| 27 |
27 |
| 28 extern char *inet_ntoa (); |
28 extern char *inet_ntoa (); |
| 56 void *__Z_debug_print_closure; |
56 void *__Z_debug_print_closure; |
| 57 #endif |
57 #endif |
| 58 |
58 |
| 59 #define min(a,b) ((a)<(b)?(a):(b)) |
59 #define min(a,b) ((a)<(b)?(a):(b)) |
| 60 |
60 |
| 61 static int Z_AddField __P((char **ptr, char *field, char *end)); |
61 static int Z_AddField __P((char **ptr, const char *field, char *end)); |
| 62 static int find_or_insert_uid __P((ZUnique_Id_t *uid, ZNotice_Kind_t kind)); |
62 static int find_or_insert_uid __P((ZUnique_Id_t *uid, ZNotice_Kind_t kind)); |
| 63 |
63 |
| 64 /* Find or insert uid in the old uids buffer. The buffer is a sorted |
64 /* Find or insert uid in the old uids buffer. The buffer is a sorted |
| 65 * circular queue. We make the assumption that most packets arrive in |
65 * circular queue. We make the assumption that most packets arrive in |
| 66 * order, so we can usually search for a uid or insert it into the buffer |
66 * order, so we can usually search for a uid or insert it into the buffer |