1 /*- 2 * Copyright (c) 1983, 1985 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)ctl.h 5.1 (Berkeley) 6/6/85 8 */ 9 10 /* 11 * ctl.h describes the structure that 12 * talk and talkd pass back and forth. 13 */ 14 15 #include <sys/types.h> 16 #include <sys/socket.h> 17 #include <netinet/in.h> 18 #include <netdb.h> 19 20 #define NAME_SIZE 9 21 #define TTY_SIZE 16 22 #define HOST_NAME_LENGTH 256 23 24 #define MAX_LIFE 60 /* max time daemon saves invitations */ 25 /* RING_WAIT should be 10's of seconds less than MAX_LIFE */ 26 #define RING_WAIT 30 /* time to wait before refreshing invitation */ 27 28 /* type values */ 29 #define LEAVE_INVITE 0 30 #define LOOK_UP 1 31 #define DELETE 2 32 #define ANNOUNCE 3 33 34 /* answer values */ 35 #define SUCCESS 0 36 #define NOT_HERE 1 37 #define FAILED 2 38 #define MACHINE_UNKNOWN 3 39 #define PERMISSION_DENIED 4 40 #define UNKNOWN_REQUEST 5 41 42 typedef struct ctl_response { 43 char type; 44 char answer; 45 int id_num; 46 struct sockaddr_in addr; 47 } CTL_RESPONSE; 48 49 typedef struct ctl_msg { 50 char type; 51 char l_name[NAME_SIZE]; 52 char r_name[NAME_SIZE]; 53 int id_num; 54 int pid; 55 char r_tty[TTY_SIZE]; 56 struct sockaddr_in addr; 57 struct sockaddr_in ctl_addr; 58 } CTL_MSG; 59