/* * Copyright (c) 1995, 1996 Gunther Schadow. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef LLPDRV_H #define LLPDRV_H #include #include "ansi.h" #include #include #include #ifndef USE_TRIP #include "semaphor.h" #endif /* Error codes specifications of FAILs */ extern int llp_errno; #define RF_UNSPEC 0 /* unspecified error */ #define RF_SERVER 1 /* server error */ #define RF_CLIENT 2 /* proximal client error */ #define RF_DISTAL 3 /* distal client error */ #define RF_INTERN 4 /* internal protocol error */ #define RF_EXTERN 5 /* external protocol error */ #define RF_ABORT 6 /* transaction aborted */ /* Protocols */ #define P_MINI 1 #define P_HYBR 2 #define P_ANSI 3 /* Seconds to wait for subprocesses to exit after signal */ #define WAIT_TIME 5 #ifndef BUF_SIZE # define BUF_SIZE 1024 #endif /* These variables are used by the proximal server */ extern char *to_addr; /* destination server's address */ extern int to_af; /* destination server's address family */ /* bool disconnect is used by serve_proximal() and llpdrv() and tells that * the serving process should exit after a single transaction. */ extern bool disconnect; #ifdef USE_TRIP extern semaphor mutex; #endif __BEGIN_DECLS void serve_proximal(int proto, #ifdef USE_TRIP pid_t dist_pid, #else semaphor mutex, #endif const char *client_name, int client_fd); void serve_distal (int proto, #ifdef USE_TRIP pid_t proxi_pid, #else semaphor mutex, #endif const char *client_name, int client_fd, int distal_af, const char *distal_addr) __attribute__((__noreturn__)); result mini2i(FILE *mini, FILE *i); result i2mini(FILE *i, FILE *mini); result hybr2i(FILE *hybr, FILE *i); result i2hybr(FILE *i, FILE *hybr); result ansi2i(ASTRM *ansi, FILE *i); result i2ansi(FILE *i, ASTRM *ansi); FILE *fattach(int fd); __END_DECLS #endif