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