The XNP (XIAN Nano-Protocol Handler) Module has interaction with the drivers to send and receive the XIAN message.
Definition in file xnp.c.
#include <linux/init.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include "include/xian_proto.h"
Go to the source code of this file.
Functions | |
MODULE_DESCRIPTION ("XIAN - Module XNP: XIAN Nano-Protocol Handler") | |
MODULE_LICENSE ("GPL") | |
void | config_relay (void *pf) |
Function call by XIAN Manager to configure the relaying of received XIAN message from the RECEIVE function. | |
XIAN_EXPORT_SYMBOL (config_relay) | |
int | xian_handler_init (void) |
void | xian_handler_exit (void) |
module_init (xian_handler_init) | |
module_exit (xian_handler_exit) | |
void | recv_msg (unsigned char *saddr, struct xian_msg *stat) |
This function allows the processing of the received information. | |
void | xian_netif_rx (struct sk_buff *skb) |
This function is used to establish a step between the driver and the upper layer during reception. | |
XIAN_EXPORT_SYMBOL (xian_netif_rx) | |
int | hard_header (struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned int len) |
This function build the header of the frame to send. | |
unsigned int | incrementer (void) |
void | xian_if_send (char *dev_name, void *daddr, void *saddr, struct qos_metric_proto_msg message) |
This is the function used for sending XIAN message. | |
XIAN_EXPORT_SYMBOL (xian_if_send) | |
void | kinsert_metric (struct qos_metric_proto_msg *msg, unsigned int type, unsigned int id, unsigned int encoding_type, unsigned char mac[ETH_ALEN], struct xian_float value) |
This function is used to insert a metric (type, id, value) in a XIAN message. | |
XIAN_EXPORT_SYMBOL (kinsert_metric) | |
void | ksend_metric (char *dev_name, char *macadd, struct qos_metric_proto_msg msg, unsigned int *code_err) |
This function allows the sending of the XIAN message. | |
XIAN_EXPORT_SYMBOL (ksend_metric) | |
Variables | |
void(* | XIAN_Manager_relay )(unsigned char *saddr, struct xian_msg *stat) |
MODULE_DESCRIPTION | ( | "XIAN - Module XNP: XIAN Nano-Protocol Handler" | ) |
MODULE_LICENSE | ( | "GPL" | ) |
void config_relay | ( | void * | pf | ) |
Function call by XIAN Manager to configure the relaying of received XIAN message from the RECEIVE function.
*pf | pointer on function |
Definition at line 47 of file xnp.c.
References XIAN_Manager_relay.
XIAN_EXPORT_SYMBOL | ( | config_relay | ) |
int xian_handler_init | ( | void | ) |
module_init | ( | xian_handler_init | ) |
module_exit | ( | xian_handler_exit | ) |
void recv_msg | ( | unsigned char * | saddr, | |
struct xian_msg * | stat | |||
) |
This function allows the processing of the received information.
saddr | source address | |
stat | a struct xian_msg defined in xian_if.h |
Definition at line 75 of file xnp.c.
References xian_float::denominator, metric_msg::id, xian_msg::id, xian_msg::length, xian_msg::msg, xian_float::numerator, metric_msg::type, metric_msg::value, xian_msg::version, and XIAN_Manager_relay.
Referenced by xian_netif_rx().
void xian_netif_rx | ( | struct sk_buff * | skb | ) |
This function is used to establish a step between the driver and the upper layer during reception.
It Acts like a relay to capture the sk_buff and add treatment if necessary.
skb | sk_buff build in driver |
Definition at line 100 of file xnp.c.
References ETH_ALEN, and recv_msg().
XIAN_EXPORT_SYMBOL | ( | xian_netif_rx | ) |
int hard_header | ( | struct sk_buff * | skb, | |
struct net_device * | dev, | |||
unsigned short | type, | |||
void * | daddr, | |||
void * | saddr, | |||
unsigned int | len | |||
) |
This function build the header of the frame to send.
skb | a pointer to socker buffer | |
dev | a pointer to device | |
type | a type | |
daddr | a pointer to the destination address MAC | |
saddr | a pointer to the source address MAC | |
len | a length |
Definition at line 143 of file xnp.c.
Referenced by xian_if_send().
unsigned int incrementer | ( | void | ) |
void xian_if_send | ( | char * | dev_name, | |
void * | daddr, | |||
void * | saddr, | |||
struct qos_metric_proto_msg | message | |||
) |
This is the function used for sending XIAN message.
Warnings the length of the XIAN message must be smaller than the maximum size of data in a frame.
dev_name | a pointer to an array of char representing the device name | |
daddr | a pointer to an array of char representing the destination Mac Address formatted as follow XX:XX:XX:XX:XX:XX | |
saddr | a pointer to an array of char representing the source Mac Address formatted as follow XX:XX:XX:XX:XX:XX | |
message | a struct qos_metric_proto_msg |
Definition at line 172 of file xnp.c.
References qos_metric_proto_msg::encoding_type, metric_msg::encoding_type, ETH_ALEN, hard_header(), HEADER_SIZE, qos_metric_proto_msg::id, metric_msg::id, xian_msg::id, incrementer(), xian_msg::length, LL_RESERVED_SPACE, qos_metric_proto_msg::mac, metric_msg::mac, qos_metric_proto_msg::metric, METRIC_MSG_LEN, qos_metric_proto_msg::metric_name, xian_msg::msg, qos_metric_proto_msg::nb, metric_msg::type, qos_metric_proto_msg::value, metric_msg::value, xian_msg::version, XIAN_HEADER_SIZE, XIAN_NANO_PROTOCOL, and XIAN_NANO_PROTOCOL_VERSION.
XIAN_EXPORT_SYMBOL | ( | xian_if_send | ) |
void kinsert_metric | ( | struct qos_metric_proto_msg * | msg, | |
unsigned int | type, | |||
unsigned int | id, | |||
unsigned int | encoding_type, | |||
unsigned char | mac[ETH_ALEN], | |||
struct xian_float | value | |||
) |
This function is used to insert a metric (type, id, value) in a XIAN message.
msg | a pointer to a struct qos_metric_proto_msg | |
type | an unsigned int for the type metric | |
id | an unsigned int for the id of the metric | |
encoding_type | an unsigned int for indicate the encoding of the value | |
mac | a pointer to an array of char representing a Mac Address converted | |
value | an unsigned long long for the value's metric |
Definition at line 233 of file xnp.c.
References qos_metric_proto_msg::encoding_type, qos_metric_proto_msg::id, qos_metric_proto_msg::mac, qos_metric_proto_msg::metric, qos_metric_proto_msg::metric_name, qos_metric_proto_msg::nb, NB_METRICS, and qos_metric_proto_msg::value.
XIAN_EXPORT_SYMBOL | ( | kinsert_metric | ) |
void ksend_metric | ( | char * | dev_name, | |
char * | macadd, | |||
struct qos_metric_proto_msg | msg, | |||
unsigned int * | code_err | |||
) |
This function allows the sending of the XIAN message.
dev_name | a pointer to an array of char representing a device name | |
macadd | a pointer to an array of char representing a Mac Address formatted as follow XX:XX:XX:XX:XX:XX | |
msg | a struct qos_metric_proto_msg | |
code_err | output a code error if an error occurs (ie invalid Mac Address) |
Definition at line 268 of file xnp.c.
References convert_mac_addr(), ETH_ALEN, qos_metric_proto_msg::id_error, and xian_if_send().
XIAN_EXPORT_SYMBOL | ( | ksend_metric | ) |
void(* XIAN_Manager_relay)(unsigned char *saddr, struct xian_msg *stat) |
Definition at line 40 of file xnp.c.
Referenced by config_relay(), recv_msg(), and xian_handler_init().