home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / nmap254b.zip / services.h < prev    next >
C/C++ Source or Header  |  2002-02-25  |  4KB  |  84 lines

  1. /***********************************************************************/
  2. /* services.c -- Various functions relating to reading the             */
  3. /* nmap-services file and port <-> service mapping                     */
  4. /*                                                                     */
  5. /***********************************************************************/
  6. /*  The Nmap Security Scanner is (C) 1995-2001 Insecure.Com LLC. This  */
  7. /*  program is free software; you can redistribute it and/or modify    */
  8. /*  it under the terms of the GNU General Public License as published  */
  9. /*  by the Free Software Foundation; Version 2.  This guarantees your  */
  10. /*  right to use, modify, and redistribute this software under certain */
  11. /*  conditions.  If this license is unacceptable to you, we may be     */
  12. /*  willing to sell alternative licenses (contact sales@insecure.com). */
  13. /*                                                                     */
  14. /*  If you received these files with a written license agreement       */
  15. /*  stating terms other than the (GPL) terms above, then that          */
  16. /*  alternative license agreement takes precendence over this comment. */
  17. /*                                                                     */
  18. /*  Source is provided to this software because we believe users have  */
  19. /*  a right to know exactly what a program is going to do before they  */
  20. /*  run it.  This also allows you to audit the software for security   */
  21. /*  holes (none have been found so far).                               */
  22. /*                                                                     */
  23. /*  Source code also allows you to port Nmap to new platforms, fix     */
  24. /*  bugs, and add new features.  You are highly encouraged to send     */
  25. /*  your changes to fyodor@insecure.org for possible incorporation     */
  26. /*  into the main distribution.  By sending these changes to Fyodor or */
  27. /*  one the insecure.org development mailing lists, it is assumed that */
  28. /*  you are offering Fyodor the unlimited, non-exclusive right to      */
  29. /*  reuse, modify, and relicense the code.  This is important because  */
  30. /*  the inability to relicense code has caused devastating problems    */
  31. /*  for other Free Software projects (such as KDE and NASM).  Nmap     */
  32. /*  will always be available Open Source.  If you wish to specify      */
  33. /*  special license conditions of your contributions, just say so      */
  34. /*  when you send them.                                                */
  35. /*                                                                     */
  36. /*  This program is distributed in the hope that it will be useful,    */
  37. /*  but WITHOUT ANY WARRANTY; without even the implied warranty of     */
  38. /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  */
  39. /*  General Public License for more details (                          */
  40. /*  http://www.gnu.org/copyleft/gpl.html ).                            */
  41. /*                                                                     */
  42. /***********************************************************************/
  43.  
  44. /* $Id: services.h,v 1.7 2001/08/10 05:53:08 fyodor Exp $ */
  45.  
  46.  
  47. #ifndef SERVICES_H
  48. #define SERVICES_H
  49.  
  50. #ifdef __EMX__
  51. #include <sys/types.h>
  52. #endif
  53.  
  54. #ifdef WIN32
  55. #include "mswin32\winclude.h"
  56. #else
  57. #include <netdb.h>
  58. #endif
  59. #include "nmap.h"
  60. #include "global_structures.h"
  61. #include "charpool.h"
  62. #include "nmap_error.h"
  63. #include "utils.h"
  64.  
  65. #define SERVICE_TABLE_SIZE 1024
  66.  
  67. /* just flags to indicate whether a particular port number should get tcp 
  68.  * scanned, udp scanned, or both
  69.  */
  70. #define SCAN_TCP_PORT    (1 << 0)
  71. #define SCAN_UDP_PORT    (1 << 1)
  72. #define SCAN_PROTOCOLS    (1 << 2)
  73.  
  74. struct service_list {
  75.   struct servent *servent;
  76.   struct service_list *next;
  77. };
  78.  
  79. struct servent *nmap_getservbyport(int port, const char *proto);
  80. struct scan_lists *getfastports(int tcpscan, int udpscan);
  81. struct scan_lists *getdefaultports(int tcpscan, int udpscan);
  82.  
  83. #endif
  84.