net_bsd.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #include "quakedef.h"
  16. #include "net_loop.h"
  17. #include "net_dgrm.h"
  18. net_driver_t net_drivers[MAX_NET_DRIVERS] =
  19. {
  20. {
  21. "Loopback",
  22. false,
  23. Loop_Init,
  24. Loop_Listen,
  25. Loop_SearchForHosts,
  26. Loop_Connect,
  27. Loop_CheckNewConnections,
  28. Loop_GetMessage,
  29. Loop_SendMessage,
  30. Loop_SendUnreliableMessage,
  31. Loop_CanSendMessage,
  32. Loop_CanSendUnreliableMessage,
  33. Loop_Close,
  34. Loop_Shutdown
  35. }
  36. ,
  37. {
  38. "Datagram",
  39. false,
  40. Datagram_Init,
  41. Datagram_Listen,
  42. Datagram_SearchForHosts,
  43. Datagram_Connect,
  44. Datagram_CheckNewConnections,
  45. Datagram_GetMessage,
  46. Datagram_SendMessage,
  47. Datagram_SendUnreliableMessage,
  48. Datagram_CanSendMessage,
  49. Datagram_CanSendUnreliableMessage,
  50. Datagram_Close,
  51. Datagram_Shutdown
  52. }
  53. };
  54. int net_numdrivers = 2;
  55. #include "net_udp.h"
  56. net_landriver_t net_landrivers[MAX_NET_DRIVERS] =
  57. {
  58. {
  59. "UDP",
  60. false,
  61. 0,
  62. UDP_Init,
  63. UDP_Shutdown,
  64. UDP_Listen,
  65. UDP_OpenSocket,
  66. UDP_CloseSocket,
  67. UDP_Connect,
  68. UDP_CheckNewConnections,
  69. UDP_Read,
  70. UDP_Write,
  71. UDP_Broadcast,
  72. UDP_AddrToString,
  73. UDP_StringToAddr,
  74. UDP_GetSocketAddr,
  75. UDP_GetNameFromAddr,
  76. UDP_GetAddrFromName,
  77. UDP_AddrCompare,
  78. UDP_GetSocketPort,
  79. UDP_SetSocketPort
  80. }
  81. };
  82. int net_numlandrivers = 1;