libnl: NAT

libnl 3.10.0

NAT
Routing Library (libnl-route) » Traffic Control » Action

## Attribute Modifications
int | rtnl_nat_set_old_addr (struct rtnl_act *act, in_addr_t addr)
| Set old IPv4 address on a netlink NAT action object.
int | rtnl_nat_get_old_addr (struct rtnl_act *act, in_addr_t *addr)
int | rtnl_nat_set_new_addr (struct rtnl_act *act, in_addr_t addr)
| Set new IPv4 address on a netlink NAT action object.
int | rtnl_nat_get_new_addr (struct rtnl_act *act, in_addr_t *addr)
int | rtnl_nat_set_mask (struct rtnl_act *act, in_addr_t bitmask)
| Set IPv4 address mask on a netlink NAT action object.
int | rtnl_nat_get_mask (struct rtnl_act *act, in_addr_t *bitmask)
int | rtnl_nat_set_flags (struct rtnl_act *act, uint32_t flags)
| Set flags for a netlink NAT action object.
int | rtnl_nat_get_flags (struct rtnl_act *act, uint32_t *flags)
int | rtnl_nat_set_action (struct rtnl_act *act, int action)
int | rtnl_nat_get_action (struct rtnl_act *act, int *action)

## Detailed Description

## Function Documentation

## ◆ rtnl_nat_set_old_addr()

int rtnl_nat_set_old_addr | ( | struct rtnl_act * | act,
|  | in_addr_t | addr )

Set old IPv4 address on a netlink NAT action object.

Parameters

  act | Action object
  addr | Binary IPv4 address in host byte order

Returns
  0 on success or negative error code in case of an error.

Definition at line 113 of file nat.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_nat_get_old_addr()

int rtnl_nat_get_old_addr | ( | struct rtnl_act * | act,
|  | in_addr_t * | addr )

Definition at line 125 of file nat.c.

## ◆ rtnl_nat_set_new_addr()

int rtnl_nat_set_new_addr | ( | struct rtnl_act * | act,
|  | in_addr_t | addr )

Set new IPv4 address on a netlink NAT action object.

Parameters

  act | Action object
  addr | Binary IPv4 address in host byte order

Returns
  0 on success or negative error code in case of an error.

Definition at line 144 of file nat.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_nat_get_new_addr()

int rtnl_nat_get_new_addr | ( | struct rtnl_act * | act,
|  | in_addr_t * | addr )

Definition at line 156 of file nat.c.

## ◆ rtnl_nat_set_mask()

int rtnl_nat_set_mask | ( | struct rtnl_act * | act,
|  | in_addr_t | bitmask )

Set IPv4 address mask on a netlink NAT action object.

Parameters

  act | Action object
  mask | IPv4 address mask

Returns
  0 on success or negative error code in case of an error.

Definition at line 175 of file nat.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_nat_get_mask()

int rtnl_nat_get_mask | ( | struct rtnl_act * | act,
|  | in_addr_t * | bitmask )

Definition at line 187 of file nat.c.

## ◆ rtnl_nat_set_flags()

int rtnl_nat_set_flags | ( | struct rtnl_act * | act,
|  | uint32_t | flags )

Set flags for a netlink NAT action object.

Parameters

  act | Action object
  flags | TCA_NAT_FLAG_* flags.

Currently only TCA_NAT_FLAG_EGRESS is defined. Selects NAT on egress/IP src if set, ingress/IP dst otherwise.

Returns
  0 on success or negative error code in case of an error.

Definition at line 209 of file nat.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_nat_get_flags()

int rtnl_nat_get_flags | ( | struct rtnl_act * | act,
|  | uint32_t * | flags )

Definition at line 221 of file nat.c.

## ◆ rtnl_nat_set_action()

int rtnl_nat_set_action | ( | struct rtnl_act * | act,
|  | int | action )

Definition at line 233 of file nat.c.

## ◆ rtnl_nat_get_action()

int rtnl_nat_get_action | ( | struct rtnl_act * | act,
|  | int * | action )

Definition at line 248 of file nat.c.