Module tch.netlink

Binding to receive netlink messages from the kernel.

This module registers a lua callback function that will be called on interface state changes broadcast from the kernel via netlink. The module uses the uloop event loop to process the activity on the netlink socket.

Usage:

    local uloop = require("uloop")
    local netlink=require("tch.netlink")
    local nl,err = netlink.listen(function(dev,state) ... end)
    
    local netlink.remove_neigh("192.168.1.254", "48:51:21:18:fd:8d", "eth0")
    
    ...
    uloop.run()
    

Functions

listen(cb) Create a new netlink object.
remove_neigh(ip, mac, dev) Remove the neighbour entry.


Functions

listen(cb)
Create a new netlink object.

Parameters:

  • cb callback function(dev,state) called with device name and state

Returns:

    netlink The newly created object.

Or

  1. nil
  2. string Error message.
remove_neigh(ip, mac, dev)
Remove the neighbour entry.

Parameters:

  • ip the IP address of the neighbour
  • mac the MAC address of the neighbour
  • dev the interface where the neighbour was discovered

Returns:

    boolean true

Or

  1. nil
  2. string Error message.
generated by LDoc 1.4.5 Last updated 2017-05-04 22:24:31