summaryrefslogtreecommitdiffstats
path: root/Utilities/cmtar/compat/inet_aton.c
blob: cc1e507c3dbd5d326879b58389bef94a565d9997 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
**  Copyright 2002 University of Illinois Board of Trustees
**  Copyright 2002 Mark D. Roth
**  All rights reserved.
**
**  inet_aton.c - inet_aton() function for compatibility library
**
**  Mark D. Roth <roth@uiuc.edu>
**  Campus Information Technologies and Educational Services
**  University of Illinois at Urbana-Champaign
*/

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>


int
inet_aton(const char *cp, struct in_addr *inp)
{
  inp->s_addr = inet_addr(cp);
  if (inp->s_addr == -1)
    return 0;
  return 1;
}