home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume28 / m0 / part01 / c_proto.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-06  |  2.5 KB  |  76 lines

  1. /*
  2.     c_proto.h
  3. */
  4. /*  Copyright (c) 1994 Christian F. Tschudin. All rights reserved.
  5.  
  6.     Distributed under the terms of the GNU General Public License
  7.     version 2 of june 1991 as published by the Free Software
  8.     Foundation, Inc.
  9.  
  10.              This file is part of M0.
  11.  
  12. M0 is distributed in the hope that it will be useful, but WITHOUT ANY
  13. WARRANTY.  No author or distributor accepts responsibility to anyone for
  14. the consequences of using it or for whether it serves any particular
  15. purpose or works at all, unless he says so in writing.  Refer to the GNU
  16. General Public License for full details. 
  17.  
  18. Everyone is granted permission to copy, modify and redistribute M0, but
  19. only under the conditions described in the GNU General Public License. 
  20. A copy of this license is supposed to have been given to you along with
  21. M0 so you can know your rights and responsibilities.  It should be in a
  22. file named LICENSE.  Among other things, the copyright notice and this
  23. notice must be preserved on all copies.  */
  24.  
  25. #ifndef C_PROTO_H
  26. #define C_PROTO_H
  27.  
  28. #include "l_proto.h"
  29.  
  30.  
  31. #ifdef CHANNEL_CONSOLE    /* c_con.c */
  32. extern int    msgr_was_empty;
  33. extern eindex    console_addr;
  34. extern eindex    console_name;
  35. extern int    console_init(byteptr keyboard_queue, byteptr keyboard_vect);
  36. extern eindex    add_console_channel();
  37. #endif
  38.  
  39.  
  40. #ifdef CHANNEL_FILE /* c_file.c */
  41. extern eindex    file_addr;
  42. extern int    file_init();
  43. extern eindex    add_file_channel(uint i);
  44. #endif
  45.  
  46.  
  47. #ifdef CHANNEL_NIT /* c_nit.c */
  48. typedef byte    eth[6];
  49. extern eindex    nit_addr;    /* array with the local ethernet addresses */
  50. extern eindex    nit_name;
  51. extern char**    get_eth_devices();
  52. extern int    nit_init(char **devs, int proto); /* names of devices to open */
  53. extern void    nit_recv(int fd, eindex *msgr, eindex *src);
  54. extern int    nit_send(sint chan, byteptr dest, byteptr packet, uint len);
  55. #define ETHERNET_TYPE    (0x0ffff &(('M'<<8) | '0'))    /* 0x4d30 */
  56. extern eindex    add_nit_channel(sint chan_no, byteptr dest);
  57. #endif
  58.  
  59.  
  60. #ifdef CHANNEL_UDP /* c_udp.c */
  61. extern int    udp_listen(uint host, int port);
  62. extern eindex    udp_addr;    /* array with the local udp addresses */
  63. extern eindex    udp_name;
  64. extern uint*    get_ip_addresses();
  65. extern int    udp_init(uint *ip, int port);
  66. extern void    udp_recv(int s, eindex *msgr, eindex *src);
  67. extern int    udp_send(int s, uint host, int port,
  68.                     byteptr packet, int len);
  69. extern char* iptoa(uint host);        /* unsigned int to a.b.c.d format */
  70. #define UDP_SERVERPORT    (0x0ffff &(('M'<<8) | '0'))    /* 0x4d30 */
  71. extern eindex    add_udp_channel(sint chan, uint desthost, ushort port);
  72. #endif /* CHANNEL_UDP */
  73.  
  74.  
  75. #endif
  76.