physical.h (2764b86afdc99a30f4b1a4da2c04db8aa7aa785d) | physical.h (565e35e50e2cdac423588a3d18742544bde128b0) |
---|---|
1/* 2 * Written by Eivind Eklund <eivind@yes.no> 3 * for Yes Interactive 4 * 5 * Copyright (C) 1998, Yes Interactive. All rights reserved. 6 * 7 * Redistribution and use in any form is permitted. Redistribution in 8 * source form should include the above copyright and this set of 9 * conditions, because large sections american law seems to have been 10 * created by a bunch of jerks on drugs that are now illegal, forcing 11 * me to include this copyright-stuff instead of placing this in the 12 * public domain. The name of of 'Yes Interactive' or 'Eivind Eklund' 13 * may not be used to endorse or promote products derived from this 14 * software without specific prior written permission. 15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 * | 1/* 2 * Written by Eivind Eklund <eivind@yes.no> 3 * for Yes Interactive 4 * 5 * Copyright (C) 1998, Yes Interactive. All rights reserved. 6 * 7 * Redistribution and use in any form is permitted. Redistribution in 8 * source form should include the above copyright and this set of 9 * conditions, because large sections american law seems to have been 10 * created by a bunch of jerks on drugs that are now illegal, forcing 11 * me to include this copyright-stuff instead of placing this in the 12 * public domain. The name of of 'Yes Interactive' or 'Eivind Eklund' 13 * may not be used to endorse or promote products derived from this 14 * software without specific prior written permission. 15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 * |
19 * $Id: physical.h,v 1.1.2.18 1998/04/03 19:21:50 brian Exp $ | 19 * $Id: physical.h,v 1.1.2.19 1998/04/07 00:54:14 brian Exp $ |
20 * 21 */ 22 23struct bundle; 24 25struct physical { 26 struct link link; 27 struct descriptor desc; | 20 * 21 */ 22 23struct bundle; 24 25struct physical { 26 struct link link; 27 struct descriptor desc; |
28 int type; /* What sort of link are we ? */ |
|
28 struct async async; /* Our async state */ 29 struct hdlc hdlc; /* Our hdlc state */ 30 int fd; /* File descriptor for this device */ 31 int mbits; /* Current DCD status */ 32 unsigned dev_is_modem : 1; /* Is the device an actual modem? 33 Faked for sync devices, though... 34 (Possibly this should be 35 dev_is_not_tcp?) XXX-ML */ --- 8 unchanged lines hidden (view full) --- 44 } name; 45 46 unsigned Utmp : 1; /* Are we in utmp ? */ 47 48 /* XXX-ML Most of the below is device specific, and probably do not 49 belong in the generic physical struct. It comes from modem.c. */ 50 51 struct { | 29 struct async async; /* Our async state */ 30 struct hdlc hdlc; /* Our hdlc state */ 31 int fd; /* File descriptor for this device */ 32 int mbits; /* Current DCD status */ 33 unsigned dev_is_modem : 1; /* Is the device an actual modem? 34 Faked for sync devices, though... 35 (Possibly this should be 36 dev_is_not_tcp?) XXX-ML */ --- 8 unchanged lines hidden (view full) --- 45 } name; 46 47 unsigned Utmp : 1; /* Are we in utmp ? */ 48 49 /* XXX-ML Most of the below is device specific, and probably do not 50 belong in the generic physical struct. It comes from modem.c. */ 51 52 struct { |
52 unsigned is_dedicated : 1; /* Dedicated mode? XXX-ML - not yet used */ 53 unsigned is_direct : 1; /* Direct mode? XXX-ML - not yet used */ | |
54 unsigned rts_cts : 1; /* Is rts/cts enabled? */ 55 unsigned parity; /* What parity is enabled? (TTY flags) */ 56 unsigned speed; /* Modem speed */ 57 char devlist[LINE_LEN]; /* Comma-separated list of devices */ 58 } cfg; 59 60 struct termios ios; /* To be able to reset from raw mode */ 61}; --- 7 unchanged lines hidden (view full) --- 69 70#define physical2descriptor(p) (&(p)->desc) 71#define descriptor2physical(d) \ 72 ((d)->type == PHYSICAL_DESCRIPTOR ? field2phys(d, desc) : NULL) 73 74int Physical_GetFD(struct physical *); 75int Physical_IsATTY(struct physical *); 76int Physical_IsSync(struct physical *); | 53 unsigned rts_cts : 1; /* Is rts/cts enabled? */ 54 unsigned parity; /* What parity is enabled? (TTY flags) */ 55 unsigned speed; /* Modem speed */ 56 char devlist[LINE_LEN]; /* Comma-separated list of devices */ 57 } cfg; 58 59 struct termios ios; /* To be able to reset from raw mode */ 60}; --- 7 unchanged lines hidden (view full) --- 68 69#define physical2descriptor(p) (&(p)->desc) 70#define descriptor2physical(d) \ 71 ((d)->type == PHYSICAL_DESCRIPTOR ? field2phys(d, desc) : NULL) 72 73int Physical_GetFD(struct physical *); 74int Physical_IsATTY(struct physical *); 75int Physical_IsSync(struct physical *); |
77int Physical_IsDedicated(struct physical *); 78int Physical_IsDirect(struct physical *); | |
79const char *Physical_GetDevice(struct physical *); 80 81 82void Physical_SetDeviceList(struct physical *, const char *); 83int /* Was this speed OK? */ 84Physical_SetSpeed(struct physical *, int); 85 86/* XXX-ML I'm not certain this is the right way to handle this, but we 87 can solve that later. */ 88void Physical_SetSync(struct physical *); 89 90int /* Can this be set? (Might not be a relevant attribute for this 91 device, for instance) */ 92Physical_SetRtsCts(struct physical *, int); 93 | 76const char *Physical_GetDevice(struct physical *); 77 78 79void Physical_SetDeviceList(struct physical *, const char *); 80int /* Was this speed OK? */ 81Physical_SetSpeed(struct physical *, int); 82 83/* XXX-ML I'm not certain this is the right way to handle this, but we 84 can solve that later. */ 85void Physical_SetSync(struct physical *); 86 87int /* Can this be set? (Might not be a relevant attribute for this 88 device, for instance) */ 89Physical_SetRtsCts(struct physical *, int); 90 |
94void Physical_SetDedicated(struct physical *, int); 95void Physical_SetDirect(struct physical *, int); 96 97void Physical_FD_SET(struct physical *, fd_set *); 98int Physical_FD_ISSET(struct physical *, fd_set *); 99 | |
100void Physical_DupAndClose(struct physical *); 101ssize_t Physical_Read(struct physical *, void *, size_t); 102ssize_t Physical_Write(struct physical *, const void *, size_t); 103int Physical_UpdateSet(struct descriptor *, fd_set *, fd_set *, fd_set *, 104 int *, int); 105int Physical_IsSet(struct descriptor *, const fd_set *); 106void Physical_DescriptorWrite(struct descriptor *, struct bundle *, 107 const fd_set *); 108 109void Physical_Login(struct physical *, const char *); 110void Physical_Logout(struct physical *); | 91void Physical_DupAndClose(struct physical *); 92ssize_t Physical_Read(struct physical *, void *, size_t); 93ssize_t Physical_Write(struct physical *, const void *, size_t); 94int Physical_UpdateSet(struct descriptor *, fd_set *, fd_set *, fd_set *, 95 int *, int); 96int Physical_IsSet(struct descriptor *, const fd_set *); 97void Physical_DescriptorWrite(struct descriptor *, struct bundle *, 98 const fd_set *); 99 100void Physical_Login(struct physical *, const char *); 101void Physical_Logout(struct physical *); |