Loading...
Searching...
No Matches
network_monitor.h File Reference

mptcpd network device monitoring - internal API. More...

`#include <mptcpd/export.h>`
`#include <stdint.h>`
Include dependency graph for network_monitor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros

Mptcpd Network Monitor Flags
Flags controlling address notification in the mptcpd network monitor. Pass to `mptcpd_nm_create()`.
#define | MPTCPD_NOTIFY_FLAG_EXISTING (1U << 0)
#define | MPTCPD_NOTIFY_FLAG_SKIP_LL (1U << 1)
| Ignore link-local addresses.
#define | MPTCPD_NOTIFY_FLAG_SKIP_HOST (1U << 2)
| Ignore host (loopback) addresses.
#define | MPTCPD_NOTIFY_FLAG_ROUTE_CHECK (1U << 3)

## Functions

MPTCPD_API struct mptcpd_nm * | mptcpd_nm_create (uint32_t flags)
| Create a network monitor.
MPTCPD_API void | mptcpd_nm_destroy (struct mptcpd_nm *nm)
| Destroy a network monitor.

## Detailed Description

mptcpd network device monitoring - internal API.

Copyright (c) 2017-2022, Intel Corporation

## Macro Definition Documentation

## MPTCPD_NOTIFY_FLAG_EXISTING

#define MPTCPD_NOTIFY_FLAG_EXISTING (1U << 0)

Notify even the addresses already existing at startup-time.

## MPTCPD_NOTIFY_FLAG_ROUTE_CHECK

#define MPTCPD_NOTIFY_FLAG_ROUTE_CHECK (1U << 3)

Notify address only if a default route is available from the given interface.

## Function Documentation

## mptcpd_nm_create()

MPTCPD_API struct mptcpd_nm * mptcpd_nm_create | ( | uint32_t | flags | ) |

Create a network monitor.

Parameters

  [in] | flags | Flags controlling address notification, any of: MPTCPD_NOTIFY_FLAG_EXISTING, MPTCPD_NOTIFY_FLAG_SKIP_LL, MPTCPD_NOTIFY_FLAG_SKIP_HOST

Todo
  As currently implemented, one could create multiple network monitors. Is that useful?

Returns
  Pointer to new network monitor on success. `NULL` on failure.

Get network interface information.

Note
  We force the second rtnetlink command, RTM_GETADDR, to be sent after this one completes by doing so in the destroy callback for this command. That guarantees that the potential multipart message response from this dump is fully read prior to sending the second command. This works around an issue in ELL where it was possible that the second command would be sent prior to receiving all of the parts of the multipart `RTM_GETLINK` response, which resulted in an EBUSY error.

## mptcpd_nm_destroy()

MPTCPD_API void mptcpd_nm_destroy | ( | struct mptcpd_nm * | nm | ) |

Destroy a network monitor.

Parameters

  [in,out] | nm | Network monitor to be destroyed.