home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / protocol / tcpip / 5280 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  1.2 KB

  1. Path: sparky!uunet!gatech!darwin.sura.net!jvnc.net!rutgers!vpbuild!admin1!vpmeu015!jessea
  2. From: jessea@vpmeu015.me.vp.com (Jesse W. Asher)
  3. Newsgroups: comp.protocols.tcp-ip
  4. Subject: Checking for valid ip address (in ascii form).
  5. Message-ID: <1992Nov22.165049.9887@vpbuild.vp.com>
  6. Date: 22 Nov 92 16:50:49 GMT
  7. Sender: @vpbuild.vp.com
  8. Organization: Varco-Pruden Buildings
  9. Lines: 15
  10.  
  11. Does anyone have any suggestions on how to check for a valid IP address
  12. that is in ascii from (not in network byte order)?  What I'm doing is
  13. reading in a string that should be made up of a dot notation IP address
  14. and I want to validate it.  Unfortunately, inet_addr takes a whole lot
  15. of numbers as valid - even if it isn't in dot notation.  It will take
  16. "10000" as a valid ip address, for example.  It may be, but it really
  17. isn't in my case because I want to enforce dot notation.  Is there a
  18. function I'm not aware of that will do this level of checking?  Will I
  19. just have to do it myself?
  20.  
  21. -- 
  22.       Jesse W. Asher                                          (901)762-6000
  23.                              Varco-Pruden Buildings
  24.                  6000 Poplar Ave., Suite 400, Memphis, TN  38119
  25.     Internet: jessea@vpbuild.vp.com                   UUCP: vpbuild!jessea
  26.