home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / MacTCP Library 1.1 / Library / LowLevel ƒ / Source ƒ / GetMyIPAddr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-04  |  499 b   |  29 lines  |  [TEXT/SPM ]

  1. /*
  2.     GetMyIPAddr.c
  3.     
  4.     Code to implement the GetMyIPAddr function.
  5.     
  6.     01/31/94 dn - Created.
  7.     11/28/94 mc - Converted to CodeWarrior
  8.     12/04/95 dn - Prep'd for Apprentice 4
  9. */
  10.  
  11. #include <MyTCPIncludes.h>
  12.  
  13. /*
  14.     GetMyIPAddr
  15.     
  16.     Fetch the IP address for the current mac.
  17. */
  18. OSErr GetMyIPAddr(GetAddrParamBlock* pb,Boolean async){
  19.     
  20.     if (pb==(GetAddrParamBlock*)0)
  21.         return getipNilPB;
  22.     
  23.     if (pb->ioCRefNum==0)
  24.         return getipNilRefNum;
  25.     
  26.     pb->csCode=ipctlGetAddr;
  27.     
  28.     return SyncAsync((ParmBlkPtr)pb,async);
  29. }