1*66682Sbostic /*- 2*66682Sbostic * Copyright (c) 1983, 1985 3*66682Sbostic * The Regents of the University of California. All rights reserved. 466681Sbostic * 5*66682Sbostic * %sccs.include.redist.c% 6*66682Sbostic * 766681Sbostic * @(#)ctl.h 5.1 (Berkeley) 6/6/85 866681Sbostic */ 966681Sbostic 1066681Sbostic /* 1166681Sbostic * ctl.h describes the structure that 1266681Sbostic * talk and talkd pass back and forth. 1366681Sbostic */ 1466681Sbostic 1566681Sbostic #include <sys/types.h> 1666681Sbostic #include <sys/socket.h> 1766681Sbostic #include <netinet/in.h> 1866681Sbostic #include <netdb.h> 1966681Sbostic 2066681Sbostic #define NAME_SIZE 9 2166681Sbostic #define TTY_SIZE 16 2266681Sbostic #define HOST_NAME_LENGTH 256 2366681Sbostic 2466681Sbostic #define MAX_LIFE 60 /* max time daemon saves invitations */ 2566681Sbostic /* RING_WAIT should be 10's of seconds less than MAX_LIFE */ 2666681Sbostic #define RING_WAIT 30 /* time to wait before refreshing invitation */ 2766681Sbostic 2866681Sbostic /* type values */ 2966681Sbostic #define LEAVE_INVITE 0 3066681Sbostic #define LOOK_UP 1 3166681Sbostic #define DELETE 2 3266681Sbostic #define ANNOUNCE 3 3366681Sbostic 3466681Sbostic /* answer values */ 3566681Sbostic #define SUCCESS 0 3666681Sbostic #define NOT_HERE 1 3766681Sbostic #define FAILED 2 3866681Sbostic #define MACHINE_UNKNOWN 3 3966681Sbostic #define PERMISSION_DENIED 4 4066681Sbostic #define UNKNOWN_REQUEST 5 4166681Sbostic 4266681Sbostic typedef struct ctl_response { 4366681Sbostic char type; 4466681Sbostic char answer; 4566681Sbostic int id_num; 4666681Sbostic struct sockaddr_in addr; 4766681Sbostic } CTL_RESPONSE; 4866681Sbostic 4966681Sbostic typedef struct ctl_msg { 5066681Sbostic char type; 5166681Sbostic char l_name[NAME_SIZE]; 5266681Sbostic char r_name[NAME_SIZE]; 5366681Sbostic int id_num; 5466681Sbostic int pid; 5566681Sbostic char r_tty[TTY_SIZE]; 5666681Sbostic struct sockaddr_in addr; 5766681Sbostic struct sockaddr_in ctl_addr; 5866681Sbostic } CTL_MSG; 59