| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: answer.c,v 1.22 2014/03/30 05:30:28 dholland Exp $ */ | | 1 | /* $NetBSD: answer.c,v 1.23 2014/03/30 05:53:12 dholland Exp $ */ |
2 | /* | | 2 | /* |
3 | * Copyright (c) 1983-2003, Regents of the University of California. | | 3 | * Copyright (c) 1983-2003, Regents of the University of California. |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are | | 7 | * modification, are permitted provided that the following conditions are |
8 | * met: | | 8 | * met: |
9 | * | | 9 | * |
10 | * + Redistributions of source code must retain the above copyright | | 10 | * + Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * + Redistributions in binary form must reproduce the above copyright | | 12 | * + Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -22,49 +22,49 @@ | | | @@ -22,49 +22,49 @@ |
22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | | 22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
23 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | | 23 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | | 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | | 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | | 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | #ifndef lint | | 34 | #ifndef lint |
35 | __RCSID("$NetBSD: answer.c,v 1.22 2014/03/30 05:30:28 dholland Exp $"); | | 35 | __RCSID("$NetBSD: answer.c,v 1.23 2014/03/30 05:53:12 dholland Exp $"); |
36 | #endif /* not lint */ | | 36 | #endif /* not lint */ |
37 | | | 37 | |
38 | #include <sys/types.h> | | 38 | #include <sys/types.h> |
39 | #include <sys/socket.h> | | 39 | #include <sys/socket.h> |
40 | #include <netinet/in.h> | | 40 | #include <netinet/in.h> |
41 | #include <ctype.h> | | 41 | #include <ctype.h> |
42 | #include <errno.h> | | 42 | #include <errno.h> |
43 | #include <fcntl.h> | | 43 | #include <fcntl.h> |
44 | #include <stdlib.h> | | 44 | #include <stdlib.h> |
45 | #include <unistd.h> | | 45 | #include <unistd.h> |
46 | #include <assert.h> | | 46 | #include <assert.h> |
47 | #include "hunt.h" | | 47 | #include "hunt.h" |
48 | | | 48 | |
49 | #define SCOREDECAY 15 | | 49 | #define SCOREDECAY 15 |
50 | | | 50 | |
51 | static char Ttyname[WIRE_NAMELEN]; | | 51 | static char Ttyname[WIRE_NAMELEN]; |
52 | | | 52 | |
53 | static IDENT *get_ident(uint32_t, uint32_t, const char *, char); | | 53 | static IDENT *get_ident(uint32_t, uint32_t, const char *, char); |
54 | static void stmonitor(PLAYER *); | | 54 | static void stmonitor(PLAYER *); |
55 | static void stplayer(PLAYER *, int); | | 55 | static void stplayer(PLAYER *, int); |
56 | | | 56 | |
57 | int | | 57 | bool |
58 | answer(void) | | 58 | answer(void) |
59 | { | | 59 | { |
60 | PLAYER *pp; | | 60 | PLAYER *pp; |
61 | int newsock; | | 61 | int newsock; |
62 | static uint32_t mode; | | 62 | static uint32_t mode; |
63 | static char name[WIRE_NAMELEN]; | | 63 | static char name[WIRE_NAMELEN]; |
64 | static char team; | | 64 | static char team; |
65 | static int32_t enter_status; | | 65 | static int32_t enter_status; |
66 | static socklen_t socklen; | | 66 | static socklen_t socklen; |
67 | static uint32_t machine; | | 67 | static uint32_t machine; |
68 | static uint32_t uid; | | 68 | static uint32_t uid; |
69 | static struct sockaddr_storage newaddr; | | 69 | static struct sockaddr_storage newaddr; |
70 | char *cp1, *cp2; | | 70 | char *cp1, *cp2; |