home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / misc / src0131 / session.h < prev    next >
C/C++ Source or Header  |  1990-11-15  |  2KB  |  101 lines

  1. #ifndef    _SESSION_H
  2. #define    _SESSION_H
  3.  
  4. #include <stdio.h>
  5.  
  6. #ifndef    _GLOBAL_H
  7. #include "global.h"
  8. #endif
  9.  
  10. #ifndef _HARDWARE_H
  11. #include "hardware.h"
  12. #endif
  13.  
  14.  
  15. #ifndef    _FTPCLI_H
  16. #include "ftpcli.h"
  17. #endif
  18.  
  19. #ifndef    _TELNET_H
  20. #include "telnet.h"
  21. #endif
  22.  
  23. #ifndef    _ICMP_H
  24. #include "icmp.h"
  25. #endif
  26.  
  27. #ifndef    _AX25_H
  28. #include "ax25.h"
  29. #endif
  30.  
  31. #ifndef    _PROC_H
  32. #include "proc.h"
  33. #endif
  34.  
  35. #ifndef    _TTY_H
  36. #include "tty.h"
  37. #endif
  38.  
  39. #define    MOREROWS    24    /* rows on screen before --more-- */
  40.  
  41. /* Session control structure; only one entry is used at a time */
  42. struct session {
  43.     int type;
  44. #define    FREE    0
  45. #define    TELNET    1
  46. #define    FTP    2
  47. #define    AX25TNC    3
  48. #define    FINGER    4
  49. #define    PING    5
  50. #define NRSESSION 6
  51. #define    COMMAND    7
  52. #define    MORE    8
  53. #define    HOP    9
  54. #define    TIP    10
  55. #define    PPPPASS    11
  56.  
  57.     char *name;    /* Name of remote host */
  58.     union {
  59.         struct ftpcli *ftp;
  60.         struct telnet *telnet;
  61.     } cb;
  62.     struct proc *proc;    /* Primary session process (e.g., tn recv) */
  63.     struct proc *proc1;    /* Secondary session process (e.g., tn xmit) */
  64.     struct proc *proc2;    /* Tertiary session process (e.g., upload) */
  65.     int s;            /* Primary network socket (control for FTP) */
  66.     FILE *record;        /* Receive record file */
  67.     char *rfile;        /* Record file name */
  68.     FILE *upload;        /* Send file */
  69.     char *ufile;        /* Upload file name */
  70.     struct ttystate ttystate;
  71.     struct screen *screen;
  72.     int input;        /* Input socket */
  73.     int output;        /* Output socket */
  74.     int flowmode;        /* control "more" mode */
  75.     int row;        /* Rows remaining until "more" */
  76.     int morewait;        /* Output driver is waiting on us */
  77. };
  78. #define    NULLSESSION    (struct session *)0
  79.  
  80. extern char *Sestypes[];
  81. extern unsigned Nsessions;        /* Maximum number of sessions */
  82. extern struct session *Sessions;    /* Session descriptors themselves */
  83. extern struct session *Current;        /* Always points to current session */
  84. extern struct session *Lastcurr;    /* Last non-command session */
  85. extern struct session *Command;        /* Pointer to command session */
  86.  
  87. /* In session.c: */
  88. void freesession __ARGS((struct session *sp));
  89. struct session *sessptr __ARGS((char *cp));
  90. struct session *newsession __ARGS((char *name,int type));
  91. void upload __ARGS((int unused,void *sp1,void *p));
  92.  
  93. /* In pc.c: */
  94. void swapscreen __ARGS((struct session *old,struct session *new));
  95.  
  96. extern int16 Lport;
  97. #define    ALERT_EOF    1
  98.  
  99.  
  100. #endif    /* _SESSION_H */
  101.