Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/protocol...
File: talkd.h
/*
[0] Fix | Delete
* Copyright (c) 1983, 1993
[1] Fix | Delete
* The Regents of the University of California. All rights reserved.
[2] Fix | Delete
*
[3] Fix | Delete
* Redistribution and use in source and binary forms, with or without
[4] Fix | Delete
* modification, are permitted provided that the following conditions
[5] Fix | Delete
* are met:
[6] Fix | Delete
* 1. Redistributions of source code must retain the above copyright
[7] Fix | Delete
* notice, this list of conditions and the following disclaimer.
[8] Fix | Delete
* 2. Redistributions in binary form must reproduce the above copyright
[9] Fix | Delete
* notice, this list of conditions and the following disclaimer in the
[10] Fix | Delete
* documentation and/or other materials provided with the distribution.
[11] Fix | Delete
* 4. Neither the name of the University nor the names of its contributors
[12] Fix | Delete
* may be used to endorse or promote products derived from this software
[13] Fix | Delete
* without specific prior written permission.
[14] Fix | Delete
*
[15] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
[16] Fix | Delete
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
[17] Fix | Delete
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
[18] Fix | Delete
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
[19] Fix | Delete
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
[20] Fix | Delete
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
[21] Fix | Delete
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
[22] Fix | Delete
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
[23] Fix | Delete
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
[24] Fix | Delete
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
[25] Fix | Delete
* SUCH DAMAGE.
[26] Fix | Delete
*
[27] Fix | Delete
* @(#)talkd.h 8.1 (Berkeley) 6/2/93
[28] Fix | Delete
*/
[29] Fix | Delete
[30] Fix | Delete
#ifndef _PROTOCOLS_TALKD_H
[31] Fix | Delete
#define _PROTOCOLS_TALKD_H 1
[32] Fix | Delete
[33] Fix | Delete
/*
[34] Fix | Delete
* This describes the protocol used by the talk server and clients.
[35] Fix | Delete
*
[36] Fix | Delete
* The talk server acts a repository of invitations, responding to
[37] Fix | Delete
* requests by clients wishing to rendezvous for the purpose of
[38] Fix | Delete
* holding a conversation. In normal operation, a client, the caller,
[39] Fix | Delete
* initiates a rendezvous by sending a CTL_MSG to the server of
[40] Fix | Delete
* type LOOK_UP. This causes the server to search its invitation
[41] Fix | Delete
* tables to check if an invitation currently exists for the caller
[42] Fix | Delete
* (to speak to the callee specified in the message). If the lookup
[43] Fix | Delete
* fails, the caller then sends an ANNOUNCE message causing the server
[44] Fix | Delete
* to broadcast an announcement on the callee's login ports requesting
[45] Fix | Delete
* contact. When the callee responds, the local server uses the
[46] Fix | Delete
* recorded invitation to respond with the appropriate rendezvous
[47] Fix | Delete
* address and the caller and callee client programs establish a
[48] Fix | Delete
* stream connection through which the conversation takes place.
[49] Fix | Delete
*/
[50] Fix | Delete
[51] Fix | Delete
#include <sys/types.h>
[52] Fix | Delete
#include <sys/socket.h>
[53] Fix | Delete
#include <stdint.h>
[54] Fix | Delete
#include <bits/types/struct_osockaddr.h>
[55] Fix | Delete
[56] Fix | Delete
/*
[57] Fix | Delete
* Client->server request message format.
[58] Fix | Delete
*/
[59] Fix | Delete
typedef struct {
[60] Fix | Delete
unsigned char vers; /* protocol version */
[61] Fix | Delete
unsigned char type; /* request type, see below */
[62] Fix | Delete
unsigned char answer; /* not used */
[63] Fix | Delete
unsigned char pad;
[64] Fix | Delete
uint32_t id_num; /* message id */
[65] Fix | Delete
struct osockaddr addr; /* old (4.3) style */
[66] Fix | Delete
struct osockaddr ctl_addr; /* old (4.3) style */
[67] Fix | Delete
int32_t pid; /* caller's process id */
[68] Fix | Delete
#define NAME_SIZE 12
[69] Fix | Delete
char l_name[NAME_SIZE];/* caller's name */
[70] Fix | Delete
char r_name[NAME_SIZE];/* callee's name */
[71] Fix | Delete
#define TTY_SIZE 16
[72] Fix | Delete
char r_tty[TTY_SIZE];/* callee's tty name */
[73] Fix | Delete
} CTL_MSG;
[74] Fix | Delete
[75] Fix | Delete
/*
[76] Fix | Delete
* Server->client response message format.
[77] Fix | Delete
*/
[78] Fix | Delete
typedef struct {
[79] Fix | Delete
unsigned char vers; /* protocol version */
[80] Fix | Delete
unsigned char type; /* type of request message, see below */
[81] Fix | Delete
unsigned char answer; /* response to request message, see below */
[82] Fix | Delete
unsigned char pad;
[83] Fix | Delete
uint32_t id_num; /* message id */
[84] Fix | Delete
struct osockaddr addr; /* address for establishing conversation */
[85] Fix | Delete
} CTL_RESPONSE;
[86] Fix | Delete
[87] Fix | Delete
#define TALK_VERSION 1 /* protocol version */
[88] Fix | Delete
[89] Fix | Delete
/* message type values */
[90] Fix | Delete
#define LEAVE_INVITE 0 /* leave invitation with server */
[91] Fix | Delete
#define LOOK_UP 1 /* check for invitation by callee */
[92] Fix | Delete
#define DELETE 2 /* delete invitation by caller */
[93] Fix | Delete
#define ANNOUNCE 3 /* announce invitation by caller */
[94] Fix | Delete
[95] Fix | Delete
/* answer values */
[96] Fix | Delete
#define SUCCESS 0 /* operation completed properly */
[97] Fix | Delete
#define NOT_HERE 1 /* callee not logged in */
[98] Fix | Delete
#define FAILED 2 /* operation failed for unexplained reason */
[99] Fix | Delete
#define MACHINE_UNKNOWN 3 /* caller's machine name unknown */
[100] Fix | Delete
#define PERMISSION_DENIED 4 /* callee's tty doesn't permit announce */
[101] Fix | Delete
#define UNKNOWN_REQUEST 5 /* request has invalid type value */
[102] Fix | Delete
#define BADVERSION 6 /* request has invalid protocol version */
[103] Fix | Delete
#define BADADDR 7 /* request has invalid addr value */
[104] Fix | Delete
#define BADCTLADDR 8 /* request has invalid ctl_addr value */
[105] Fix | Delete
[106] Fix | Delete
/*
[107] Fix | Delete
* Operational parameters.
[108] Fix | Delete
*/
[109] Fix | Delete
#define MAX_LIFE 60 /* max time daemon saves invitations */
[110] Fix | Delete
/* RING_WAIT should be 10's of seconds less than MAX_LIFE */
[111] Fix | Delete
#define RING_WAIT 30 /* time to wait before resending invitation */
[112] Fix | Delete
[113] Fix | Delete
#endif /* protocols/talkd.h */
[114] Fix | Delete
[115] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function