]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/ipfilter/lib/to_interface.c
This commit was generated by cvs2svn to compensate for changes in r147338,
[FreeBSD/FreeBSD.git] / contrib / ipfilter / lib / to_interface.c
1 /*      $FreeBSD$       */
2
3 /*
4  * Copyright (C) 1993-2001 by Darren Reed.
5  *
6  * See the IPFILTER.LICENCE file for details on licencing.
7  *
8  * Id: to_interface.c,v 1.8 2002/01/28 06:50:48 darrenr Exp
9  */
10
11 #include "ipf.h"
12
13
14 int to_interface(fdp, to, linenum)
15 frdest_t *fdp;
16 char *to;
17 int linenum;
18 {
19         char *s;
20
21         s = strchr(to, ':');
22         fdp->fd_ifp = NULL;
23         if (s) {
24                 *s++ = '\0';
25                 if (hostnum((u_32_t *)&fdp->fd_ip, s, linenum, NULL) == -1)
26                         return -1;
27         }
28         (void) strncpy(fdp->fd_ifname, to, sizeof(fdp->fd_ifname) - 1);
29         fdp->fd_ifname[sizeof(fdp->fd_ifname) - 1] = '\0';
30         return 0;
31 }