| 
| int  | rtnl_addr_set_label (struct rtnl_addr *addr, const char *label) | 
|   | 
| char *  | rtnl_addr_get_label (struct rtnl_addr *addr) | 
|   | 
| void  | rtnl_addr_set_ifindex (struct rtnl_addr *addr, int ifindex) | 
|   | 
| int  | rtnl_addr_get_ifindex (struct rtnl_addr *addr) | 
|   | 
| void  | rtnl_addr_set_link (struct rtnl_addr *addr, struct rtnl_link *link) | 
|   | 
| struct rtnl_link *  | rtnl_addr_get_link (struct rtnl_addr *addr) | 
|   | 
| void  | rtnl_addr_set_family (struct rtnl_addr *addr, int family) | 
|   | 
| int  | rtnl_addr_get_family (struct rtnl_addr *addr) | 
|   | 
| void  | rtnl_addr_set_prefixlen (struct rtnl_addr *addr, int prefixlen) | 
|   | Set the prefix length / netmask.  More...
  | 
|   | 
| int  | rtnl_addr_get_prefixlen (struct rtnl_addr *addr) | 
|   | 
| void  | rtnl_addr_set_scope (struct rtnl_addr *addr, int scope) | 
|   | 
| int  | rtnl_addr_get_scope (struct rtnl_addr *addr) | 
|   | 
| void  | rtnl_addr_set_flags (struct rtnl_addr *addr, unsigned int flags) | 
|   | 
| void  | rtnl_addr_unset_flags (struct rtnl_addr *addr, unsigned int flags) | 
|   | 
| unsigned int  | rtnl_addr_get_flags (struct rtnl_addr *addr) | 
|   | 
| int  | rtnl_addr_set_local (struct rtnl_addr *addr, struct nl_addr *local) | 
|   | 
| struct nl_addr *  | rtnl_addr_get_local (struct rtnl_addr *addr) | 
|   | 
| int  | rtnl_addr_set_peer (struct rtnl_addr *addr, struct nl_addr *peer) | 
|   | 
| struct nl_addr *  | rtnl_addr_get_peer (struct rtnl_addr *addr) | 
|   | 
| int  | rtnl_addr_set_broadcast (struct rtnl_addr *addr, struct nl_addr *bcast) | 
|   | 
| struct nl_addr *  | rtnl_addr_get_broadcast (struct rtnl_addr *addr) | 
|   | 
| int  | rtnl_addr_set_multicast (struct rtnl_addr *addr, struct nl_addr *multicast) | 
|   | 
| struct nl_addr *  | rtnl_addr_get_multicast (struct rtnl_addr *addr) | 
|   | 
| int  | rtnl_addr_set_anycast (struct rtnl_addr *addr, struct nl_addr *anycast) | 
|   | 
| struct nl_addr *  | rtnl_addr_get_anycast (struct rtnl_addr *addr) | 
|   | 
| uint32_t  | rtnl_addr_get_valid_lifetime (struct rtnl_addr *addr) | 
|   | 
| void  | rtnl_addr_set_valid_lifetime (struct rtnl_addr *addr, uint32_t lifetime) | 
|   | 
| uint32_t  | rtnl_addr_get_preferred_lifetime (struct rtnl_addr *addr) | 
|   | 
| void  | rtnl_addr_set_preferred_lifetime (struct rtnl_addr *addr, uint32_t lifetime) | 
|   | 
| uint32_t  | rtnl_addr_get_create_time (struct rtnl_addr *addr) | 
|   | 
| uint32_t  | rtnl_addr_get_last_update_time (struct rtnl_addr *addr) | 
|   | 
      
        
          | struct rtnl_addr * rtnl_addr_get  | 
          ( | 
          struct nl_cache *  | 
          cache,  | 
        
        
           | 
           | 
          int  | 
          ifindex,  | 
        
        
           | 
           | 
          struct nl_addr *  | 
          addr  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Search address in cache. 
- Parameters
 - 
  
    | cache | Address cache  | 
    | ifindex | Interface index of address  | 
    | addr | Local address part | 
  
   
Searches address cache previously allocated with rtnl_addr_alloc_cache() for an address with a matching local address.
The reference counter is incremented before returning the address, therefore the reference must be given back with rtnl_addr_put() after usage.
- Returns
 - Address object or NULL if no match was found. 
 
Definition at line 596 of file addr.c.
References nl_addr_cmp(), and nl_object_get().
 
 
      
        
          | int rtnl_addr_build_add_request  | 
          ( | 
          struct rtnl_addr *  | 
          addr,  | 
        
        
           | 
           | 
          int  | 
          flags,  | 
        
        
           | 
           | 
          struct nl_msg **  | 
          result  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Build netlink request message to request addition of new address. 
- Parameters
 - 
  
    | addr | Address object representing the new address.  | 
    | flags | Additional netlink message flags.  | 
    | result | Pointer to store resulting message. | 
  
   
Builds a new netlink message requesting the addition of a new address. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via nl_send_auto_complete() or supplemented as needed.
Minimal required attributes:
- interface index (rtnl_addr_set_ifindex())
 
- local address (rtnl_addr_set_local())
 
The scope will default to universe except for loopback addresses in which case a host scope is used if not specified otherwise.
- Note
 - Free the memory after usage using nlmsg_free().
 
- Returns
 - 0 on success or a negative error code. 
 
Definition at line 722 of file addr.c.
Referenced by rtnl_addr_add().
 
 
      
        
          | int rtnl_addr_build_delete_request  | 
          ( | 
          struct rtnl_addr *  | 
          addr,  | 
        
        
           | 
           | 
          int  | 
          flags,  | 
        
        
           | 
           | 
          struct nl_msg **  | 
          result  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Build a netlink request message to request deletion of an address. 
- Parameters
 - 
  
    | addr | Address object to be deleteted.  | 
    | flags | Additional netlink message flags.  | 
    | result | Pointer to store resulting message. | 
  
   
Builds a new netlink message requesting a deletion of an address. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via nl_send_auto_complete() or supplemented as needed.
Minimal required attributes:
- interface index (rtnl_addr_set_ifindex())
 
- address family (rtnl_addr_set_family())
 
Optional attributes:
- local address (rtnl_addr_set_local())
 
- label (rtnl_addr_set_label(), IPv4/DECnet only)
 
- peer address (rtnl_addr_set_peer(), IPv4 only)
 
- Note
 - Free the memory after usage using nlmsg_free().
 
- Returns
 - 0 on success or a negative error code. 
 
Definition at line 795 of file addr.c.
Referenced by rtnl_addr_delete().
 
 
      
        
          | void rtnl_addr_set_prefixlen  | 
          ( | 
          struct rtnl_addr *  | 
          addr,  | 
        
        
           | 
           | 
          int  | 
          prefixlen  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Set the prefix length / netmask. 
- Parameters
 - 
  
    | addr | Address  | 
    | prefixlen | Length of prefix (netmask) | 
  
   
Modifies the length of the prefix. If the address object contains a peer address the prefix length will apply to it, otherwise the prefix length will apply to the local address of the address.
If the address object contains a peer or local address the corresponding struct nl_addr will be updated with the new prefix length.
- Note
 - Specifying a length of 0 will remove the prefix length alltogether.
 
- See also
 - rtnl_addr_get_prefixlen() 
 
Definition at line 923 of file addr.c.
References nl_addr_set_prefixlen().