/[radius]/radius/lib/iputil.c
ViewVC logotype

Diff of /radius/lib/iputil.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by gray, Fri Jun 7 05:30:15 2002 UTC revision 1.3 by gray, Wed Apr 30 08:47:57 2003 UTC
# Line 1  Line 1 
1  /* This file is part of GNU RADIUS.  /* This file is part of GNU Radius.
2     Copyright (C) 2000, Sergey Poznyakoff     Copyright (C) 2000,2001,2002,2003 Sergey Poznyakoff
3        
4     This program is free software; you can redistribute it and/or modify     GNU Radius is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.     (at your option) any later version.
8        
9     This program is distributed in the hope that it will be useful,     GNU Radius is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.     GNU General Public License for more details.
13        
14     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software Foundation,     along with GNU Radius; if not, write to the Free Software Foundation,
16     Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */     Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
17    
 #ifndef lint  
 static char rcsid[] =  
 "$Id$";  
 #endif  
   
18  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
19  # include <config.h>  # include <config.h>
20  #endif  #endif
# Line 46  int resolve_hostnames = 1; Line 41  int resolve_hostnames = 1;
41   *      for the supplied IP address.   *      for the supplied IP address.
42   */   */
43  char *  char *
44  ip_gethostname(ipaddr, namebuf, size)  ip_gethostname(UINT4 ipaddr, char *namebuf, size_t size)
         UINT4 ipaddr;  
         char *namebuf;  
         size_t size;  
45  {  {
46          struct hostent *hp, hent;          struct hostent *hp, hent;
47          char buffer[512];          char buffer[512];
# Line 78  ip_gethostname(ipaddr, namebuf, size) Line 70  ip_gethostname(ipaddr, namebuf, size)
70   * name or address in dot notation.   * name or address in dot notation.
71   */   */
72  UINT4  UINT4
73  ip_gethostaddr(host)  ip_gethostaddr(char *host)
         char *host;  
74  {  {
75          struct hostent  *hp, hent;          struct hostent  *hp, hent;
76          char buffer[512];          char buffer[512];
# Line 98  ip_gethostaddr(host) Line 89  ip_gethostaddr(host)
89   * Check for valid IP address in standard dot notation.   * Check for valid IP address in standard dot notation.
90   */   */
91  int  int
92  good_ipaddr(addr)  good_ipaddr(char *addr)
         char *addr;  
93  {  {
94          int     dot_count;          int     dot_count;
95          int     digit_count;          int     digit_count;
# Line 125  good_ipaddr(addr) Line 115  good_ipaddr(addr)
115   * provided address in host long notation.   * provided address in host long notation.
116   */   */
117  char *  char *
118  ip_iptostr(ipaddr, buffer)  ip_iptostr(UINT4 ipaddr, char *buffer)
         UINT4 ipaddr;  
         char *buffer;  
119  {  {
120          sprintf(buffer, "%u.%u.%u.%u",          sprintf(buffer, "%u.%u.%u.%u",
121                  (u_int) ((ipaddr >> 24) & 0xff),                  (u_int) ((ipaddr >> 24) & 0xff),
# Line 142  ip_iptostr(ipaddr, buffer) Line 130  ip_iptostr(ipaddr, buffer)
130   *      one supplied in standard dot notation.   *      one supplied in standard dot notation.
131   */   */
132  UINT4  UINT4
133  ip_strtoip(ip_str)  ip_strtoip(char *ip_str)
         char *ip_str;  
134  #ifdef HAVE_INET_ATON  #ifdef HAVE_INET_ATON
135  {  {
136          struct in_addr in;          struct in_addr in;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26