]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ipfilter/lib/load_url.c
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ipfilter / lib / load_url.c
1 /*
2  * Copyright (C) 2006 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * $Id: load_url.c,v 1.1.2.1 2006/08/25 21:13:04 darrenr Exp $
7  */
8
9 #include "ipf.h"
10
11 alist_t *
12 load_url(char *url)
13 {
14         alist_t *hosts = NULL;
15
16         if (strncmp(url, "file://", 7) == 0) { 
17                 /*      
18                  * file:///etc/passwd
19                  *        ^------------s
20                  */     
21                 hosts = load_file(url);
22
23         } else if (*url == '/' || *url == '.') {
24                 hosts = load_file(url);
25
26         } else if (strncmp(url, "http://", 7) == 0) {
27                 hosts = load_http(url);
28         }
29
30         return hosts;  
31 }