Lely core libraries  2.2.5
if.h File Reference
#include <lely/io/addr.h>
Include dependency graph for if.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  io_ifinfo
 A structure describing a network interface. More...
 

Macros

#define IO_IF_NAME_STRLEN   16
 The maximum number of bytes required to hold the name of a network interface, including the terminating null byte.
 
#define IO_IFINFO_INIT
 The static initializer for struct io_ifinfo.
 

Enumerations

enum  {
  IO_IF_UP = 1 << 0, IO_IF_BROADCAST = 1 << 1, IO_IF_LOOPBACK = 1 << 2, IO_IF_POINTTOPOINT = 1 << 3,
  IO_IF_MULTICAST = 1 << 4
}
 

Functions

int io_get_ifinfo (int maxinfo, struct io_ifinfo *info)
 Obtains a list of network interfaces. More...
 

Detailed Description

This header file is part of the I/O library; it contains network interface declarations.

Author
J. S. Seldenthuis jseld.nosp@m.enth.nosp@m.uis@l.nosp@m.ely..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file if.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
IO_IF_UP 

The interface is running.

IO_IF_BROADCAST 

A valid broadcast address is set.

IO_IF_LOOPBACK 

The interface is a loopback interface.

IO_IF_POINTTOPOINT 

The interface is a point-to-point link.

IO_IF_MULTICAST 

The interface supports multicast.

Definition at line 37 of file if.h.

Function Documentation

◆ io_get_ifinfo()

int io_get_ifinfo ( int  maxinfo,
struct io_ifinfo info 
)

Obtains a list of network interfaces.

Parameters
maxinfothe maximum number of io_ifinfo structs to return.
infoan array of at least maxinfo io_ifinfo structs (can be NULL). On success, *info contains at most maxinfo structures describing the network interfaces.
Returns
the total number of interfaces (which may be different from maxinfo), or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 57 of file if.c.