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