libnl: NAT

libnl 3.7.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. More...
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. More...
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. More...
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. More...
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 112 of file nat.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ 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 143 of file nat.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ 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 174 of file nat.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ 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 208 of file nat.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function: