netif.h revision 525950c8008d080ca873214b776c45aa9a45566e
8e937899612528c862aad84d39ca073d231c3057vboxsync/** @file
8e937899612528c862aad84d39ca073d231c3057vboxsync * Main - Network Interfaces.
7b3d8a8298d217445c72a3afaf7cc2e07f6d7d74vboxsync */
8e937899612528c862aad84d39ca073d231c3057vboxsync
8e937899612528c862aad84d39ca073d231c3057vboxsync/*
8e937899612528c862aad84d39ca073d231c3057vboxsync * Copyright (C) 2008 Sun Microsystems, Inc.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync *
8e937899612528c862aad84d39ca073d231c3057vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
8e937899612528c862aad84d39ca073d231c3057vboxsync * available from http://www.virtualbox.org. This file is free software;
8e937899612528c862aad84d39ca073d231c3057vboxsync * you can redistribute it and/or modify it under the terms of the GNU
8e937899612528c862aad84d39ca073d231c3057vboxsync * General Public License (GPL) as published by the Free Software
8e937899612528c862aad84d39ca073d231c3057vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
8e937899612528c862aad84d39ca073d231c3057vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
8e937899612528c862aad84d39ca073d231c3057vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
8e937899612528c862aad84d39ca073d231c3057vboxsync *
8e937899612528c862aad84d39ca073d231c3057vboxsync * The contents of this file may alternatively be used under the terms
8e937899612528c862aad84d39ca073d231c3057vboxsync * of the Common Development and Distribution License Version 1.0
8e937899612528c862aad84d39ca073d231c3057vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
8e937899612528c862aad84d39ca073d231c3057vboxsync * VirtualBox OSE distribution, in which case the provisions of the
8e937899612528c862aad84d39ca073d231c3057vboxsync * CDDL are applicable instead of those of the GPL.
8e937899612528c862aad84d39ca073d231c3057vboxsync *
8e937899612528c862aad84d39ca073d231c3057vboxsync * You may elect to license modified versions of this file under the
8e937899612528c862aad84d39ca073d231c3057vboxsync * terms and conditions of either the GPL or the CDDL or both.
8e937899612528c862aad84d39ca073d231c3057vboxsync *
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * additional information or have any questions.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync */
8e937899612528c862aad84d39ca073d231c3057vboxsync
8e937899612528c862aad84d39ca073d231c3057vboxsync#ifndef ___netif_h
8e937899612528c862aad84d39ca073d231c3057vboxsync#define ___netif_h
8e937899612528c862aad84d39ca073d231c3057vboxsync
8e937899612528c862aad84d39ca073d231c3057vboxsync#include <iprt/cdefs.h>
8e937899612528c862aad84d39ca073d231c3057vboxsync#include <iprt/types.h>
8e937899612528c862aad84d39ca073d231c3057vboxsync#include <iprt/net.h>
8e937899612528c862aad84d39ca073d231c3057vboxsync
8e937899612528c862aad84d39ca073d231c3057vboxsync
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync/**
8e937899612528c862aad84d39ca073d231c3057vboxsync * Encapsulation type.
8e937899612528c862aad84d39ca073d231c3057vboxsync */
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsynctypedef enum NETIFTYPE
8e937899612528c862aad84d39ca073d231c3057vboxsync{
8e937899612528c862aad84d39ca073d231c3057vboxsync NETIF_T_UNKNOWN,
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync NETIF_T_ETHERNET,
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync NETIF_T_PPP,
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync NETIF_T_SLIP
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync} NETIFTYPE;
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync/**
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync * Current state of the interface.
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync */
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsynctypedef enum NETIFSTATUS
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync{
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync NETIF_S_UNKNOWN,
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync NETIF_S_UP,
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync NETIF_S_DOWN
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync} NETIFSTATUS;
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync/**
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync * Host Network Interface Information.
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync */
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsynctypedef struct NETIFINFO
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync{
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync NETIFINFO *pNext;
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync RTNETADDRIPV4 IPAddress;
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync RTNETADDRIPV4 IPNetMask;
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync RTNETADDRIPV6 IPv6Address;
8e937899612528c862aad84d39ca073d231c3057vboxsync RTNETADDRIPV6 IPv6NetMask;
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync RTMAC MACAddress;
8e937899612528c862aad84d39ca073d231c3057vboxsync NETIFTYPE enmType;
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync NETIFSTATUS enmStatus;
8e937899612528c862aad84d39ca073d231c3057vboxsync RTUUID Uuid;
8e937899612528c862aad84d39ca073d231c3057vboxsync char szShortName[50];
f716f1e4b9cf4d983c9cab4ed2edb32c349adcd1vboxsync char szName[1];
8e937899612528c862aad84d39ca073d231c3057vboxsync} NETIFINFO;
8e937899612528c862aad84d39ca073d231c3057vboxsync
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsync/** Pointer to a network interface info. */
8e937899612528c862aad84d39ca073d231c3057vboxsynctypedef NETIFINFO *PNETIFINFO;
8e937899612528c862aad84d39ca073d231c3057vboxsync/** Pointer to a const network interface info. */
8e937899612528c862aad84d39ca073d231c3057vboxsynctypedef NETIFINFO const *PCNETIFINFO;
8e937899612528c862aad84d39ca073d231c3057vboxsync
4d9067b4096dc07d546e2897b9bb7331da1a6ba9vboxsyncPNETIFINFO NetIfList();
8e937899612528c862aad84d39ca073d231c3057vboxsync
8e937899612528c862aad84d39ca073d231c3057vboxsync#endif
8e937899612528c862aad84d39ca073d231c3057vboxsync
8e937899612528c862aad84d39ca073d231c3057vboxsync