]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ipfilter/lib/load_url.c
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ipfilter / lib / load_url.c
1 /*
2  * Copyright (C) 2012 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * $Id: load_url.c,v 1.3.2.2 2012/07/22 08:04:24 darren_r 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 }