[206] | 1 | /*
|
---|
| 2 | Unix SMB/CIFS implementation.
|
---|
| 3 | Machine customisation and include handling
|
---|
| 4 | Copyright (C) Jeremy Allison <jra@samba.org> 2007
|
---|
| 5 |
|
---|
| 6 | This program is free software; you can redistribute it and/or modify
|
---|
| 7 | it under the terms of the GNU General Public License as published by
|
---|
| 8 | the Free Software Foundation; either version 3 of the License, or
|
---|
| 9 | (at your option) any later version.
|
---|
| 10 |
|
---|
| 11 | This program is distributed in the hope that it will be useful,
|
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 14 | GNU General Public License for more details.
|
---|
| 15 |
|
---|
| 16 | You should have received a copy of the GNU General Public License
|
---|
| 17 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 18 | */
|
---|
| 19 | /*
|
---|
| 20 | This structure is used by lib/interfaces.c to return the list of network
|
---|
| 21 | interfaces on the machine
|
---|
| 22 | */
|
---|
| 23 |
|
---|
| 24 | #ifndef _INTERFACES_H
|
---|
| 25 | #define _INTERFACES_H
|
---|
| 26 |
|
---|
| 27 | #include "lib/replace/replace.h"
|
---|
| 28 | #include "lib/replace/system/network.h"
|
---|
| 29 |
|
---|
| 30 | #define MAX_INTERFACES 128
|
---|
| 31 |
|
---|
| 32 | struct iface_struct {
|
---|
| 33 | char name[16];
|
---|
| 34 | int flags;
|
---|
| 35 | struct sockaddr_storage ip;
|
---|
| 36 | struct sockaddr_storage netmask;
|
---|
| 37 | struct sockaddr_storage bcast;
|
---|
| 38 | };
|
---|
| 39 |
|
---|
| 40 | bool make_netmask(struct sockaddr_storage *pss_out,
|
---|
| 41 | const struct sockaddr_storage *pss_in,
|
---|
| 42 | unsigned long masklen);
|
---|
| 43 | void make_bcast(struct sockaddr_storage *pss_out,
|
---|
| 44 | const struct sockaddr_storage *pss_in,
|
---|
| 45 | const struct sockaddr_storage *nmask);
|
---|
| 46 | void make_net(struct sockaddr_storage *pss_out,
|
---|
| 47 | const struct sockaddr_storage *pss_in,
|
---|
| 48 | const struct sockaddr_storage *nmask);
|
---|
| 49 | int get_interfaces(struct iface_struct *ifaces, int max_interfaces);
|
---|
| 50 |
|
---|
| 51 | #endif
|
---|