Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lowlevel-sun.c File Reference
#include "dibbler-config.h"
#include <stdio.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <netdb.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <ifaddrs.h>
#include <net/if_dl.h>
#include <net/if.h>
#include "Portable.h"
#include <strings.h>
+ Include dependency graph for lowlevel-sun.c:

Functions

char * error_message ()
int get_mac_from_ipv6 (const char *iface_name, int ifindex, const char *v6addr, char *mac, int *mac_len)
 gets MAC address from the specified IPv6 address
char * getAAAKey (uint32_t SPI, unsigned *len)
char * getAAAKeyFilename (uint32_t SPI)
struct ifaceif_list_add (struct iface *head, struct iface *element)
struct ifaceif_list_get ()
void if_list_release (struct iface *list)
void if_print (struct iface *iface_ptr)
int ipaddr_add (const char *ifacename, int ifaceid, const char *addr, unsigned long pref, unsigned long valid, int prefixLength)
int ipaddr_del (const char *ifacename, int ifaceid, const char *addr, int prefixLength)
int ipaddr_update (const char *ifacename, int ifindex, const char *addr, unsigned long pref, unsigned long valid, int prefixLength)
int is_addr_tentative (char *ifacename, int iface, char *addr)
void link_state_change_cleanup ()
void link_state_change_init (volatile struct link_state_notify_t *monitored_links, volatile int *notify)
int lowlevelExit ()
int lowlevelInit ()
int sock_add (char *ifacename, int ifaceid, char *addr, int port, int thisifaceonly, int reuse)
int sock_del (int fd)
int sock_recv (int fd, char *myPlainAddr, char *peerPlainAddr, char *buf, int buflen)
int sock_send (int sock, char *addr, char *buf, int message_len, int port, int iface)

Variables

char Message [1024] = {0}

Function Documentation

char* error_message ( )
int get_mac_from_ipv6 ( const char *  iface_name,
int  ifindex,
const char *  v6addr,
char *  mac,
int *  mac_len 
)

gets MAC address from the specified IPv6 address

This is called immediately after we received message from that address, so the neighbor cache is guaranteed to have entry for it. This is highly os specific

Parameters
iface_namenetwork interface name
ifindexnetwork interface index
v6addrtext represenation of the IPv6 address
macpointer to MAC buffer (length specified in mac_len)
mac_lenspecifies MAC buffer length. Must be set so number of bytes set by the function
Returns
0 if successful, negative values if there are errors
Todo:
: Implement this for Solaris
char* getAAAKey ( uint32_t  SPI,
unsigned *  len 
)
char* getAAAKeyFilename ( uint32_t  SPI)
struct iface* if_list_add ( struct iface head,
struct iface element 
)
read
struct iface* if_list_get ( )
read
Todo:
: Ugly workaround. Please remove one BSD guys fix their kernel.
void if_list_release ( struct iface list)
void if_print ( struct iface iface_ptr)
int ipaddr_add ( const char *  ifacename,
int  ifaceid,
const char *  addr,
unsigned long  pref,
unsigned long  valid,
int  prefixLength 
)
int ipaddr_del ( const char *  ifacename,
int  ifaceid,
const char *  addr,
int  prefixLength 
)
int ipaddr_update ( const char *  ifacename,
int  ifindex,
const char *  addr,
unsigned long  pref,
unsigned long  valid,
int  prefixLength 
)
Todo:
: implement this
int is_addr_tentative ( char *  ifacename,
int  iface,
char *  addr 
)
Todo:
: implement this
void link_state_change_cleanup ( )

cleanup code for link state monitoring

void link_state_change_init ( volatile struct link_state_notify_t monitored_links,
volatile int *  notify 
)

begin link monitoring

Parameters
monitored_linkshead of the monitored links list
notifypointer to variable that is going to be modifed if change is detected
int lowlevelExit ( )
int lowlevelInit ( )
int sock_add ( char *  ifacename,
int  ifaceid,
char *  addr,
int  port,
int  thisifaceonly,
int  reuse 
)
int sock_del ( int  fd)
int sock_recv ( int  fd,
char *  myPlainAddr,
char *  peerPlainAddr,
char *  buf,
int  buflen 
)
int sock_send ( int  sock,
char *  addr,
char *  buf,
int  message_len,
int  port,
int  iface 
)

Variable Documentation

char Message[1024] = {0}