Changed uX, uX_t sX, sX_t to uinX_t
Cleaned some PDCP/driver code types parameters and vars Please see openair2/COMMON/platform_types.h for simple coding rules. please declare prototypes of functions in .h and include .h files in where the function is used and where it is implemented. git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5096 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -61,7 +61,7 @@ void print_error(int status){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
void print_state(u8 state){
|
||||
void print_state(uint8_t state){
|
||||
//---------------------------------------------------------------------------
|
||||
switch(state){
|
||||
case NAS_IDLE:printf("NAS_IDLE\n");return;
|
||||
@@ -217,13 +217,13 @@ int main(int argc, char *argv[]){
|
||||
/***/
|
||||
// printf("Usage: gioctl cx list\n");
|
||||
if (strcmp(argv[2], "list")==0){
|
||||
u8 *msgrep;
|
||||
u8 i;
|
||||
uint8_t *msgrep;
|
||||
uint8_t i;
|
||||
struct nas_msg_cx_list_reply *list;
|
||||
u8 lcr;
|
||||
uint8_t lcr;
|
||||
gifr.type=NAS_MSG_CX_LIST_REQUEST;
|
||||
gifr.msg=(char *)malloc(NAS_LIST_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1);
|
||||
msgrep=(u8 *)(gifr.msg);
|
||||
msgrep=(uint8_t *)(gifr.msg);
|
||||
//
|
||||
printf(" Connexion list requested\n");
|
||||
err=ioctl(fd, NASMT_IOCTL_RAL, &gifr);
|
||||
@@ -237,7 +237,7 @@ int main(int argc, char *argv[]){
|
||||
{
|
||||
printf("%u\t\t%u\t%u\t", list[lcr].lcr, list[lcr].cellid, list[lcr].iid4);
|
||||
for (i=0;i<8;++i)
|
||||
printf("%02x", *((u8 *)list[lcr].iid6+i));
|
||||
printf("%02x", *((uint8_t *)list[lcr].iid6+i));
|
||||
printf("\t%u\t%u\t", list[lcr].num_rb, list[lcr].nsclassifier);
|
||||
print_state(list[lcr].state);
|
||||
}
|
||||
@@ -314,8 +314,8 @@ int main(int argc, char *argv[]){
|
||||
/***/
|
||||
// printf("Usage: gioctl rb list <lcr>\n");
|
||||
if (strcmp(argv[2], "list")==0){
|
||||
u8 *msgrep;
|
||||
u8 rbi;
|
||||
uint8_t *msgrep;
|
||||
uint8_t rbi;
|
||||
struct nas_msg_rb_list_reply *list;
|
||||
struct nas_msg_rb_list_request *msgreq;
|
||||
if (argc<4){
|
||||
@@ -325,7 +325,7 @@ int main(int argc, char *argv[]){
|
||||
gifr.type=NAS_MSG_RB_LIST_REQUEST;
|
||||
gifr.msg=(char *)malloc(NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1);
|
||||
msgreq=(struct nas_msg_rb_list_request *)(gifr.msg);
|
||||
msgrep=(u8 *)(gifr.msg);
|
||||
msgrep=(uint8_t *)(gifr.msg);
|
||||
msgreq->lcr=strtoul(argv[3], NULL, 0);
|
||||
//
|
||||
printf(" Radio bearer list requested\n");
|
||||
@@ -359,7 +359,7 @@ int main(int argc, char *argv[]){
|
||||
{
|
||||
struct nas_msg_class_add_request *msgreq;
|
||||
struct nas_msg_class_add_reply *msgrep;
|
||||
u8 i,j;
|
||||
uint8_t i,j;
|
||||
gifr.type=NAS_MSG_CLASS_ADD_REQUEST;
|
||||
gifr.msg=(char *)malloc(sizeof(msgrep)<sizeof(msgreq)?sizeof(msgreq):sizeof(msgrep));
|
||||
msgreq=(struct nas_msg_class_add_request *)(gifr.msg);
|
||||
@@ -559,7 +559,7 @@ int main(int argc, char *argv[]){
|
||||
/***/
|
||||
if (strcmp(argv[2], "del")==0)
|
||||
{
|
||||
u8 i;
|
||||
uint8_t i;
|
||||
struct nas_msg_class_del_request *msgreq;
|
||||
struct nas_msg_class_del_reply *msgrep;
|
||||
gifr.type=NAS_MSG_CLASS_DEL_REQUEST;
|
||||
@@ -628,8 +628,8 @@ int main(int argc, char *argv[]){
|
||||
/***/
|
||||
if (strcmp(argv[2], "list")==0)
|
||||
{
|
||||
u8 *msgrep;
|
||||
u8 cli, i;
|
||||
uint8_t *msgrep;
|
||||
uint8_t cli, i;
|
||||
struct nas_msg_class_list_reply *list;
|
||||
struct nas_msg_class_list_request *msgreq;
|
||||
char addr[45];
|
||||
@@ -646,7 +646,7 @@ int main(int argc, char *argv[]){
|
||||
return -1;
|
||||
}
|
||||
msgreq=(struct nas_msg_class_list_request *)(gifr.msg);
|
||||
msgrep=(u8 *)(gifr.msg);
|
||||
msgrep=(uint8_t *)(gifr.msg);
|
||||
i=3;
|
||||
if (strcmp(argv[i], "send")==0)
|
||||
{
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
//#define GRAAL_STATE_ESTABLISHMENT_FAILURE 3
|
||||
//#define GRAAL_STATE_RELEASE_FAILURE 4
|
||||
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
|
||||
extern int inet_pton(int af, const char *src, void *dst);
|
||||
extern char *inet_ntop(int af, const void *src, char *dst, size_t sise);
|
||||
|
||||
@@ -151,7 +151,7 @@ void nasmt_ASCTL_start_sclassifier(struct cx_entity *cx,struct rb_entity *rb){
|
||||
//---------------------------------------------------------------------------
|
||||
void nasmt_ASCTL_timer(unsigned long data){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
struct cx_entity *cx;
|
||||
struct rb_entity *rb;
|
||||
spin_lock(&gpriv->lock);
|
||||
@@ -231,7 +231,7 @@ void nasmt_ASCTL_timer(unsigned long data){
|
||||
// Request the sleep of a connexion
|
||||
int nasmt_ASCTL_enter_sleep_mode(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 sig_category;
|
||||
uint8_t sig_category;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("nasmt_ASCTL_enter_sleep_mode - begin \n");
|
||||
@@ -253,7 +253,7 @@ int nasmt_ASCTL_enter_sleep_mode(struct cx_entity *cx){
|
||||
// Request to reactivate a connexion
|
||||
int nasmt_ASCTL_leave_sleep_mode(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 sig_category;
|
||||
uint8_t sig_category;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("nasmt_ASCTL_leave_sleep_mode - begin \n");
|
||||
@@ -368,7 +368,7 @@ int nasmt_ASCTL_DC_send_cx_release_request(struct cx_entity *cx){
|
||||
{
|
||||
cx->state=NAS_IDLE;
|
||||
cx->iid4=0;
|
||||
// nasmt_TOOL_imei2iid(NAS_NULL_IMEI, (u8 *)cx->iid6);
|
||||
// nasmt_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)cx->iid6);
|
||||
nasmt_COMMON_flush_rb(cx);
|
||||
nasmt_CLASS_flush_sclassifier(cx);
|
||||
|
||||
@@ -472,10 +472,10 @@ void nasmt_ASCTL_DC_send_sig_data_request(struct sk_buff *skb, struct cx_entity
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Request the transfer of data (DC SAP)
|
||||
void nasmt_ASCTL_DC_send_peer_sig_data_request(struct cx_entity *cx, u8 sig_category){
|
||||
void nasmt_ASCTL_DC_send_peer_sig_data_request(struct cx_entity *cx, uint8_t sig_category){
|
||||
//---------------------------------------------------------------------------
|
||||
struct nas_ue_dc_element *p;
|
||||
u8 nasmt_data[10];
|
||||
uint8_t nasmt_data[10];
|
||||
unsigned int nasmt_length;
|
||||
char data_type = 'Z';
|
||||
int bytes_wrote = 0;
|
||||
@@ -557,7 +557,7 @@ void nasmt_ASCTL_DC_send_peer_sig_data_request(struct cx_entity *cx, u8 sig_cate
|
||||
void nasmt_ASCTL_DC_decode_cx_establish_resp(struct cx_entity *cx, struct nas_ue_dc_element *p){
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
u8 sig_category;
|
||||
uint8_t sig_category;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("nasmt_ASCTL_DC_decode_cx_establish - begin \n");
|
||||
@@ -571,7 +571,7 @@ void nasmt_ASCTL_DC_decode_cx_establish_resp(struct cx_entity *cx, struct nas_ue
|
||||
if (p->nasUEDCPrimitive.conn_establish_resp.status == TERMINATED){
|
||||
cx->state=NAS_CX_DCH; //to be changed to NAS_CX_FACH
|
||||
cx->iid4=1;
|
||||
nasmt_TOOL_imei2iid(NAS_RG_IMEI, (u8 *)cx->iid6);
|
||||
nasmt_TOOL_imei2iid(NAS_RG_IMEI, (uint8_t *)cx->iid6);
|
||||
sig_category = NAS_CMD_OPEN_RB;
|
||||
//For demo, add automatically a radio bearer
|
||||
#ifdef DEMO_3GSM
|
||||
@@ -608,7 +608,7 @@ void nasmt_ASCTL_DC_decode_cx_loss_ind(struct cx_entity *cx, struct nas_ue_dc_el
|
||||
// End debug information
|
||||
cx->state=NAS_IDLE;
|
||||
cx->iid4=0;
|
||||
//nasmt_TOOL_imei2iid(NAS_NULL_IMEI, (u8 *)cx->iid6);
|
||||
//nasmt_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)cx->iid6);
|
||||
nasmt_COMMON_flush_rb(cx);
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk(" nasmt_ASCTL_DC_decode_cx_loss: CONN_LOSS_IND reception\n");
|
||||
@@ -655,12 +655,12 @@ void nasmt_ASCTL_DC_decode_sig_data_ind(struct cx_entity *cx, struct nas_ue_dc_e
|
||||
printk(" Local Connection reference %u\n",p->nasUEDCPrimitive.data_transfer_ind.localConnectionRef);
|
||||
printk(" Signaling Priority %u\n",p->nasUEDCPrimitive.data_transfer_ind.priority);
|
||||
printk(" NAS Data length %u\n",p->nasUEDCPrimitive.data_transfer_ind.nasDataLength);
|
||||
printk(" NAS Data string %s\n", (u8 *)p+p->length);
|
||||
printk(" NAS Data string %s\n", (uint8_t *)p+p->length);
|
||||
#endif
|
||||
|
||||
//nasmt_COMMON_receive(p->length, p->nasUEDCPrimitive.data_transfer_ind.nasDataLength, cx->sap[GRAAL_DC_OUTPUT_SAPI]); // original
|
||||
#ifndef NAS_NETLINK
|
||||
//void nasmt_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer, int rb_id, int sap);
|
||||
//void nasmt_COMMON_receive(uint16_t bytes_read, uint16_t payload_length, void *data_buffer, int rb_id, int sap);
|
||||
// data_buffer is NULL because FIFO should be read directly in the skbuff (LITE has an intermediary buffer)
|
||||
nasmt_COMMON_receive(p->length, p->nasUEDCPrimitive.data_transfer_ind.nasDataLength, NULL, 2, cx->sap[NAS_DC_OUTPUT_SAPI]);
|
||||
#else
|
||||
@@ -718,7 +718,7 @@ void nasmt_ASCTL_DC_decode_rb_establish_ind(struct cx_entity *cx, struct nas_ue_
|
||||
void nasmt_ASCTL_DC_decode_rb_release_ind(struct cx_entity *cx, struct nas_ue_dc_element *p){
|
||||
//---------------------------------------------------------------------------
|
||||
struct rb_entity *rb;
|
||||
u8 dscp;
|
||||
uint8_t dscp;
|
||||
int hard_coded_rbId = 3;
|
||||
|
||||
// Start debug information
|
||||
@@ -752,7 +752,7 @@ void nasmt_ASCTL_DC_decode_rb_release_ind(struct cx_entity *cx, struct nas_ue_dc
|
||||
// Decode MEASUREMENT_IND message from RRC
|
||||
void nasmt_ASCTL_DC_decode_measurement_ind(struct cx_entity *cx, struct nas_ue_dc_element *p){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 i;
|
||||
uint8_t i;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("nasmt_ASCTL_DC_decode_measurement - begin \n");
|
||||
@@ -796,7 +796,7 @@ void nasmt_ASCTL_DC_decode_measurement_ind(struct cx_entity *cx, struct nas_ue_d
|
||||
// Decode MBMS_UE_NOTIFY_IND message from RRC
|
||||
void nasmt_ASCTL_DC_decode_mbms_ue_notify_ind(struct cx_entity *cx, struct nas_ue_dc_element *p){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 i, j, k;
|
||||
uint8_t i, j, k;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("nasmt_ASCTL_DC_decode_mbms_ue_notify - begin \n");
|
||||
@@ -869,7 +869,7 @@ int nasmt_ASCTL_DC_receive(struct cx_entity *cx, char *buffer){
|
||||
#ifndef NAS_NETLINK
|
||||
p= (struct nas_ue_dc_element *)(gpriv->rbuffer);
|
||||
//get the rest of the primitive
|
||||
bytes_read += rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI], (u8 *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
bytes_read += rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
if (bytes_read!=p->length){
|
||||
printk("nasmt_ASCTL_DC_receive: Problem while reading primitive header\n");
|
||||
return bytes_read;
|
||||
@@ -1002,7 +1002,7 @@ int nasmt_ASCTL_GC_receive(char *buffer){
|
||||
#ifndef NAS_NETLINK
|
||||
p= (struct nas_ue_gc_element *)(gpriv->rbuffer);
|
||||
//get the rest of the primitive
|
||||
bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (u8 *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
if (bytes_read!=p->length){
|
||||
printk("nasmt_ASCTL_GC_receive: Problem while reading primitive's header\n");
|
||||
return bytes_read;
|
||||
@@ -1016,7 +1016,7 @@ int nasmt_ASCTL_GC_receive(char *buffer){
|
||||
switch (p->type){
|
||||
case INFO_BROADCAST_IND :
|
||||
#ifndef NAS_NETLINK
|
||||
bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (u8 *)p+p->length, p->nasUEGCPrimitive.broadcast_ind.nasDataLength);
|
||||
bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+p->length, p->nasUEGCPrimitive.broadcast_ind.nasDataLength);
|
||||
if (bytes_read!=p->length+p->nasUEGCPrimitive.broadcast_ind.nasDataLength){
|
||||
printk("nasmt_ASCTL_GC_receive: INFO_BROADCAST_IND reception, Problem while reading primitive's data\n");
|
||||
return bytes_read;
|
||||
@@ -1026,7 +1026,7 @@ int nasmt_ASCTL_GC_receive(char *buffer){
|
||||
printk(" nasmt_ASCTL_GC_receive : INFO_BROADCAST_IND reception\n");
|
||||
printk(" Primitive length %d \n", (int)(p->type));
|
||||
printk(" Data length %u\n", p->nasUEGCPrimitive.broadcast_ind.nasDataLength);
|
||||
printk(" Data string %s\n", (u8 *)p+p->length);
|
||||
printk(" Data string %s\n", (uint8_t *)p+p->length);
|
||||
#endif
|
||||
return bytes_read;
|
||||
default :
|
||||
|
||||
@@ -116,7 +116,7 @@ void nasmt_create_mask_ipv4_addr(struct in_addr *masked_addrP, int prefix_len){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Add a new classifier rule (send direction)
|
||||
struct classifier_entity *nasmt_CLASS_add_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
struct classifier_entity *nasmt_CLASS_add_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *gc;
|
||||
|
||||
@@ -153,7 +153,7 @@ struct classifier_entity *nasmt_CLASS_add_sclassifier(struct cx_entity *cx, u8 d
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Add a new classifier rule (receive direction)
|
||||
struct classifier_entity *nasmt_CLASS_add_rclassifier(u8 dscp, u16 classref){
|
||||
struct classifier_entity *nasmt_CLASS_add_rclassifier(uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *gc;
|
||||
|
||||
@@ -186,7 +186,7 @@ struct classifier_entity *nasmt_CLASS_add_rclassifier(u8 dscp, u16 classref){
|
||||
//---------------------------------------------------------------------------
|
||||
void nasmt_CLASS_flush_sclassifier(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 dscpi;
|
||||
uint8_t dscpi;
|
||||
struct classifier_entity *gc;
|
||||
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -212,7 +212,7 @@ void nasmt_CLASS_flush_sclassifier(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
void nasmt_CLASS_flush_rclassifier(){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 dscpi;
|
||||
uint8_t dscpi;
|
||||
struct classifier_entity *gc;
|
||||
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -235,7 +235,7 @@ void nasmt_CLASS_flush_rclassifier(){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a classifier rule (send direction)
|
||||
void nasmt_CLASS_del_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
void nasmt_CLASS_del_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *p,*np;
|
||||
|
||||
@@ -274,7 +274,7 @@ void nasmt_CLASS_del_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a classifier rule (receive direction)
|
||||
void nasmt_CLASS_del_rclassifier(u8 dscp, u16 classref){
|
||||
void nasmt_CLASS_del_rclassifier(uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *p,*np;
|
||||
|
||||
@@ -310,7 +310,7 @@ void nasmt_CLASS_del_rclassifier(u8 dscp, u16 classref){
|
||||
// Search the entity with the IPv6 address 'addr'
|
||||
struct cx_entity *nasmt_CLASS_cx6(struct sk_buff *skb){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
printk("nasmt_CLASS_cx6: begin\n");
|
||||
#endif
|
||||
@@ -323,10 +323,10 @@ struct cx_entity *nasmt_CLASS_cx6(struct sk_buff *skb){
|
||||
// Navid: the ipv6 classifier is not fully tested
|
||||
struct cx_entity *nasmt_CLASS_cx6(struct sk_buff *skb, unsigned char dscp, int *paddr_type, unsigned char *cx_index) {
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
struct cx_entity *cx = NULL;
|
||||
struct classifier_entity *sclassifier= NULL;
|
||||
u32 mc_addr_hdr;
|
||||
uint32_t mc_addr_hdr;
|
||||
struct in6_addr masked_addr;
|
||||
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -403,7 +403,7 @@ struct cx_entity *nasmt_CLASS_cx6(struct sk_buff *skb, unsigned char dscp, int *
|
||||
// Search the entity with the IPv4 address 'addr'
|
||||
struct cx_entity *nasmt_CLASS_cx4(struct sk_buff *skb){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
printk("nasmt_CLASS_cx4: begin\n");
|
||||
#endif
|
||||
@@ -416,7 +416,7 @@ struct cx_entity *nasmt_CLASS_cx4(struct sk_buff *skb){
|
||||
struct cx_entity *nasmt_CLASS_cx4(struct sk_buff *skb, unsigned char dscp, int *paddr_type, unsigned char *cx_index) {
|
||||
//---------------------------------------------------------------------------
|
||||
unsigned char cxi;
|
||||
u32 daddr;
|
||||
uint32_t daddr;
|
||||
struct cx_entity *cx=NULL;
|
||||
struct classifier_entity *pclassifier=NULL;
|
||||
struct in_addr masked_addr;
|
||||
@@ -473,10 +473,10 @@ struct cx_entity *nasmt_CLASS_cx4(struct sk_buff *skb, unsigned char dscp, int *
|
||||
void nasmt_CLASS_send(struct sk_buff *skb){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *pclassifier, *sp;
|
||||
u8 *protocolh = NULL;
|
||||
u8 version;
|
||||
u8 protocol, dscp;
|
||||
u16 classref;
|
||||
uint8_t *protocolh = NULL;
|
||||
uint8_t version;
|
||||
uint8_t protocol, dscp;
|
||||
uint16_t classref;
|
||||
struct cx_entity *cx;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
char sfct[10], sprotocol[10];
|
||||
|
||||
@@ -43,15 +43,15 @@
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Receive data from FIFO (QOS or DC)
|
||||
//void nasmt_COMMON_receive(u16 hlen, u16 dlen, int sap){
|
||||
//void nasmt_COMMON_receive(u16 hlen, u16 dlen, void *pdcp_sdu, int sap){
|
||||
void nasmt_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer, int rb_id, int sap){
|
||||
//void nasmt_COMMON_receive(uint16_t hlen, uint16_t dlen, int sap){
|
||||
//void nasmt_COMMON_receive(uint16_t hlen, uint16_t dlen, void *pdcp_sdu, int sap){
|
||||
void nasmt_COMMON_receive(uint16_t bytes_read, uint16_t payload_length, void *data_buffer, int rb_id, int sap){
|
||||
//---------------------------------------------------------------------------
|
||||
struct sk_buff *skb;
|
||||
struct ipversion *ipv;
|
||||
unsigned int hard_header_len;
|
||||
u16 *p_ether_type;
|
||||
u16 ether_type;
|
||||
uint16_t *p_ether_type;
|
||||
uint16_t ether_type;
|
||||
|
||||
#ifdef NAS_DEBUG_RECEIVE
|
||||
printk("nasmt_COMMON_receive: begin\n");
|
||||
@@ -142,8 +142,8 @@ void nasmt_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer,
|
||||
printk("nasmt_COMMON_receive: ether_type=%04X\n", ether_type);
|
||||
#endif
|
||||
skb->protocol = eth_type_trans(skb, gdev);
|
||||
// minus 1(short) instead of 2(bytes) because u16*
|
||||
p_ether_type = (u16 *)&(skb->mac_header[hard_header_len-2]);
|
||||
// minus 1(short) instead of 2(bytes) because uint16_t*
|
||||
p_ether_type = (uint16_t *)&(skb->mac_header[hard_header_len-2]);
|
||||
ether_type = ntohs(*p_ether_type);
|
||||
#ifdef NAS_DEBUG_RECEIVE
|
||||
printk("nasmt_COMMON_receive: ether_type=%04X\n", ether_type);
|
||||
@@ -268,7 +268,7 @@ void nasmt_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct cla
|
||||
//---------------------------------------------------------------------------
|
||||
void nasmt_COMMON_QOS_receive(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 sapi;
|
||||
uint8_t sapi;
|
||||
//struct pdcp_data_ind pdcph;
|
||||
struct pdcp_data_ind_header_t pdcph;
|
||||
int bytes_read = 0;
|
||||
@@ -292,7 +292,7 @@ void nasmt_COMMON_QOS_receive(struct cx_entity *cx){
|
||||
printk("nasmt_COMMON_QOS_receive: problem while reading PDCP header\n");
|
||||
return;
|
||||
}
|
||||
//void nasmt_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer, int rb_id, int sap);
|
||||
//void nasmt_COMMON_receive(uint16_t bytes_read, uint16_t payload_length, void *data_buffer, int rb_id, int sap);
|
||||
// data_buffer is NULL because FIFO should be read directly in the skbuff (LITE has an intermediary buffer)
|
||||
nasmt_COMMON_receive(NAS_PDCPH_SIZE, pdcph.data_size, NULL, pdcph->rb_id, gpriv->sap[sapi]);
|
||||
// check if another frame is in the FIFO, otherwise return
|
||||
@@ -325,7 +325,7 @@ void nasmt_COMMON_QOS_receive(struct nlmsghdr *nlh){
|
||||
printk("nasmt_COMMON_QOS_receive - receive from PDCP, size %d, rab %d\\n", pdcph->data_size, pdcph->rb_id);
|
||||
#endif //NAS_DEBUG_RECEIVE
|
||||
|
||||
//void nasmt_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer, int rb_id, int sap);
|
||||
//void nasmt_COMMON_receive(uint16_t bytes_read, uint16_t payload_length, void *data_buffer, int rb_id, int sap);
|
||||
nasmt_COMMON_receive(NAS_PDCPH_SIZE + pdcph->data_size, pdcph->data_size, (unsigned char *)NLMSG_DATA(nlh) + NAS_PDCPH_SIZE, pdcph->rb_id, 0);
|
||||
|
||||
}
|
||||
@@ -411,7 +411,7 @@ void nasmt_COMMON_del_rb(struct cx_entity *cx, nasRadioBearerId_t rab_id, nasIPd
|
||||
//---------------------------------------------------------------------------
|
||||
struct rb_entity *rb, *curr_rb, *prev_rb;
|
||||
struct classifier_entity *p;
|
||||
u16 classref=0;
|
||||
uint16_t classref=0;
|
||||
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -467,7 +467,7 @@ void nasmt_COMMON_flush_rb(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
struct rb_entity *rb;
|
||||
struct classifier_entity *gc;
|
||||
u8 dscp;
|
||||
uint8_t dscp;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
printk("nasmt_COMMON_flush_rb - begin\n");
|
||||
|
||||
@@ -71,11 +71,11 @@ struct net_device *gdev;
|
||||
struct nas_priv *gpriv;
|
||||
//int bytes_wrote;
|
||||
//int bytes_read;
|
||||
u8 NAS_NULL_IMEI[14]={0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00};
|
||||
u8 NAS_RG_IMEI[14]={0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x01};
|
||||
uint8_t NAS_NULL_IMEI[14]={0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00};
|
||||
uint8_t NAS_RG_IMEI[14]={0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x01};
|
||||
|
||||
// TEMP
|
||||
//u8 nas_IMEI[14];
|
||||
//uint8_t nas_IMEI[14];
|
||||
static unsigned char nas_IMEI[14];
|
||||
static int m_arg=0;
|
||||
|
||||
@@ -92,7 +92,7 @@ extern void nasmt_ASCTL_timer(unsigned long data);
|
||||
//void nasmt_interrupt(void){
|
||||
void *nasmt_interrupt(void){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
char *buffer = NULL;
|
||||
#ifdef NAS_DEBUG_INTERRUPT
|
||||
printk("nasmt_interrupt - begin\n");
|
||||
@@ -326,7 +326,7 @@ static const struct net_device_ops nasmt_netdev_ops = {
|
||||
// Initialisation of the network device
|
||||
void nasmt_init(struct net_device *dev){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi, dscpi;
|
||||
uint8_t cxi, dscpi;
|
||||
|
||||
printk("nasmt_init: begin\n");
|
||||
|
||||
@@ -400,17 +400,17 @@ void nasmt_init(struct net_device *dev){
|
||||
}
|
||||
gpriv->cx[cxi].nsclassifier=0;
|
||||
// initialisation of the IP address
|
||||
nasmt_TOOL_imei2iid(NAS_NULL_IMEI, (u8 *)gpriv->cx[cxi].iid6);
|
||||
nasmt_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)gpriv->cx[cxi].iid6);
|
||||
gpriv->cx[cxi].iid4=0;
|
||||
//
|
||||
spin_lock_init(&gpriv->lock);
|
||||
printk("nasmt_init: init IMEI to IID\n");
|
||||
|
||||
#ifdef NAS_DRIVER_TYPE_ETHERNET
|
||||
nasmt_TOOL_eth_imei2iid(nas_IMEI, dev->dev_addr ,(u8 *)gpriv->cx[0].iid6, dev->addr_len);
|
||||
nasmt_TOOL_eth_imei2iid(nas_IMEI, dev->dev_addr ,(uint8_t *)gpriv->cx[0].iid6, dev->addr_len);
|
||||
#else
|
||||
nasmt_TOOL_imei2iid(nas_IMEI, dev->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
|
||||
nasmt_TOOL_imei2iid(nas_IMEI, (u8 *)gpriv->cx[0].iid6);
|
||||
nasmt_TOOL_imei2iid(nas_IMEI, (uint8_t *)gpriv->cx[0].iid6);
|
||||
#endif
|
||||
|
||||
nasmt_ASCTL_init();
|
||||
|
||||
@@ -75,7 +75,7 @@ int nasmt_ioCTL_statistic_request(struct nas_ioctl *gifr){
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Connections List
|
||||
//---------------------------------------------------------------------------
|
||||
void nasmt_set_msg_cx_list_reply(u8 *msgrep){
|
||||
void nasmt_set_msg_cx_list_reply(uint8_t *msgrep){
|
||||
//---------------------------------------------------------------------------
|
||||
struct cx_entity *cx;
|
||||
nasLocalConnectionRef_t lcr;
|
||||
@@ -100,7 +100,7 @@ void nasmt_set_msg_cx_list_reply(u8 *msgrep){
|
||||
//---------------------------------------------------------------------------
|
||||
int nasmt_ioCTL_cx_list_request(struct nas_ioctl *gifr){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 msgrep[NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1];
|
||||
uint8_t msgrep[NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1];
|
||||
printk("nasmt_ioCTL_cx_list: connection list requested\n");
|
||||
nasmt_set_msg_cx_list_reply(msgrep);
|
||||
if (copy_to_user(gifr->msg, msgrep, NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1))
|
||||
@@ -202,13 +202,13 @@ int nasmt_ioCTL_cx_release_request(struct nas_ioctl *gifr){
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Radio Bearer List
|
||||
//---------------------------------------------------------------------------
|
||||
void nasmt_set_msg_rb_list_reply(u8 *msgrep, struct nas_msg_rb_list_request *msgreq){
|
||||
void nasmt_set_msg_rb_list_reply(uint8_t *msgrep, struct nas_msg_rb_list_request *msgreq){
|
||||
//---------------------------------------------------------------------------
|
||||
struct cx_entity *cx;
|
||||
cx=nasmt_COMMON_search_cx(msgreq->lcr);
|
||||
if (cx!=NULL)
|
||||
{
|
||||
u8 rbi;
|
||||
uint8_t rbi;
|
||||
struct rb_entity *rb;
|
||||
struct nas_msg_rb_list_reply *list;
|
||||
if (cx->num_rb > NAS_LIST_RB_MAX)
|
||||
@@ -231,7 +231,7 @@ void nasmt_set_msg_rb_list_reply(u8 *msgrep, struct nas_msg_rb_list_request *msg
|
||||
//---------------------------------------------------------------------------
|
||||
int nasmt_ioCTL_rb_list_request(struct nas_ioctl *gifr){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 msgrep[NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1];
|
||||
uint8_t msgrep[NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1];
|
||||
struct nas_msg_rb_list_request msgreq;
|
||||
printk("nasmt_ioCTL_rb_list: Radio Bearer list requested\n");
|
||||
if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq)))
|
||||
@@ -308,12 +308,12 @@ int nasmt_ioCTL_rb_release_request(struct nas_ioctl *gifr){
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Classifier List
|
||||
//---------------------------------------------------------------------------
|
||||
void nasmt_set_msg_class_list_reply(u8 *msgrep, struct nas_msg_class_list_request *msgreq){
|
||||
void nasmt_set_msg_class_list_reply(uint8_t *msgrep, struct nas_msg_class_list_request *msgreq){
|
||||
//---------------------------------------------------------------------------
|
||||
struct cx_entity *cx;
|
||||
struct classifier_entity *gc;
|
||||
struct nas_msg_class_list_reply *list;
|
||||
u8 cli;
|
||||
uint8_t cli;
|
||||
list=(struct nas_msg_class_list_reply *)(msgrep+1);
|
||||
switch(msgreq->dir)
|
||||
{
|
||||
@@ -366,7 +366,7 @@ void nasmt_set_msg_class_list_reply(u8 *msgrep, struct nas_msg_class_list_reques
|
||||
//---------------------------------------------------------------------------
|
||||
int nasmt_ioCTL_class_list_request(struct nas_ioctl *gifr){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 msgrep[NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1];
|
||||
uint8_t msgrep[NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1];
|
||||
struct nas_msg_class_list_request msgreq;
|
||||
printk("nasmt_ioCTL_class_list: classifier list requested\n");
|
||||
if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq)))
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
#define NAS_LIST_RB_MAX 32
|
||||
#define NAS_LIST_CLASS_MAX 32
|
||||
|
||||
typedef u16 nasMsgType_t;
|
||||
typedef uint16_t nasMsgType_t;
|
||||
|
||||
struct nas_ioctl
|
||||
{
|
||||
@@ -87,25 +87,25 @@ struct nas_ioctl
|
||||
|
||||
struct nas_msg_statistic_reply
|
||||
{
|
||||
u32 rx_packets;
|
||||
u32 tx_packets;
|
||||
u32 rx_bytes;
|
||||
u32 tx_bytes;
|
||||
u32 rx_errors;
|
||||
u32 tx_errors;
|
||||
u32 rx_dropped;
|
||||
u32 tx_dropped;
|
||||
uint32_t rx_packets;
|
||||
uint32_t tx_packets;
|
||||
uint32_t rx_bytes;
|
||||
uint32_t tx_bytes;
|
||||
uint32_t rx_errors;
|
||||
uint32_t tx_errors;
|
||||
uint32_t rx_dropped;
|
||||
uint32_t tx_dropped;
|
||||
};
|
||||
|
||||
struct nas_msg_cx_list_reply
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
u8 state;
|
||||
uint8_t state;
|
||||
nasCellID_t cellid; // cell identification
|
||||
u32 iid6[2]; // IPv6 interface identification
|
||||
u8 iid4; // IPv4 interface identification
|
||||
u16 num_rb;
|
||||
u16 nsclassifier;
|
||||
uint32_t iid6[2]; // IPv6 interface identification
|
||||
uint8_t iid4; // IPv4 interface identification
|
||||
uint16_t num_rb;
|
||||
uint16_t nsclassifier;
|
||||
};
|
||||
struct nas_msg_cx_establishment_reply
|
||||
{
|
||||
@@ -130,7 +130,7 @@ struct nas_msg_rb_list_reply
|
||||
nasRadioBearerId_t rab_id;
|
||||
nasSapId_t sapi;
|
||||
nasQoSTrafficClass_t qos;
|
||||
u8 state;
|
||||
uint8_t state;
|
||||
};
|
||||
struct nas_msg_rb_list_request
|
||||
{
|
||||
@@ -161,26 +161,26 @@ struct nas_msg_class_add_request
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
nasRadioBearerId_t rab_id;
|
||||
u8 dir; // direction (send or receive)
|
||||
u8 dscp; // codepoint
|
||||
u8 fct;
|
||||
u16 classref;
|
||||
u8 version;
|
||||
uint8_t dir; // direction (send or receive)
|
||||
uint8_t dscp; // codepoint
|
||||
uint8_t fct;
|
||||
uint16_t classref;
|
||||
uint8_t version;
|
||||
union
|
||||
{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
} saddr; // IP source address
|
||||
u8 splen; // prefix length
|
||||
uint8_t splen; // prefix length
|
||||
union
|
||||
{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
} daddr; // IP destination address
|
||||
u8 dplen; // prefix length
|
||||
u8 protocol; // high layer protocol type
|
||||
u16 sport; // source port
|
||||
u16 dport; // destination port
|
||||
uint8_t dplen; // prefix length
|
||||
uint8_t protocol; // high layer protocol type
|
||||
uint16_t sport; // source port
|
||||
uint16_t dport; // destination port
|
||||
};
|
||||
struct nas_msg_class_add_reply
|
||||
{
|
||||
@@ -189,9 +189,9 @@ struct nas_msg_class_add_reply
|
||||
struct nas_msg_class_del_request
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
u8 dir; // direction (send or receive)
|
||||
u8 dscp; // codepoint
|
||||
u16 classref;
|
||||
uint8_t dir; // direction (send or receive)
|
||||
uint8_t dscp; // codepoint
|
||||
uint16_t classref;
|
||||
};
|
||||
struct nas_msg_class_del_reply
|
||||
{
|
||||
@@ -201,14 +201,14 @@ struct nas_msg_class_del_reply
|
||||
struct nas_msg_class_list_request
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
u8 dir;
|
||||
u8 dscp;
|
||||
uint8_t dir;
|
||||
uint8_t dscp;
|
||||
};
|
||||
|
||||
|
||||
// Messages for Measurement transfer - MW 01/04/2005
|
||||
typedef u32 nioctlProviderId_t;
|
||||
typedef u16 nioctlSignalLoss_t;
|
||||
typedef uint32_t nioctlProviderId_t;
|
||||
typedef uint16_t nioctlSignalLoss_t;
|
||||
typedef struct nioctlMeasures {
|
||||
nasCellID_t cell_id;
|
||||
nasSigLevel_t level;
|
||||
@@ -219,7 +219,7 @@ struct nas_msg_measure_request
|
||||
{
|
||||
nasNumRGsMeas_t num_cells;
|
||||
nasCellID_t cellid[MAX_MEASURE_NB]; // Cell identification
|
||||
u16 num_providers;
|
||||
uint16_t num_providers;
|
||||
nioctlProviderId_t provider_id[MAX_MEASURE_NB]; // Provider identification
|
||||
};
|
||||
struct nas_msg_measure_reply
|
||||
@@ -230,7 +230,7 @@ struct nas_msg_measure_reply
|
||||
};
|
||||
|
||||
// Messages for L2Id transfer - MW
|
||||
typedef u32 nioctlL2Id_t[2];
|
||||
typedef uint32_t nioctlL2Id_t[2];
|
||||
|
||||
struct nas_msg_l2id_reply
|
||||
{
|
||||
|
||||
@@ -83,7 +83,7 @@ static void nasmt_rrcnl_data_ready (struct sk_buff *skb){
|
||||
//---------------------------------------------------------------------------
|
||||
struct nlmsghdr *nlh = NULL;
|
||||
char target_sap;
|
||||
u8 cxi = 0;
|
||||
uint8_t cxi = 0;
|
||||
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_RRCNL
|
||||
|
||||
@@ -66,8 +66,8 @@ int nasmt_netlink_init(void);
|
||||
int nasmt_netlink_send(unsigned char *data_buffer, unsigned int data_length, int destination);
|
||||
|
||||
// nasmt_common.c
|
||||
//void nasmt_COMMON_receive(u16 hlen, u16 dlength, int sap);
|
||||
void nasmt_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer, int rb_id, int sap);
|
||||
//void nasmt_COMMON_receive(uint16_t hlen, uint16_t dlength, int sap);
|
||||
void nasmt_COMMON_receive(uint16_t bytes_read, uint16_t payload_length, void *data_buffer, int rb_id, int sap);
|
||||
|
||||
void nasmt_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc);
|
||||
void nasmt_COMMON_del_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc);
|
||||
@@ -91,7 +91,7 @@ int nasmt_ASCTL_GC_receive(char *buffer);
|
||||
int nasmt_ASCTL_DC_send_cx_establish_request(struct cx_entity *cx);
|
||||
int nasmt_ASCTL_DC_send_cx_release_request(struct cx_entity *cx);
|
||||
void nasmt_ASCTL_DC_send_sig_data_request(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc);
|
||||
void nasmt_ASCTL_DC_send_peer_sig_data_request(struct cx_entity *cx, u8 sig_category);
|
||||
void nasmt_ASCTL_DC_send_peer_sig_data_request(struct cx_entity *cx, uint8_t sig_category);
|
||||
int nasmt_ASCTL_leave_sleep_mode(struct cx_entity *cx);
|
||||
int nasmt_ASCTL_enter_sleep_mode(struct cx_entity *cx);
|
||||
|
||||
@@ -101,27 +101,27 @@ int nasmt_CTL_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
|
||||
|
||||
// nasmt_classifier.c
|
||||
void nasmt_CLASS_send(struct sk_buff *skb);
|
||||
struct classifier_entity *nasmt_CLASS_add_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref);
|
||||
struct classifier_entity *nasmt_CLASS_add_rclassifier(u8 dscp, u16 classref);
|
||||
void nasmt_CLASS_del_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref);
|
||||
void nasmt_CLASS_del_rclassifier(u8 dscp, u16 classref);
|
||||
struct classifier_entity *nasmt_CLASS_add_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref);
|
||||
struct classifier_entity *nasmt_CLASS_add_rclassifier(uint8_t dscp, uint16_t classref);
|
||||
void nasmt_CLASS_del_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref);
|
||||
void nasmt_CLASS_del_rclassifier(uint8_t dscp, uint16_t classref);
|
||||
void nasmt_CLASS_flush_sclassifier(struct cx_entity *cx);
|
||||
void nasmt_CLASS_flush_rclassifier(void);
|
||||
|
||||
// nasmt_tool.c
|
||||
u8 nasmt_TOOL_invfct(struct classifier_entity *gc);
|
||||
void nasmt_TOOL_fct(struct classifier_entity *gc, u8 fct);
|
||||
void nasmt_TOOL_imei2iid(u8 *imei, u8 *iid);
|
||||
uint8_t nasmt_TOOL_invfct(struct classifier_entity *gc);
|
||||
void nasmt_TOOL_fct(struct classifier_entity *gc, uint8_t fct);
|
||||
void nasmt_TOOL_imei2iid(uint8_t *imei, uint8_t *iid);
|
||||
|
||||
void nasmt_TOOL_eth_imei2iid(unsigned char *imei, unsigned char *addr ,unsigned char *iid, unsigned char len);
|
||||
u8 nasmt_TOOL_get_dscp6(struct ipv6hdr *iph);
|
||||
u8 nasmt_TOOL_get_dscp4(struct iphdr *iph);
|
||||
u8 *nasmt_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol);
|
||||
u8 *nasmt_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol);
|
||||
uint8_t nasmt_TOOL_get_dscp6(struct ipv6hdr *iph);
|
||||
uint8_t nasmt_TOOL_get_dscp4(struct iphdr *iph);
|
||||
uint8_t *nasmt_TOOL_get_protocol6(struct ipv6hdr *iph, uint8_t *protocol);
|
||||
uint8_t *nasmt_TOOL_get_protocol4(struct iphdr *iph, uint8_t *protocol);
|
||||
|
||||
void nasmt_TOOL_pk_icmp6(struct icmp6hdr *icmph);
|
||||
|
||||
void nasmt_TOOL_print_state(u8 state);
|
||||
void nasmt_TOOL_print_state(uint8_t state);
|
||||
void nasmt_TOOL_print_buffer(unsigned char * buffer,int length);
|
||||
void nasmt_TOOL_print_rb_entity(struct rb_entity *rb);
|
||||
void nasmt_TOOL_print_classifier(struct classifier_entity *gc);
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
void nasmt_TOOL_fct(struct classifier_entity *gc, u8 fct){
|
||||
void nasmt_TOOL_fct(struct classifier_entity *gc, uint8_t fct){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -72,7 +72,7 @@ void nasmt_TOOL_fct(struct classifier_entity *gc, u8 fct){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nasmt_TOOL_invfct(struct classifier_entity *gc){
|
||||
uint8_t nasmt_TOOL_invfct(struct classifier_entity *gc){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -95,7 +95,7 @@ u8 nasmt_TOOL_invfct(struct classifier_entity *gc){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nasmt_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
uint8_t nasmt_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -111,7 +111,7 @@ u8 nasmt_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nasmt_TOOL_get_dscp4(struct iphdr *iph){
|
||||
uint8_t nasmt_TOOL_get_dscp4(struct iphdr *iph){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -127,9 +127,9 @@ u8 nasmt_TOOL_get_dscp4(struct iphdr *iph){
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 *nasmt_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
uint8_t *nasmt_TOOL_get_protocol6(struct ipv6hdr *iph, uint8_t *protocol){
|
||||
//---------------------------------------------------------------------------
|
||||
u16 size;
|
||||
uint16_t size;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
printk("nasmt_TOOL_get_protocol6 - begin \n");
|
||||
@@ -152,16 +152,16 @@ u8 *nasmt_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
case IPPROTO_UDP:
|
||||
case IPPROTO_TCP:
|
||||
case IPPROTO_ICMPV6:
|
||||
return (u8 *)((u8 *)iph+size);
|
||||
return (uint8_t *)((uint8_t *)iph+size);
|
||||
case IPPROTO_HOPOPTS:
|
||||
case IPPROTO_ROUTING:
|
||||
case IPPROTO_DSTOPTS:
|
||||
*protocol=((u8 *)iph+size)[0];
|
||||
size+=((u8 *)iph+size)[1]*8+8;
|
||||
*protocol=((uint8_t *)iph+size)[0];
|
||||
size+=((uint8_t *)iph+size)[1]*8+8;
|
||||
break;
|
||||
case IPPROTO_FRAGMENT:
|
||||
*protocol=((u8 *)iph+size)[0];
|
||||
size+=((u8 *)iph+size)[1]+8;
|
||||
*protocol=((uint8_t *)iph+size)[0];
|
||||
size+=((uint8_t *)iph+size)[1]+8;
|
||||
break;
|
||||
case IPPROTO_NONE:
|
||||
case IPPROTO_AH:
|
||||
@@ -173,7 +173,7 @@ u8 *nasmt_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 *nasmt_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
uint8_t *nasmt_TOOL_get_protocol4(struct iphdr *iph, uint8_t *protocol){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -193,7 +193,7 @@ u8 *nasmt_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
case IPPROTO_UDP:
|
||||
case IPPROTO_TCP:
|
||||
case IPPROTO_ICMP:
|
||||
return (u8 *)((u8 *)iph+iph->tot_len);
|
||||
return (uint8_t *)((uint8_t *)iph+iph->tot_len);
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@@ -201,7 +201,7 @@ u8 *nasmt_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Convert the IMEI to iid
|
||||
void nasmt_TOOL_imei2iid(u8 *imei, u8 *iid){
|
||||
void nasmt_TOOL_imei2iid(uint8_t *imei, uint8_t *iid){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -293,7 +293,7 @@ void nasmt_TOOL_pk_icmp6(struct icmp6hdr *icmph){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
void nasmt_TOOL_print_state(u8 state){
|
||||
void nasmt_TOOL_print_state(uint8_t state){
|
||||
//---------------------------------------------------------------------------
|
||||
switch(state){
|
||||
case NAS_IDLE:printk("NAS_IDLE\n");return;
|
||||
|
||||
@@ -66,35 +66,35 @@ struct cx_entity;
|
||||
|
||||
struct rb_entity
|
||||
{
|
||||
u32 cnxid;
|
||||
uint32_t cnxid;
|
||||
nasRadioBearerId_t rab_id; //ue_rbId
|
||||
nasSapId_t sapi;
|
||||
nasQoSTrafficClass_t qos;
|
||||
nasQoSTrafficClass_t RadioQosClass;
|
||||
nasIPdscp_t dscp;
|
||||
u8 state;
|
||||
u8 result;
|
||||
u8 retry;
|
||||
u32 countimer;
|
||||
uint8_t state;
|
||||
uint8_t result;
|
||||
uint8_t retry;
|
||||
uint32_t countimer;
|
||||
struct rb_entity *next;
|
||||
};
|
||||
|
||||
struct classifier_entity{
|
||||
u32 classref; // classifier identity
|
||||
u8 version; // IP version 4 or 6
|
||||
uint32_t classref; // classifier identity
|
||||
uint8_t version; // IP version 4 or 6
|
||||
union{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
} saddr; // IP source address
|
||||
u8 splen; // IP prefix size
|
||||
uint8_t splen; // IP prefix size
|
||||
union{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
} daddr; // IP destination address
|
||||
u8 dplen; // IP prefix size
|
||||
u8 protocol; // layer 4 protocol type (tcp, udp, ...)
|
||||
u16 sport; // source port
|
||||
u16 dport; // destination port
|
||||
uint8_t dplen; // IP prefix size
|
||||
uint8_t protocol; // layer 4 protocol type (tcp, udp, ...)
|
||||
uint16_t sport; // source port
|
||||
uint16_t dport; // destination port
|
||||
struct rb_entity *rb;
|
||||
nasRadioBearerId_t rab_id; // RAB identification
|
||||
void (*fct)(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc);
|
||||
@@ -104,17 +104,17 @@ struct classifier_entity{
|
||||
|
||||
struct cx_entity{
|
||||
int sap[NAS_SAPI_CX_MAX];
|
||||
u8 state; // state of the connection
|
||||
uint8_t state; // state of the connection
|
||||
nasLocalConnectionRef_t lcr; // Local connection reference
|
||||
nasCellID_t cellid; // cell identification
|
||||
u32 countimer; // timeout's counter
|
||||
u8 retry; // number of retransmissions
|
||||
uint32_t countimer; // timeout's counter
|
||||
uint8_t retry; // number of retransmissions
|
||||
struct classifier_entity *sclassifier[NAS_DSCP_MAX]; // send classifiers table
|
||||
u16 nsclassifier;
|
||||
u32 iid6[2]; // IPv6 interface identification
|
||||
u8 iid4; // IPv4 interface identification
|
||||
uint16_t nsclassifier;
|
||||
uint32_t iid6[2]; // IPv6 interface identification
|
||||
uint8_t iid4; // IPv4 interface identification
|
||||
struct rb_entity *rb;
|
||||
u16 num_rb;
|
||||
uint16_t num_rb;
|
||||
//measures
|
||||
int req_prov_id[MAX_MEASURE_NB];
|
||||
int num_measures;
|
||||
@@ -132,24 +132,24 @@ struct nas_priv{
|
||||
struct timer_list timer;
|
||||
spinlock_t lock;
|
||||
struct net_device_stats stats;
|
||||
u8 retry_limit;
|
||||
u32 timer_establishment;
|
||||
u32 timer_release;
|
||||
uint8_t retry_limit;
|
||||
uint32_t timer_establishment;
|
||||
uint32_t timer_release;
|
||||
struct cx_entity cx[NAS_CX_MAX];
|
||||
struct classifier_entity *rclassifier[NAS_DSCP_MAX]; // receive classifier
|
||||
u16 nrclassifier;
|
||||
u32 next_sclassref;
|
||||
uint16_t nrclassifier;
|
||||
uint32_t next_sclassref;
|
||||
int sap[NAS_SAPI_MAX];
|
||||
u8 xbuffer[NAS_MAX_LENGTH]; // transmission buffer
|
||||
u8 rbuffer[NAS_MAX_LENGTH]; // reception buffer
|
||||
uint8_t xbuffer[NAS_MAX_LENGTH]; // transmission buffer
|
||||
uint8_t rbuffer[NAS_MAX_LENGTH]; // reception buffer
|
||||
};
|
||||
|
||||
struct ipversion {
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
u8 reserved:4,
|
||||
uint8_t reserved:4,
|
||||
version:4;
|
||||
#else
|
||||
u8 version:4,
|
||||
uint8_t version:4,
|
||||
reserved:4;
|
||||
#endif
|
||||
};
|
||||
@@ -172,10 +172,10 @@ extern struct net_device *gdev;
|
||||
//extern int bytes_wrote;
|
||||
//extern int bytes_read;
|
||||
|
||||
extern u8 NAS_NULL_IMEI[14];
|
||||
extern u8 NAS_RG_IMEI[14];
|
||||
extern uint8_t NAS_NULL_IMEI[14];
|
||||
extern uint8_t NAS_RG_IMEI[14];
|
||||
|
||||
//global variables shared with RRC
|
||||
extern int *pt_nas_ue_irq;
|
||||
//extern u8 nas_IMEI[14];
|
||||
//extern uint8_t nas_IMEI[14];
|
||||
#endif
|
||||
|
||||
@@ -292,7 +292,7 @@ void nasrg_ASCTL_start_default_mbms_service(void){
|
||||
//---------------------------------------------------------------------------
|
||||
void nasrg_ASCTL_timer(unsigned long data){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
struct cx_entity *cx;
|
||||
struct rb_entity *rb;
|
||||
spin_lock(&gpriv->lock);
|
||||
@@ -361,7 +361,7 @@ void nasrg_ASCTL_timer(unsigned long data){
|
||||
***************************************************************************/
|
||||
//---------------------------------------------------------------------------
|
||||
// Encode INFO_BROADCAST_REQ message
|
||||
int nasrg_ASCTL_GC_send_broadcast_request(u8 category){
|
||||
int nasrg_ASCTL_GC_send_broadcast_request(uint8_t category){
|
||||
//---------------------------------------------------------------------------
|
||||
char *xmit_data = "TESTING BROADCASTING ROUTER ADVERTISEMENT. TESTING BROADCASTING ROUTER ADVERTISEMENT. BROADCASTING ROUTER.\0";
|
||||
int bytes_wrote = 0;
|
||||
@@ -530,7 +530,7 @@ int nasrg_ASCTL_GC_send_mbms_bearer_establish_req(int mbms_ix ){
|
||||
int nasrg_ASCTL_GC_send_mbms_bearer_release_req(int mbms_ix){
|
||||
//-----------------------------------------------------------------------------
|
||||
struct nas_rg_gc_element *p;
|
||||
u16 classref=0;
|
||||
uint16_t classref=0;
|
||||
int bytes_wrote = 0;
|
||||
|
||||
p= (struct nas_rg_gc_element *)(gpriv->xbuffer);
|
||||
@@ -564,7 +564,7 @@ int nasrg_ASCTL_GC_send_mbms_bearer_release_req(int mbms_ix){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Confirm the establishment of a connection (DC channel)
|
||||
int nasrg_ASCTL_DC_send_cx_establish_confirm(struct cx_entity *cx, u8 response){
|
||||
int nasrg_ASCTL_DC_send_cx_establish_confirm(struct cx_entity *cx, uint8_t response){
|
||||
//---------------------------------------------------------------------------
|
||||
struct nas_rg_dc_element *p;
|
||||
int bytes_wrote = 0;
|
||||
@@ -861,7 +861,7 @@ void nasrg_ASCTL_DC_decode_cx_establish_ind(struct cx_entity *cx, struct nas_rg_
|
||||
}
|
||||
// End debug information
|
||||
if (nasrg_ASCTL_DC_send_cx_establish_confirm(cx, ACCEPTED)>0){
|
||||
nasrg_TOOL_imei2iid(p->nasRGDCPrimitive.conn_establish_ind.InterfaceIMEI, (u8 *)cx->iid6);
|
||||
nasrg_TOOL_imei2iid(p->nasRGDCPrimitive.conn_establish_ind.InterfaceIMEI, (uint8_t *)cx->iid6);
|
||||
cx->iid4=97; // A AUTOMATISER
|
||||
cx->lcr = p->nasRGDCPrimitive.conn_establish_ind.localConnectionRef;
|
||||
cx->state=NAS_CX_DCH;
|
||||
@@ -893,7 +893,7 @@ void nasrg_ASCTL_DC_decode_cx_release_ind(struct cx_entity *cx, struct nas_rg_dc
|
||||
// End debug information
|
||||
cx->state=NAS_IDLE;
|
||||
cx->iid4=0;
|
||||
nasrg_TOOL_imei2iid(NAS_NULL_IMEI, (u8 *)cx->iid6);
|
||||
nasrg_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)cx->iid6);
|
||||
nasrg_COMMON_flush_rb(cx);
|
||||
nasrg_CLASS_flush_sclassifier(cx);
|
||||
#ifdef NAS_DEBUG_DC
|
||||
@@ -920,7 +920,7 @@ void nasrg_ASCTL_DC_decode_cx_loss_ind(struct cx_entity *cx, struct nas_rg_dc_el
|
||||
// End debug information
|
||||
cx->state = NAS_IDLE;
|
||||
cx->iid4=0;
|
||||
nasrg_TOOL_imei2iid(NAS_NULL_IMEI, (u8 *)cx->iid6);
|
||||
nasrg_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)cx->iid6);
|
||||
nasrg_COMMON_flush_rb(cx);
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("nasrg_ASCTL_DC_decode_cx_loss: CONN_LOSS_IND reception\n");
|
||||
@@ -985,7 +985,7 @@ void nasrg_ASCTL_DC_decode_rb_establish_cnf(struct cx_entity *cx, struct nas_rg_
|
||||
// Decode DATA_TRANSFER_IND message from RRC
|
||||
void nasrg_ASCTL_DC_decode_data_transfer_ind(struct cx_entity *cx, struct nas_rg_dc_element *p, char *buffer){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nasrg_data[10];
|
||||
uint8_t nasrg_data[10];
|
||||
unsigned int nas_length;
|
||||
char data_type;
|
||||
int bytes_read=0;
|
||||
@@ -1016,7 +1016,7 @@ void nasrg_ASCTL_DC_decode_data_transfer_ind(struct cx_entity *cx, struct nas_rg
|
||||
// receive in a skbuff
|
||||
//nasrg_COMMON_receive((p->length) + 1, nas_length, cx->sap[NAS_DC_OUTPUT_SAPI]); // original
|
||||
#ifndef NAS_NETLINK
|
||||
//void nasrg_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer, int rb_id, int sap);
|
||||
//void nasrg_COMMON_receive(uint16_t bytes_read, uint16_t payload_length, void *data_buffer, int rb_id, int sap);
|
||||
// data_buffer is NULL because FIFO should be read directly in the skbuff (LITE has an intermediary buffer)
|
||||
nasrg_COMMON_receive((p->length) + 1, nas_length, NULL, 2, cx->sap[NAS_DC_OUTPUT_SAPI]);
|
||||
#else
|
||||
@@ -1170,7 +1170,7 @@ void nasrg_ASCTL_DC_decode_mbms_ue_notify_cnf(struct cx_entity *cx, struct nas_r
|
||||
// Decode ENB_MEASUREMENT_IND message from RRC
|
||||
void nasrg_ASCTL_DC_decode_eNBmeasurement_ind(struct nas_rg_dc_element *p){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 i;
|
||||
uint8_t i;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("nasrg_ASCTL_DC_decode_eNBmeasurement_ind - begin \n");
|
||||
@@ -1230,7 +1230,7 @@ int nasrg_ASCTL_DC_receive(struct cx_entity *cx, char *buffer){
|
||||
#ifndef NAS_NETLINK
|
||||
p= (struct nas_rg_dc_element *)(gpriv->rbuffer);
|
||||
//get the rest of the primitive
|
||||
bytes_read += rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI], (u8 *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
bytes_read += rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
if (bytes_read!=p->length){
|
||||
printk("nasrg_ASCTL_DC_receive: Problem while reading primitive's header\n");
|
||||
return bytes_read;
|
||||
|
||||
@@ -122,7 +122,7 @@ void nasrg_create_mask_ipv4_addr(struct in_addr *masked_addrP, int prefix_len){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Add a new classifier rule (send direction)
|
||||
struct classifier_entity *nasrg_CLASS_add_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
struct classifier_entity *nasrg_CLASS_add_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *gc;
|
||||
|
||||
@@ -159,7 +159,7 @@ struct classifier_entity *nasrg_CLASS_add_sclassifier(struct cx_entity *cx, u8 d
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Add a new classifier rule (receive direction)
|
||||
struct classifier_entity *nasrg_CLASS_add_rclassifier(u8 dscp, u16 classref){
|
||||
struct classifier_entity *nasrg_CLASS_add_rclassifier(uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *gc;
|
||||
|
||||
@@ -191,7 +191,7 @@ struct classifier_entity *nasrg_CLASS_add_rclassifier(u8 dscp, u16 classref){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Add a new classifier rule (mbms direction)
|
||||
struct classifier_entity *nasrg_CLASS_add_mbmsclassifier(int mbms_ix, u16 classref){
|
||||
struct classifier_entity *nasrg_CLASS_add_mbmsclassifier(int mbms_ix, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *gc;
|
||||
|
||||
@@ -224,7 +224,7 @@ struct classifier_entity *nasrg_CLASS_add_mbmsclassifier(int mbms_ix, u16 classr
|
||||
//---------------------------------------------------------------------------
|
||||
void nasrg_CLASS_flush_sclassifier(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 dscpi;
|
||||
uint8_t dscpi;
|
||||
struct classifier_entity *gc;
|
||||
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -250,7 +250,7 @@ void nasrg_CLASS_flush_sclassifier(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
void nasrg_CLASS_flush_rclassifier(){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 dscpi;
|
||||
uint8_t dscpi;
|
||||
struct classifier_entity *gc;
|
||||
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -293,7 +293,7 @@ void nasrg_CLASS_flush_mbmsclassifier(){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a classifier rule (send direction)
|
||||
void nasrg_CLASS_del_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
void nasrg_CLASS_del_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *p,*np;
|
||||
|
||||
@@ -329,7 +329,7 @@ void nasrg_CLASS_del_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a classifier rule (receive direction)
|
||||
void nasrg_CLASS_del_rclassifier(u8 dscp, u16 classref){
|
||||
void nasrg_CLASS_del_rclassifier(uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *p,*np;
|
||||
|
||||
@@ -361,7 +361,7 @@ void nasrg_CLASS_del_rclassifier(u8 dscp, u16 classref){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a classifier rule (mbms direction)
|
||||
void nasrg_CLASS_del_mbmsclassifier(int mbms_ix, u16 classref){
|
||||
void nasrg_CLASS_del_mbmsclassifier(int mbms_ix, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *p,*np;
|
||||
|
||||
@@ -396,7 +396,7 @@ void nasrg_CLASS_del_mbmsclassifier(int mbms_ix, u16 classref){
|
||||
// Search the entity with the IPv4 address 'addr'
|
||||
struct cx_entity *nasrg_CLASS_cx4(struct sk_buff *skb){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
printk("nasrg_CLASS_cx4: begin\n");
|
||||
#endif
|
||||
@@ -410,7 +410,7 @@ struct cx_entity *nasrg_CLASS_cx4(struct sk_buff *skb){
|
||||
struct cx_entity *nasrg_CLASS_cx4(struct sk_buff *skb, unsigned char dscp, int *paddr_type, unsigned char *cx_index) {
|
||||
//---------------------------------------------------------------------------
|
||||
unsigned char cxi;
|
||||
u32 daddr;
|
||||
uint32_t daddr;
|
||||
struct cx_entity *cx=NULL;
|
||||
struct classifier_entity *pclassifier=NULL;
|
||||
struct in_addr masked_addr;
|
||||
@@ -469,8 +469,8 @@ struct cx_entity *nasrg_CLASS_cx4(struct sk_buff *skb, unsigned char dscp, int *
|
||||
struct cx_entity *nasrg_CLASS_cx6(struct sk_buff *skb, int* paddr_type, int* pmbms_ix){
|
||||
//---------------------------------------------------------------------------
|
||||
struct cx_entity * cx=NULL;
|
||||
u8 cxi;
|
||||
u32 mc_addr_hdr, uni_ifid1, uni_ifid2;
|
||||
uint8_t cxi;
|
||||
uint32_t mc_addr_hdr, uni_ifid1, uni_ifid2;
|
||||
//int addr_type = NASRG_ADDR_UNKNOWN;
|
||||
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -538,10 +538,10 @@ struct cx_entity *nasrg_CLASS_cx6(struct sk_buff *skb, int* paddr_type, int* pmb
|
||||
// Navid: the ipv6 classifier is not fully tested
|
||||
struct cx_entity *nasrg_CLASS_cx6(struct sk_buff *skb, unsigned char dscp, int *paddr_type, unsigned char *cx_index, int* pmbms_ix) {
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
struct cx_entity *cx = NULL;
|
||||
struct classifier_entity *sclassifier= NULL;
|
||||
u32 mc_addr_hdr;
|
||||
uint32_t mc_addr_hdr;
|
||||
struct in6_addr masked_addr;
|
||||
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -630,10 +630,10 @@ struct cx_entity *nasrg_CLASS_cx6(struct sk_buff *skb, unsigned char dscp, int *
|
||||
void nasrg_CLASS_send(struct sk_buff *skb){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *pclassifier, *sp;
|
||||
u8 *protocolh = NULL;
|
||||
u8 version;
|
||||
u8 protocol, dscp;
|
||||
u16 classref;
|
||||
uint8_t *protocolh = NULL;
|
||||
uint8_t version;
|
||||
uint8_t protocol, dscp;
|
||||
uint16_t classref;
|
||||
struct cx_entity *cx;
|
||||
unsigned int i;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
|
||||
@@ -43,14 +43,14 @@
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Receive data from FIFO (QOS or DC)
|
||||
//void nasrg_COMMON_receive(u16 hlen, u16 dlen, int sap){
|
||||
void nasrg_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer, int rb_id, int sap){
|
||||
//void nasrg_COMMON_receive(uint16_t hlen, uint16_t dlen, int sap){
|
||||
void nasrg_COMMON_receive(uint16_t bytes_read, uint16_t payload_length, void *data_buffer, int rb_id, int sap){
|
||||
//---------------------------------------------------------------------------
|
||||
struct sk_buff *skb;
|
||||
struct ipversion *ipv;
|
||||
unsigned int hard_header_len;
|
||||
u16 *p_ether_type;
|
||||
u16 ether_type;
|
||||
uint16_t *p_ether_type;
|
||||
uint16_t ether_type;
|
||||
|
||||
#ifdef NAS_DEBUG_RECEIVE
|
||||
printk("nasrg_COMMON_receive: begin\n");
|
||||
@@ -141,8 +141,8 @@ void nasrg_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer,
|
||||
printk("nasrg_COMMON_receive: ether_type=%04X\n", ether_type);
|
||||
#endif
|
||||
skb->protocol = eth_type_trans(skb, gdev);
|
||||
// minus 1(short) instead of 2(bytes) because u16*
|
||||
p_ether_type = (u16 *)&(skb->mac_header[hard_header_len-2]);
|
||||
// minus 1(short) instead of 2(bytes) because uint16_t*
|
||||
p_ether_type = (uint16_t *)&(skb->mac_header[hard_header_len-2]);
|
||||
ether_type = ntohs(*p_ether_type);
|
||||
#ifdef NAS_DEBUG_RECEIVE
|
||||
printk("nasrg_COMMON_receive: ether_type=%04X\n", ether_type);
|
||||
@@ -351,7 +351,7 @@ void nasrg_COMMON_QOS_send_test_netlink(struct sk_buff *skb){
|
||||
//---------------------------------------------------------------------------
|
||||
void nasrg_COMMON_QOS_receive(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 sapi;
|
||||
uint8_t sapi;
|
||||
struct pdcp_data_ind_header_t pdcph;
|
||||
int bytes_read = 0;
|
||||
// Start debug information
|
||||
@@ -404,7 +404,7 @@ void nasrg_COMMON_QOS_receive(struct nlmsghdr *nlh){
|
||||
printk("nasrg_COMMON_QOS_receive - receive from PDCP, size %d, rab %d\\n", pdcph->data_size, pdcph->rb_id);
|
||||
#endif //NAS_DEBUG_RECEIVE
|
||||
|
||||
//void nasrg_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer, int rb_id, int sap);
|
||||
//void nasrg_COMMON_receive(uint16_t bytes_read, uint16_t payload_length, void *data_buffer, int rb_id, int sap);
|
||||
nasrg_COMMON_receive(NAS_PDCPH_SIZE + pdcph->data_size, pdcph->data_size, (unsigned char *)NLMSG_DATA(nlh) + NAS_PDCPH_SIZE, pdcph->rb_id, 0);
|
||||
}
|
||||
#endif //NAS_NETLINK
|
||||
@@ -490,7 +490,7 @@ void nasrg_COMMON_del_rb(struct cx_entity *cx, nasRadioBearerId_t rab_id, nasIPd
|
||||
//---------------------------------------------------------------------------
|
||||
struct rb_entity *rb, *curr_rb, *prev_rb;
|
||||
struct classifier_entity *p;
|
||||
u16 classref=0;
|
||||
uint16_t classref=0;
|
||||
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -546,7 +546,7 @@ void nasrg_COMMON_flush_rb(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
struct rb_entity *rb;
|
||||
struct classifier_entity *gc;
|
||||
u8 dscp;
|
||||
uint8_t dscp;
|
||||
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
|
||||
@@ -69,10 +69,10 @@ struct net_device *gdev;
|
||||
struct nas_priv *gpriv;
|
||||
//int bytes_wrote;
|
||||
//int bytes_read;
|
||||
u8 NAS_RG_IMEI[14]={0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x01};
|
||||
u8 NAS_NULL_IMEI[14]={0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00};
|
||||
uint8_t NAS_RG_IMEI[14]={0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x01};
|
||||
uint8_t NAS_NULL_IMEI[14]={0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00};
|
||||
|
||||
u16 local_rg_cell_id;
|
||||
uint16_t local_rg_cell_id;
|
||||
|
||||
#ifdef NAS_NETLINK
|
||||
extern void nasrg_netlink_release(void);
|
||||
@@ -84,7 +84,7 @@ extern void nasrg_ASCTL_timer(unsigned long data);
|
||||
//---------------------------------------------------------------------------
|
||||
void *nasrg_interrupt(void){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
#ifdef NAS_DEBUG_INTERRUPT
|
||||
printk("nasrg_interrupt - begin\n");
|
||||
#endif
|
||||
@@ -316,7 +316,7 @@ static const struct net_device_ops nasrg_netdev_ops = {
|
||||
// Initialisation of the network device
|
||||
void nasrg_init(struct net_device *dev){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi, dscpi;
|
||||
uint8_t cxi, dscpi;
|
||||
|
||||
printk("nasrg_init: begin\n");
|
||||
|
||||
@@ -388,7 +388,7 @@ void nasrg_init(struct net_device *dev){
|
||||
gpriv->cx[cxi].sclassifier[dscpi]=NULL;
|
||||
gpriv->cx[cxi].nsclassifier=0;
|
||||
// initialisation of the IP address
|
||||
nasrg_TOOL_imei2iid(NAS_NULL_IMEI, (u8 *)gpriv->cx[cxi].iid6);
|
||||
nasrg_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)gpriv->cx[cxi].iid6);
|
||||
gpriv->cx[cxi].iid4=0;
|
||||
}
|
||||
spin_lock_init(&gpriv->lock);
|
||||
|
||||
@@ -76,7 +76,7 @@ int nasrg_ioCTL_statistic_request(struct nas_ioctl *gifr){
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Connections List
|
||||
//---------------------------------------------------------------------------
|
||||
void nasrg_set_msg_cx_list_reply(u8 *msgrep){
|
||||
void nasrg_set_msg_cx_list_reply(uint8_t *msgrep){
|
||||
//---------------------------------------------------------------------------
|
||||
struct cx_entity *cx;
|
||||
nasLocalConnectionRef_t lcr;
|
||||
@@ -101,7 +101,7 @@ void nasrg_set_msg_cx_list_reply(u8 *msgrep){
|
||||
//---------------------------------------------------------------------------
|
||||
int nasrg_ioCTL_cx_list_request(struct nas_ioctl *gifr){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 msgrep[NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1];
|
||||
uint8_t msgrep[NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1];
|
||||
printk("nasrg_ioCTL_cx_list: connection list requested\n");
|
||||
nasrg_set_msg_cx_list_reply(msgrep);
|
||||
if (copy_to_user(gifr->msg, msgrep, NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1))
|
||||
@@ -174,13 +174,13 @@ int nasrg_ioCTL_cx_release_request(struct nas_ioctl *gifr){
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Radio Bearer List
|
||||
//---------------------------------------------------------------------------
|
||||
void nasrg_set_msg_rb_list_reply(u8 *msgrep, struct nas_msg_rb_list_request *msgreq){
|
||||
void nasrg_set_msg_rb_list_reply(uint8_t *msgrep, struct nas_msg_rb_list_request *msgreq){
|
||||
//---------------------------------------------------------------------------
|
||||
struct cx_entity *cx;
|
||||
cx=nasrg_COMMON_search_cx(msgreq->lcr);
|
||||
if (cx!=NULL)
|
||||
{
|
||||
u8 rbi;
|
||||
uint8_t rbi;
|
||||
struct rb_entity *rb;
|
||||
struct nas_msg_rb_list_reply *list;
|
||||
if (cx->num_rb > NAS_LIST_RB_MAX)
|
||||
@@ -219,7 +219,7 @@ void nasrg_set_msg_rb_list_reply(u8 *msgrep, struct nas_msg_rb_list_request *msg
|
||||
//---------------------------------------------------------------------------
|
||||
int nasrg_ioCTL_rb_list_request(struct nas_ioctl *gifr){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 msgrep[NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1];
|
||||
uint8_t msgrep[NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1];
|
||||
struct nas_msg_rb_list_request msgreq;
|
||||
printk("nasrg_ioCTL_rb_list: Radio Bearer list requested\n");
|
||||
if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq)))
|
||||
@@ -315,7 +315,7 @@ void nasrg_set_msg_rb_release_reply(struct nas_msg_rb_release_reply *msgrep, str
|
||||
cx=nasrg_COMMON_search_cx(msgreq->lcr);
|
||||
rb=nasrg_COMMON_search_rb(cx, msgreq->rab_id);
|
||||
if ((rb!=NULL)&&(cx!=NULL)){
|
||||
u8 dscp;
|
||||
uint8_t dscp;
|
||||
msgrep->status=nasrg_ASCTL_DC_send_rb_release_request(cx, rb);
|
||||
dscp=rb->dscp;
|
||||
nasrg_COMMON_del_rb(cx, msgreq->rab_id, dscp);
|
||||
@@ -359,12 +359,12 @@ int nasrg_ioCTL_rb_release_request(struct nas_ioctl *gifr){
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Classifier List
|
||||
//---------------------------------------------------------------------------
|
||||
void nasrg_set_msg_class_list_reply(u8 *msgrep, struct nas_msg_class_list_request *msgreq){
|
||||
void nasrg_set_msg_class_list_reply(uint8_t *msgrep, struct nas_msg_class_list_request *msgreq){
|
||||
//---------------------------------------------------------------------------
|
||||
struct cx_entity *cx;
|
||||
struct classifier_entity *gc;
|
||||
struct nas_msg_class_list_reply *list;
|
||||
u8 cli;
|
||||
uint8_t cli;
|
||||
list=(struct nas_msg_class_list_reply *)(msgrep+1);
|
||||
switch(msgreq->dir)
|
||||
{
|
||||
@@ -417,7 +417,7 @@ void nasrg_set_msg_class_list_reply(u8 *msgrep, struct nas_msg_class_list_reques
|
||||
//---------------------------------------------------------------------------
|
||||
int nasrg_ioCTL_class_list_request(struct nas_ioctl *gifr){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 msgrep[NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1];
|
||||
uint8_t msgrep[NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1];
|
||||
struct nas_msg_class_list_request msgreq;
|
||||
printk("nasrg_ioCTL_class_list: classifier list requested\n");
|
||||
if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq)))
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
#define NAS_LIST_RB_MAX 32
|
||||
#define NAS_LIST_CLASS_MAX 32
|
||||
|
||||
typedef u16 nasMsgType_t;
|
||||
typedef uint16_t nasMsgType_t;
|
||||
|
||||
struct nas_ioctl
|
||||
{
|
||||
@@ -94,26 +94,26 @@ struct nas_ioctl
|
||||
//****
|
||||
struct nas_msg_statistic_reply
|
||||
{
|
||||
u32 rx_packets;
|
||||
u32 tx_packets;
|
||||
u32 rx_bytes;
|
||||
u32 tx_bytes;
|
||||
u32 rx_errors;
|
||||
u32 tx_errors;
|
||||
u32 rx_dropped;
|
||||
u32 tx_dropped;
|
||||
uint32_t rx_packets;
|
||||
uint32_t tx_packets;
|
||||
uint32_t rx_bytes;
|
||||
uint32_t tx_bytes;
|
||||
uint32_t rx_errors;
|
||||
uint32_t tx_errors;
|
||||
uint32_t rx_dropped;
|
||||
uint32_t tx_dropped;
|
||||
};
|
||||
|
||||
//****
|
||||
struct nas_msg_cx_list_reply
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
u8 state;
|
||||
uint8_t state;
|
||||
nasCellID_t cellid; // cell identification
|
||||
u32 iid6[2]; // IPv6 interface identification
|
||||
u8 iid4; // IPv4 interface identification
|
||||
u16 num_rb;
|
||||
u16 nsclassifier;
|
||||
uint32_t iid6[2]; // IPv6 interface identification
|
||||
uint8_t iid4; // IPv4 interface identification
|
||||
uint16_t num_rb;
|
||||
uint16_t nsclassifier;
|
||||
};
|
||||
//****
|
||||
struct nas_msg_cx_establishment_reply
|
||||
@@ -141,8 +141,8 @@ struct nas_msg_rb_list_reply
|
||||
nasRadioBearerId_t rab_id;
|
||||
nasSapId_t sapi;
|
||||
nasQoSTrafficClass_t qos;
|
||||
u8 state;
|
||||
u32 cnxid;
|
||||
uint8_t state;
|
||||
uint32_t cnxid;
|
||||
};
|
||||
struct nas_msg_rb_list_request
|
||||
{
|
||||
@@ -152,32 +152,32 @@ struct nas_msg_rb_list_request
|
||||
struct nas_msg_rb_establishment_reply
|
||||
{
|
||||
int status;
|
||||
u32 cnxid;
|
||||
uint32_t cnxid;
|
||||
};
|
||||
struct nas_msg_rb_establishment_request
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
nasRadioBearerId_t rab_id;
|
||||
nasQoSTrafficClass_t qos;
|
||||
u16 dscp_ul;
|
||||
u16 dscp_dl;
|
||||
u16 mcast_flag;
|
||||
u8 mcast_group[16];
|
||||
u32 cnxid;
|
||||
uint16_t dscp_ul;
|
||||
uint16_t dscp_dl;
|
||||
uint16_t mcast_flag;
|
||||
uint8_t mcast_group[16];
|
||||
uint32_t cnxid;
|
||||
};
|
||||
|
||||
//****
|
||||
struct nas_msg_rb_release_reply
|
||||
{
|
||||
int status;
|
||||
u32 cnxid;
|
||||
uint32_t cnxid;
|
||||
};
|
||||
struct nas_msg_rb_release_request
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
nasRadioBearerId_t rab_id;
|
||||
u16 mcast_flag;
|
||||
u32 cnxid;
|
||||
uint16_t mcast_flag;
|
||||
uint32_t cnxid;
|
||||
};
|
||||
|
||||
//****
|
||||
@@ -185,26 +185,26 @@ struct nas_msg_class_add_request
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
nasRadioBearerId_t rab_id;
|
||||
u8 dir; // direction (send or receive)
|
||||
u8 dscp; // codepoint
|
||||
u8 fct;
|
||||
u16 classref;
|
||||
u8 version;
|
||||
uint8_t dir; // direction (send or receive)
|
||||
uint8_t dscp; // codepoint
|
||||
uint8_t fct;
|
||||
uint16_t classref;
|
||||
uint8_t version;
|
||||
union
|
||||
{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
} saddr; // IP source address
|
||||
u8 splen; // prefix length
|
||||
uint8_t splen; // prefix length
|
||||
union
|
||||
{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
} daddr; // IP destination address
|
||||
u8 dplen; // prefix length
|
||||
u8 protocol; // high layer protocol type
|
||||
u16 sport; // source port
|
||||
u16 dport; // destination port
|
||||
uint8_t dplen; // prefix length
|
||||
uint8_t protocol; // high layer protocol type
|
||||
uint16_t sport; // source port
|
||||
uint16_t dport; // destination port
|
||||
};
|
||||
struct nas_msg_class_add_reply
|
||||
{
|
||||
@@ -214,9 +214,9 @@ struct nas_msg_class_add_reply
|
||||
struct nas_msg_class_del_request
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
u8 dir; // direction (send or receive)
|
||||
u8 dscp; // codepoint
|
||||
u16 classref;
|
||||
uint8_t dir; // direction (send or receive)
|
||||
uint8_t dscp; // codepoint
|
||||
uint16_t classref;
|
||||
};
|
||||
struct nas_msg_class_del_reply
|
||||
{
|
||||
@@ -227,15 +227,15 @@ struct nas_msg_class_del_reply
|
||||
struct nas_msg_class_list_request
|
||||
{
|
||||
nasLocalConnectionRef_t lcr; // Local Connection reference
|
||||
u8 dir;
|
||||
u8 dscp;
|
||||
uint8_t dir;
|
||||
uint8_t dscp;
|
||||
};
|
||||
|
||||
//****
|
||||
struct nas_msg_neighbour_cell_list_reply
|
||||
{
|
||||
nasCellID_t cellid; // cell identification
|
||||
u32 iid6[4]; // IPv6 address of access router
|
||||
uint32_t iid6[4]; // IPv6 address of access router
|
||||
};
|
||||
|
||||
//MBMS
|
||||
@@ -243,21 +243,21 @@ struct nas_msg_neighbour_cell_list_reply
|
||||
struct nas_msg_mt_mcast_join
|
||||
{
|
||||
nasLocalConnectionRef_t ue_id;
|
||||
u32 cnxid;
|
||||
uint32_t cnxid;
|
||||
nasRadioBearerId_t rab_id;
|
||||
};
|
||||
|
||||
struct nas_msg_mt_mcast_leave
|
||||
{
|
||||
nasLocalConnectionRef_t ue_id;
|
||||
u32 cnxid;
|
||||
uint32_t cnxid;
|
||||
nasRadioBearerId_t rab_id;
|
||||
};
|
||||
|
||||
struct nas_msg_mt_mcast_reply
|
||||
{
|
||||
nasLocalConnectionRef_t ue_id;
|
||||
u32 cnxid;
|
||||
uint32_t cnxid;
|
||||
int result;
|
||||
};
|
||||
//****
|
||||
|
||||
@@ -83,7 +83,7 @@ static void nasrg_rrcnl_data_ready (struct sk_buff *skb){
|
||||
//---------------------------------------------------------------------------
|
||||
struct nlmsghdr *nlh = NULL;
|
||||
char target_sap;
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_RRCNL
|
||||
|
||||
@@ -66,8 +66,8 @@ int nasrg_netlink_init(void);
|
||||
int nasrg_netlink_send(unsigned char *data_buffer, unsigned int data_length, int destination);
|
||||
|
||||
// nasrg_common.c
|
||||
//void nasrg_COMMON_receive(u16 hlen, u16 dlength, int sap);
|
||||
void nasrg_COMMON_receive(u16 bytes_read, u16 payload_length, void *data_buffer, int rb_id, int sap);
|
||||
//void nasrg_COMMON_receive(uint16_t hlen, uint16_t dlength, int sap);
|
||||
void nasrg_COMMON_receive(uint16_t bytes_read, uint16_t payload_length, void *data_buffer, int rb_id, int sap);
|
||||
|
||||
void nasrg_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc);
|
||||
void nasrg_COMMON_QOS_send_test_netlink(struct sk_buff *skb);
|
||||
@@ -90,7 +90,7 @@ void nasrg_ASCTL_DC_send_sig_data_request(struct sk_buff *skb, struct cx_entity
|
||||
//int nasrg_ASCTL_DC_receive(struct cx_entity *cx);
|
||||
int nasrg_ASCTL_DC_receive(struct cx_entity *cx, char *buffer);
|
||||
//
|
||||
int nasrg_ASCTL_DC_send_cx_establish_confirm(struct cx_entity *cx, u8 response);
|
||||
int nasrg_ASCTL_DC_send_cx_establish_confirm(struct cx_entity *cx, uint8_t response);
|
||||
int nasrg_ASCTL_DC_send_rb_establish_request(struct cx_entity *cx, struct rb_entity *rb);
|
||||
int nasrg_ASCTL_DC_send_rb_release_request(struct cx_entity *cx, struct rb_entity *rb);
|
||||
int nasrg_ASCTL_GC_send_mbms_bearer_establish_req(int mbms_ix );
|
||||
@@ -106,35 +106,35 @@ int nasrg_CTL_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
|
||||
|
||||
// nasrg_classifier.c
|
||||
void nasrg_CLASS_send(struct sk_buff *skb);
|
||||
struct classifier_entity *nasrg_CLASS_add_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref);
|
||||
struct classifier_entity *nasrg_CLASS_add_rclassifier(u8 dscp, u16 classref);
|
||||
struct classifier_entity *nasrg_CLASS_add_mbmsclassifier(int mbms_ix, u16 classref);
|
||||
void nasrg_CLASS_del_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref);
|
||||
void nasrg_CLASS_del_rclassifier(u8 dscp, u16 classref);
|
||||
void nasrg_CLASS_del_mbmsclassifier(int mbms_ix, u16 classref);
|
||||
struct classifier_entity *nasrg_CLASS_add_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref);
|
||||
struct classifier_entity *nasrg_CLASS_add_rclassifier(uint8_t dscp, uint16_t classref);
|
||||
struct classifier_entity *nasrg_CLASS_add_mbmsclassifier(int mbms_ix, uint16_t classref);
|
||||
void nasrg_CLASS_del_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref);
|
||||
void nasrg_CLASS_del_rclassifier(uint8_t dscp, uint16_t classref);
|
||||
void nasrg_CLASS_del_mbmsclassifier(int mbms_ix, uint16_t classref);
|
||||
void nasrg_CLASS_flush_sclassifier(struct cx_entity *cx);
|
||||
void nasrg_CLASS_flush_rclassifier(void);
|
||||
void nasrg_CLASS_flush_mbmsclassifier(void);
|
||||
|
||||
// nasrg_tool.c
|
||||
u8 nasrg_TOOL_invfct(struct classifier_entity *gc);
|
||||
void nasrg_TOOL_fct(struct classifier_entity *gc, u8 fct);
|
||||
void nasrg_TOOL_imei2iid(u8 *imei, u8 *iid);
|
||||
void nasrg_TOOL_RGimei2iid(u8 *imei, u8 *iid);
|
||||
u8 nasrg_TOOL_get_dscp6(struct ipv6hdr *iph);
|
||||
u8 nasrg_TOOL_get_dscp4(struct iphdr *iph);
|
||||
u8 *nasrg_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol);
|
||||
u8 *nasrg_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol);
|
||||
uint8_t nasrg_TOOL_invfct(struct classifier_entity *gc);
|
||||
void nasrg_TOOL_fct(struct classifier_entity *gc, uint8_t fct);
|
||||
void nasrg_TOOL_imei2iid(uint8_t *imei, uint8_t *iid);
|
||||
void nasrg_TOOL_RGimei2iid(uint8_t *imei, uint8_t *iid);
|
||||
uint8_t nasrg_TOOL_get_dscp6(struct ipv6hdr *iph);
|
||||
uint8_t nasrg_TOOL_get_dscp4(struct iphdr *iph);
|
||||
uint8_t *nasrg_TOOL_get_protocol6(struct ipv6hdr *iph, uint8_t *protocol);
|
||||
uint8_t *nasrg_TOOL_get_protocol4(struct iphdr *iph, uint8_t *protocol);
|
||||
char *nasrg_TOOL_get_udpmsg(struct udphdr *udph);
|
||||
u16 nasrg_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, u8 proto, u32 udplen, void *data);
|
||||
int nasrg_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, u8 plen);
|
||||
int nasrg_TOOL_network4(u32 *addr, u32 *prefix, u8 plen);
|
||||
uint16_t nasrg_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, uint8_t proto, uint32_t udplen, void *data);
|
||||
int nasrg_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, uint8_t plen);
|
||||
int nasrg_TOOL_network4(uint32_t *addr, uint32_t *prefix, uint8_t plen);
|
||||
|
||||
void nasrg_TOOL_pk_icmp6(struct icmp6hdr *icmph);
|
||||
|
||||
void nasrg_TOOL_pk_all(struct sk_buff *skb);
|
||||
void nasrg_TOOL_pk_ipv6(struct ipv6hdr *iph);
|
||||
void nasrg_TOOL_print_state(u8 state);
|
||||
void nasrg_TOOL_print_state(uint8_t state);
|
||||
void nasrg_TOOL_print_buffer(unsigned char * buffer,int length);
|
||||
void nasrg_TOOL_print_rb_entity(struct rb_entity *rb);
|
||||
void nasrg_TOOL_print_classifier(struct classifier_entity *gc);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
void nasrg_TOOL_fct(struct classifier_entity *gc, u8 fct){
|
||||
void nasrg_TOOL_fct(struct classifier_entity *gc, uint8_t fct){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -42,7 +42,7 @@ void nasrg_TOOL_fct(struct classifier_entity *gc, u8 fct){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nasrg_TOOL_invfct(struct classifier_entity *gc){
|
||||
uint8_t nasrg_TOOL_invfct(struct classifier_entity *gc){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -65,7 +65,7 @@ u8 nasrg_TOOL_invfct(struct classifier_entity *gc){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nasrg_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
uint8_t nasrg_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -81,7 +81,7 @@ u8 nasrg_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nasrg_TOOL_get_dscp4(struct iphdr *iph){
|
||||
uint8_t nasrg_TOOL_get_dscp4(struct iphdr *iph){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -96,9 +96,9 @@ u8 nasrg_TOOL_get_dscp4(struct iphdr *iph){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 *nasrg_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
uint8_t *nasrg_TOOL_get_protocol6(struct ipv6hdr *iph, uint8_t *protocol){
|
||||
//---------------------------------------------------------------------------
|
||||
u16 size;
|
||||
uint16_t size;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
printk("nasrg_TOOL_get_protocol6 - begin \n");
|
||||
@@ -120,16 +120,16 @@ u8 *nasrg_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
case IPPROTO_UDP:
|
||||
case IPPROTO_TCP:
|
||||
case IPPROTO_ICMPV6:
|
||||
return (u8 *)((u8 *)iph+size);
|
||||
return (uint8_t *)((uint8_t *)iph+size);
|
||||
case IPPROTO_HOPOPTS:
|
||||
case IPPROTO_ROUTING:
|
||||
case IPPROTO_DSTOPTS:
|
||||
*protocol=((u8 *)iph+size)[0];
|
||||
size+=((u8 *)iph+size)[1]*8+8;
|
||||
*protocol=((uint8_t *)iph+size)[0];
|
||||
size+=((uint8_t *)iph+size)[1]*8+8;
|
||||
break;
|
||||
case IPPROTO_FRAGMENT:
|
||||
*protocol=((u8 *)iph+size)[0];
|
||||
size+=((u8 *)iph+size)[1]+8;
|
||||
*protocol=((uint8_t *)iph+size)[0];
|
||||
size+=((uint8_t *)iph+size)[1]+8;
|
||||
break;
|
||||
case IPPROTO_NONE:
|
||||
case IPPROTO_AH:
|
||||
@@ -141,7 +141,7 @@ u8 *nasrg_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 *nasrg_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
uint8_t *nasrg_TOOL_get_protocol4(struct iphdr *iph, uint8_t *protocol){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -161,7 +161,7 @@ u8 *nasrg_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
case IPPROTO_UDP:
|
||||
case IPPROTO_TCP:
|
||||
case IPPROTO_ICMP:
|
||||
return (u8 *)((u8 *)iph+iph->tot_len);
|
||||
return (uint8_t *)((uint8_t *)iph+iph->tot_len);
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ u8 *nasrg_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Convert the IMEI to iid
|
||||
void nasrg_TOOL_imei2iid(u8 *imei, u8 *iid){
|
||||
void nasrg_TOOL_imei2iid(uint8_t *imei, uint8_t *iid){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -204,7 +204,7 @@ void nasrg_TOOL_imei2iid(u8 *imei, u8 *iid){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Convert the RG IMEI to iid
|
||||
void nasrg_TOOL_RGimei2iid(u8 *imei, u8 *iid){
|
||||
void nasrg_TOOL_RGimei2iid(uint8_t *imei, uint8_t *iid){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -260,7 +260,7 @@ void nasrg_TOOL_pk_icmp6(struct icmp6hdr *icmph){
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
void nasrg_TOOL_print_state(u8 state){
|
||||
void nasrg_TOOL_print_state(uint8_t state){
|
||||
//---------------------------------------------------------------------------
|
||||
switch(state){
|
||||
case NAS_IDLE:printk("NAS_IDLE\n");return;
|
||||
|
||||
@@ -66,8 +66,8 @@
|
||||
struct cx_entity;
|
||||
|
||||
struct rb_entity{
|
||||
// u16 default_rab;
|
||||
u32 cnxid;
|
||||
// uint16_t default_rab;
|
||||
uint32_t cnxid;
|
||||
nasRadioBearerId_t rab_id; //ue_rbId
|
||||
nasRadioBearerId_t rg_rbId;
|
||||
nasRadioBearerId_t mbms_rbId;
|
||||
@@ -76,35 +76,35 @@ struct rb_entity{
|
||||
nasQoSTrafficClass_t RadioQosClass;
|
||||
nasIPdscp_t dscp; //this is DL dscp
|
||||
nasIPdscp_t dscp_ul;
|
||||
u8 state;
|
||||
u8 result;
|
||||
u8 retry;
|
||||
u32 countimer;
|
||||
uint8_t state;
|
||||
uint8_t result;
|
||||
uint8_t retry;
|
||||
uint32_t countimer;
|
||||
//for MBMS
|
||||
u16 serviceId;
|
||||
u16 sessionId;
|
||||
u16 duration;
|
||||
u8 mcast_address[16];
|
||||
uint16_t serviceId;
|
||||
uint16_t sessionId;
|
||||
uint16_t duration;
|
||||
uint8_t mcast_address[16];
|
||||
//
|
||||
struct rb_entity *next;
|
||||
};
|
||||
|
||||
struct classifier_entity{
|
||||
u32 classref; // classifier identity
|
||||
u8 version; // IP version 4 or 6
|
||||
uint32_t classref; // classifier identity
|
||||
uint8_t version; // IP version 4 or 6
|
||||
union{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
} saddr; // IP source address
|
||||
u8 splen; // IP prefix size
|
||||
uint8_t splen; // IP prefix size
|
||||
union{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
} daddr; // IP destination address
|
||||
u8 dplen; // IP prefix size
|
||||
u8 protocol; // layer 4 protocol type (tcp, udp, ...)
|
||||
u16 sport; // source port
|
||||
u16 dport; // destination port
|
||||
uint8_t dplen; // IP prefix size
|
||||
uint8_t protocol; // layer 4 protocol type (tcp, udp, ...)
|
||||
uint16_t sport; // source port
|
||||
uint16_t dport; // destination port
|
||||
struct rb_entity *rb;
|
||||
nasRadioBearerId_t rab_id; // RAB identification
|
||||
void (*fct)(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc);
|
||||
@@ -114,17 +114,17 @@ struct classifier_entity{
|
||||
|
||||
struct cx_entity{
|
||||
int sap[NAS_SAPI_CX_MAX];
|
||||
u8 state; // state of the connection
|
||||
uint8_t state; // state of the connection
|
||||
nasLocalConnectionRef_t lcr; // Local connection reference
|
||||
nasCellID_t cellid; // cell identification
|
||||
u32 countimer; // timeout's counter
|
||||
u8 retry; // number of retransmissions
|
||||
uint32_t countimer; // timeout's counter
|
||||
uint8_t retry; // number of retransmissions
|
||||
struct classifier_entity *sclassifier[NAS_DSCP_MAX]; // send classifiers table
|
||||
u16 nsclassifier;
|
||||
u32 iid6[2]; // IPv6 interface identification
|
||||
u8 iid4; // IPv4 interface identification
|
||||
uint16_t nsclassifier;
|
||||
uint32_t iid6[2]; // IPv6 interface identification
|
||||
uint8_t iid4; // IPv4 interface identification
|
||||
struct rb_entity *rb; // RB entities for RABs
|
||||
u16 num_rb;
|
||||
uint16_t num_rb;
|
||||
// MW - 17/5/05
|
||||
int ue_id;
|
||||
int rrc_state;
|
||||
@@ -135,19 +135,19 @@ struct cx_entity{
|
||||
};
|
||||
|
||||
//struct mbms_rb_entity{
|
||||
// u32 cnxid;
|
||||
// uint32_t cnxid;
|
||||
// nasRadioBearerId_t mbms_rbId;
|
||||
// nasSapId_t sapi;
|
||||
// nasQoSTrafficClass_t qos;
|
||||
// nasQoSTrafficClass_t RadioQosClass;
|
||||
// u8 state;
|
||||
// u8 result;
|
||||
// u8 retry;
|
||||
// u32 countimer;
|
||||
// uint8_t state;
|
||||
// uint8_t result;
|
||||
// uint8_t retry;
|
||||
// uint32_t countimer;
|
||||
//
|
||||
// u16 serviceId;
|
||||
// u16 sessionId;
|
||||
// u16 duration;
|
||||
// uint16_t serviceId;
|
||||
// uint16_t sessionId;
|
||||
// uint16_t duration;
|
||||
//};
|
||||
//
|
||||
|
||||
@@ -157,16 +157,16 @@ struct nas_priv{
|
||||
struct timer_list timer;
|
||||
spinlock_t lock;
|
||||
struct net_device_stats stats;
|
||||
u8 retry_limit;
|
||||
u32 timer_establishment;
|
||||
u32 timer_release;
|
||||
uint8_t retry_limit;
|
||||
uint32_t timer_establishment;
|
||||
uint32_t timer_release;
|
||||
struct cx_entity cx[NAS_CX_MAX];
|
||||
struct classifier_entity *rclassifier[NAS_DSCP_MAX]; // receive classifier
|
||||
int nrclassifier;
|
||||
u32 next_sclassref;
|
||||
uint32_t next_sclassref;
|
||||
int sap[NAS_SAPI_MAX];
|
||||
u8 xbuffer[NAS_MAX_LENGTH]; // transmission buffer
|
||||
u8 rbuffer[NAS_MAX_LENGTH]; // reception buffer
|
||||
uint8_t xbuffer[NAS_MAX_LENGTH]; // transmission buffer
|
||||
uint8_t rbuffer[NAS_MAX_LENGTH]; // reception buffer
|
||||
// MW - 17/5/05
|
||||
int broadcast_counter;
|
||||
int SIB18_counter;
|
||||
@@ -174,22 +174,22 @@ struct nas_priv{
|
||||
struct rb_entity mbms_rb[NASRG_MBMS_SVCES_MAX];
|
||||
struct classifier_entity *mbmsclassifier[NASRG_MBMS_SVCES_MAX]; // mbms classifier
|
||||
int nmbmsclassifier;
|
||||
u32 next_mbmsclassref;
|
||||
uint32_t next_mbmsclassref;
|
||||
//Added for demo 3 - MW
|
||||
nasCellID_t measured_cell_id;
|
||||
u16 num_UEs;
|
||||
u32 rlcBufferOccupancy[NAS_CX_MAX];
|
||||
u32 scheduledPRB[NAS_CX_MAX];
|
||||
u32 totalDataVolume[NAS_CX_MAX];
|
||||
u32 totalNumPRBs;
|
||||
uint16_t num_UEs;
|
||||
uint32_t rlcBufferOccupancy[NAS_CX_MAX];
|
||||
uint32_t scheduledPRB[NAS_CX_MAX];
|
||||
uint32_t totalDataVolume[NAS_CX_MAX];
|
||||
uint32_t totalNumPRBs;
|
||||
};
|
||||
|
||||
struct ipversion {
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
u8 reserved:4,
|
||||
uint8_t reserved:4,
|
||||
version:4;
|
||||
#else
|
||||
u8 version:4,
|
||||
uint8_t version:4,
|
||||
reserved:4;
|
||||
#endif
|
||||
};
|
||||
@@ -211,11 +211,11 @@ extern struct net_device *gdev;
|
||||
//extern int bytes_wrote;
|
||||
//extern int bytes_read;
|
||||
|
||||
extern u8 NAS_RG_IMEI[14];
|
||||
extern u8 NAS_NULL_IMEI[14];
|
||||
extern uint8_t NAS_RG_IMEI[14];
|
||||
extern uint8_t NAS_NULL_IMEI[14];
|
||||
|
||||
//global variables shared with RRC
|
||||
extern int *pt_nas_rg_irq;
|
||||
//extern u16 *pt_rg_own_cell_id;
|
||||
extern u16 local_rg_cell_id;
|
||||
//extern uint16_t *pt_rg_own_cell_id;
|
||||
extern uint16_t local_rg_cell_id;
|
||||
#endif
|
||||
|
||||
@@ -60,7 +60,7 @@ V3= $(if $(IS_KERNEL_MAIN_VERSION_IS_3),-DKERNEL_MAIN_VERSION_IS_3=1)
|
||||
####################################################
|
||||
# EXTRA COMPILER FLAGS
|
||||
####################################################
|
||||
EXTRA_CFLAGS = -fno-common $(if $(IS_KERNEL_GREATER_THAN_2620),-mregparm=3 -fno-stack-protector -mpreferred-stack-boundary=4) $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,) $(GT2622) $(GT2629) $(V3) $(GT32) $(GT35)
|
||||
EXTRA_CFLAGS = -I$(OPENAIR2_DIR)/COMMON -fno-common $(if $(IS_KERNEL_GREATER_THAN_2620),-mregparm=3 -fno-stack-protector -mpreferred-stack-boundary=4) $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,) $(GT2622) $(GT2629) $(V3) $(GT32) $(GT35)
|
||||
|
||||
ifdef ADDRCONF
|
||||
EXTRA_CFLAGS += -DADDRCONF
|
||||
|
||||
@@ -150,52 +150,52 @@
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Find the IP traffic type (UNICAST, MULTICAST, BROADCAST)
|
||||
traffic_type_t oai_nw_drv_find_traffic_type(struct sk_buff *skb) {
|
||||
ip_traffic_type_t oai_nw_drv_find_traffic_type(struct sk_buff *skb) {
|
||||
//---------------------------------------------------------------------------
|
||||
traffic_type_t traffic_type = OAI_NW_DRV_IPVX_ADDR_TYPE_UNKNOWN;
|
||||
ip_traffic_type_t traffic_type = TRAFFIC_IPVX_TYPE_UNKNOWN;
|
||||
|
||||
if (skb!=NULL) {
|
||||
switch (ntohs(skb->protocol)) {
|
||||
case ETH_P_IPV6:
|
||||
traffic_type = OAI_NW_DRV_IPV6_ADDR_TYPE_UNKNOWN;
|
||||
traffic_type = TRAFFIC_IPV6_TYPE_UNKNOWN;
|
||||
#ifdef OAI_DRV_DEBUG_CLASS
|
||||
printk("SOURCE ADDR %X:%X:%X:%X:%X:%X:%X:%X",NIP6ADDR(&(ipv6_hdr(skb)->saddr)));
|
||||
printk(" DEST ADDR %X:%X:%X:%X:%X:%X:%X:%X\n",NIP6ADDR(&(ipv6_hdr(skb)->daddr)));
|
||||
#endif
|
||||
if (IN6_IS_ADDR_MULTICAST(&ipv6_hdr(skb)->daddr.in6_u.u6_addr32[0])) {
|
||||
traffic_type = OAI_NW_DRV_IPV6_ADDR_TYPE_MULTICAST;
|
||||
traffic_type = TRAFFIC_IPV6_TYPE_MULTICAST;
|
||||
|
||||
} else {
|
||||
traffic_type = OAI_NW_DRV_IPV6_ADDR_TYPE_UNICAST;
|
||||
traffic_type = TRAFFIC_IPV6_TYPE_UNICAST;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case ETH_P_IP:
|
||||
traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_UNKNOWN;
|
||||
traffic_type = TRAFFIC_IPV4_TYPE_UNKNOWN;
|
||||
#ifdef KERNEL_VERSION_GREATER_THAN_2622
|
||||
//print_TOOL_pk_ipv4((struct iphdr *)skb->network_header);
|
||||
if (IN_MULTICAST(htonl(ip_hdr(skb)->daddr))) {
|
||||
traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_MULTICAST;
|
||||
traffic_type = TRAFFIC_IPV4_TYPE_MULTICAST;
|
||||
} else {
|
||||
traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_UNICAST;
|
||||
traffic_type = TRAFFIC_IPV4_TYPE_UNICAST;
|
||||
}
|
||||
// TO DO BROADCAST
|
||||
|
||||
#else
|
||||
//print_TOOL_pk_ipv4(skb->nh.iph);
|
||||
if (IN_MULTICAST(htonl(ip_hdr(skb)->daddr))) {
|
||||
traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_MULTICAST;
|
||||
traffic_type = TRAFFIC_IPV4_TYPE_MULTICAST;
|
||||
} else {
|
||||
traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_UNICAST;
|
||||
traffic_type = TRAFFIC_IPV4_TYPE_UNICAST;
|
||||
}
|
||||
// TO DO BROADCAST
|
||||
#endif
|
||||
break;
|
||||
|
||||
case ETH_P_ARP:
|
||||
traffic_type = OAI_NW_DRV_IPV4_ADDR_TYPE_BROADCAST;
|
||||
traffic_type = TRAFFIC_IPV4_TYPE_BROADCAST;
|
||||
break;
|
||||
|
||||
default:;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
#define OAI_DRV_DEBUG_SEND
|
||||
#define OAI_DRV_DEBUG_RECEIVE
|
||||
void oai_nw_drv_common_class_wireless2ip(u16 dlen,
|
||||
void oai_nw_drv_common_class_wireless2ip(uint16_t dlen,
|
||||
void *pdcp_sdu,
|
||||
int inst,
|
||||
OaiNwDrvRadioBearerId_t rb_id) {
|
||||
@@ -80,8 +80,8 @@ void oai_nw_drv_common_class_wireless2ip(u16 dlen,
|
||||
struct ipversion *ipv;
|
||||
struct oai_nw_drv_priv *gpriv=netdev_priv(oai_nw_drv_dev[inst]);
|
||||
unsigned int hard_header_len = 0;
|
||||
u16 *p_ether_type;
|
||||
u16 ether_type;
|
||||
uint16_t *p_ether_type;
|
||||
uint16_t ether_type;
|
||||
#ifdef OAI_DRV_DEBUG_RECEIVE
|
||||
int i;
|
||||
unsigned char *addr;
|
||||
@@ -221,7 +221,7 @@ void oai_nw_drv_common_class_wireless2ip(u16 dlen,
|
||||
switch(protocol) {
|
||||
case IPPROTO_TCP:
|
||||
|
||||
cksum = (u16*)&(((struct tcphdr*)((network_header + (network_header->ihl<<2))))->check);
|
||||
cksum = (uint16_t*)&(((struct tcphdr*)((network_header + (network_header->ihl<<2))))->check);
|
||||
check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, 0,0, ~(*cksum));
|
||||
//check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
|
||||
//check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, dlen, IPPROTO_TCP, ~(*cksum));
|
||||
@@ -245,7 +245,7 @@ void oai_nw_drv_common_class_wireless2ip(u16 dlen,
|
||||
break;
|
||||
|
||||
case IPPROTO_UDP:
|
||||
cksum = (u16*)&(((struct udphdr*)((network_header + (network_header->ihl<<2))))->check);
|
||||
cksum = (uint16_t*)&(((struct udphdr*)((network_header + (network_header->ihl<<2))))->check);
|
||||
check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, 0,0, ~(*cksum));
|
||||
// check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, udp_hdr(skb)->len, IPPROTO_UDP, ~(*cksum));
|
||||
//check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, dlen, IPPROTO_UDP, ~(*cksum));
|
||||
@@ -284,8 +284,8 @@ void oai_nw_drv_common_class_wireless2ip(u16 dlen,
|
||||
// fill skb->pkt_type, skb->dev
|
||||
|
||||
skb->protocol = eth_type_trans(skb, oai_nw_drv_dev[inst]);
|
||||
// minus 1(short) instead of 2(bytes) because u16*
|
||||
p_ether_type = (u16 *)(skb_network_header(skb)-2);
|
||||
// minus 1(short) instead of 2(bytes) because uint16_t*
|
||||
p_ether_type = (uint16_t *)(skb_network_header(skb)-2);
|
||||
ether_type = ntohs(*p_ether_type);
|
||||
|
||||
switch (ether_type) {
|
||||
|
||||
@@ -174,17 +174,6 @@
|
||||
#define OAI_NW_DRV_DEFAULT_IPV6_ADDR3 0
|
||||
|
||||
|
||||
#define OAI_NW_DRV_IPVX_ADDR_TYPE_UNKNOWN 0
|
||||
#define OAI_NW_DRV_IPV6_ADDR_TYPE_UNICAST 1
|
||||
#define OAI_NW_DRV_IPV6_ADDR_TYPE_MULTICAST 2
|
||||
#define OAI_NW_DRV_IPV6_ADDR_TYPE_UNKNOWN 3
|
||||
|
||||
#define OAI_NW_DRV_IPV4_ADDR_TYPE_UNICAST 5
|
||||
#define OAI_NW_DRV_IPV4_ADDR_TYPE_MULTICAST 6
|
||||
#define OAI_NW_DRV_IPV4_ADDR_TYPE_BROADCAST 7
|
||||
#define OAI_NW_DRV_IPV4_ADDR_TYPE_UNKNOWN 8
|
||||
|
||||
|
||||
#define OAI_NW_DRV_MPLS_VERSION_CODE 99
|
||||
|
||||
#define OAI_NW_DRV_NB_INSTANCES_MAX 8
|
||||
|
||||
@@ -75,7 +75,7 @@ extern void oai_nw_drv_netlink_release(void);
|
||||
extern int oai_nw_drv_netlink_init(void);
|
||||
#endif
|
||||
|
||||
u8 NULL_IMEI[14]={0x05, 0x04, 0x03, 0x01, 0x02 ,0x00, 0x00, 0x00, 0x05, 0x04, 0x03 ,0x00, 0x01, 0x08};
|
||||
uint8_t NULL_IMEI[14]={0x05, 0x04, 0x03, 0x01, 0x02 ,0x00, 0x00, 0x00, 0x05, 0x04, 0x03 ,0x00, 0x01, 0x08};
|
||||
|
||||
static unsigned char oai_nw_drv_IMEI[14];
|
||||
static int m_arg=0;
|
||||
@@ -96,7 +96,7 @@ int oai_nw_drv_find_inst(struct net_device *dev) {
|
||||
#ifndef OAI_NW_DRIVER_USE_NETLINK
|
||||
void *oai_nw_drv_interrupt(void){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
|
||||
// struct oai_nw_drv_priv *priv=netdev_priv(dev_id);
|
||||
// unsigned int flags;
|
||||
@@ -334,7 +334,7 @@ static const struct net_device_ops nasmesh_netdev_ops = {
|
||||
// Initialisation of the network device
|
||||
void oai_nw_drv_init(struct net_device *dev){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
struct oai_nw_drv_priv *priv;
|
||||
int index;
|
||||
|
||||
@@ -443,7 +443,7 @@ void oai_nw_drv_init(struct net_device *dev){
|
||||
priv->cx[cxi].nfclassifier=0;
|
||||
*/
|
||||
// initialisation of the IP address
|
||||
oai_nw_drv_TOOL_eNB_imei2iid(oai_nw_drv_IMEI, (u8 *)priv->cx[cxi].iid6, dev->addr_len);
|
||||
oai_nw_drv_TOOL_eNB_imei2iid(oai_nw_drv_IMEI, (uint8_t *)priv->cx[cxi].iid6, dev->addr_len);
|
||||
priv->cx[cxi].iid4=0;
|
||||
//
|
||||
}
|
||||
@@ -455,10 +455,10 @@ void oai_nw_drv_init(struct net_device *dev){
|
||||
#ifdef OAI_NW_DRIVER_USE_NETLINK
|
||||
oai_nw_drv_TOOL_eNB_imei2iid(oai_nw_drv_IMEI, dev->dev_addr, dev->addr_len);// IMEI to device address (for stateless autoconfiguration address)
|
||||
|
||||
oai_nw_drv_TOOL_eNB_imei2iid(oai_nw_drv_IMEI, (u8 *)priv->cx[0].iid6, dev->addr_len);
|
||||
oai_nw_drv_TOOL_eNB_imei2iid(oai_nw_drv_IMEI, (uint8_t *)priv->cx[0].iid6, dev->addr_len);
|
||||
#else
|
||||
oai_nw_drv_TOOL_imei2iid(oai_nw_drv_IMEI, dev->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
|
||||
oai_nw_drv_TOOL_imei2iid(oai_nw_drv_IMEI, (u8 *)priv->cx[0].iid6);
|
||||
oai_nw_drv_TOOL_imei2iid(oai_nw_drv_IMEI, (uint8_t *)priv->cx[0].iid6);
|
||||
#endif
|
||||
// this is more appropriate for user space soft realtime emulation
|
||||
#else
|
||||
@@ -466,7 +466,7 @@ void oai_nw_drv_init(struct net_device *dev){
|
||||
for (index = 0; index < dev->addr_len; index++) {
|
||||
dev->dev_addr[index] = 16*oai_nw_drv_IMEI[index]+oai_nw_drv_IMEI[index+1]);
|
||||
}
|
||||
memcpy((u8 *)priv->cx[0].iid6,&oai_nw_drv_IMEI[0],dev->addr_len);
|
||||
memcpy((uint8_t *)priv->cx[0].iid6,&oai_nw_drv_IMEI[0],dev->addr_len);
|
||||
|
||||
printk("INIT: init IMEI to IID\n");
|
||||
#endif
|
||||
@@ -476,7 +476,7 @@ void oai_nw_drv_init(struct net_device *dev){
|
||||
}
|
||||
printk("\n[OAI_IP_DRV][%s] Setting priv->cx to : ", __FUNCTION__);
|
||||
for (index = 0; index < 8; index++) {
|
||||
printk("%02X", ((u8 *)(priv->cx[0].iid6))[index]);
|
||||
printk("%02X", ((uint8_t *)(priv->cx[0].iid6))[index]);
|
||||
}
|
||||
printk("\n");
|
||||
printk("[OAI_IP_DRV][%s] INIT: end\n", __FUNCTION__);
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
ntohs((addr)->s6_addr16[6]), \
|
||||
ntohs((addr)->s6_addr16[7])
|
||||
|
||||
u8 g_msgrep[OAI_NW_DRV_LIST_CLASS_MAX*sizeof(struct oai_nw_drv_msg_class_list_reply)+1];
|
||||
uint8_t g_msgrep[OAI_NW_DRV_LIST_CLASS_MAX*sizeof(struct oai_nw_drv_msg_class_list_reply)+1];
|
||||
|
||||
// Statistic
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
@@ -63,20 +63,19 @@
|
||||
#define IP2PDCP_FIFO 22
|
||||
|
||||
#include "constant.h"
|
||||
#include "platform_types.h"
|
||||
#include "sap.h"
|
||||
|
||||
typedef int traffic_type_t;
|
||||
|
||||
struct cx_entity {
|
||||
int sap[OAI_NW_DRV_SAPI_CX_MAX];
|
||||
u8 state; // state of the connection
|
||||
uint8_t state; // state of the connection
|
||||
OaiNwDrvLocalConnectionRef_t lcr; // Local connection reference
|
||||
OaiNwDrvCellID_t cellid; // cell identification
|
||||
u32 countimer; // timeout's counter
|
||||
u8 retry; // number of retransmission
|
||||
uint32_t countimer; // timeout's counter
|
||||
uint8_t retry; // number of retransmission
|
||||
|
||||
u32 iid6[2]; // IPv6 interface identification
|
||||
u8 iid4; // IPv4 interface identification
|
||||
uint32_t iid6[2]; // IPv6 interface identification
|
||||
uint8_t iid4; // IPv4 interface identification
|
||||
int lastRRCprimitive;
|
||||
//measures
|
||||
int req_prov_id [OAI_NW_DRV_MAX_MEASURE_NB];
|
||||
@@ -92,48 +91,48 @@ struct oai_nw_drv_priv {
|
||||
struct timer_list timer;
|
||||
spinlock_t lock;
|
||||
struct net_device_stats stats;
|
||||
u8 retry_limit;
|
||||
u32 timer_establishment;
|
||||
u32 timer_release;
|
||||
uint8_t retry_limit;
|
||||
uint32_t timer_establishment;
|
||||
uint32_t timer_release;
|
||||
struct cx_entity cx[OAI_NW_DRV_CX_MAX];
|
||||
//struct classifier_entity *rclassifier[OAI_NW_DRV_DSCP_MAX]; // receive classifier
|
||||
u16 nrclassifier;
|
||||
uint16_t nrclassifier;
|
||||
int sap[OAI_NW_DRV_SAPI_MAX];
|
||||
struct sock *nl_sk;
|
||||
u8 nlmsg[OAI_NW_DRV_PRIMITIVE_MAX_LENGTH+sizeof(struct nlmsghdr)];
|
||||
u8 xbuffer[OAI_NW_DRV_PRIMITIVE_MAX_LENGTH]; // transmition buffer
|
||||
u8 rbuffer[OAI_NW_DRV_PRIMITIVE_MAX_LENGTH]; // reception buffer
|
||||
uint8_t nlmsg[OAI_NW_DRV_PRIMITIVE_MAX_LENGTH+sizeof(struct nlmsghdr)];
|
||||
uint8_t xbuffer[OAI_NW_DRV_PRIMITIVE_MAX_LENGTH]; // transmition buffer
|
||||
uint8_t rbuffer[OAI_NW_DRV_PRIMITIVE_MAX_LENGTH]; // reception buffer
|
||||
};
|
||||
|
||||
struct ipversion {
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
u8 reserved:4,
|
||||
uint8_t reserved:4,
|
||||
version:4;
|
||||
#else
|
||||
u8 version:4,
|
||||
uint8_t version:4,
|
||||
reserved:4;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct pdcp_data_req_header_s {
|
||||
unsigned int rb_id;
|
||||
unsigned int data_size;
|
||||
int inst;
|
||||
traffic_type_t traffic_type;
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
ip_traffic_type_t traffic_type;
|
||||
} pdcp_data_req_header_t;
|
||||
|
||||
typedef struct pdcp_data_ind_header_s {
|
||||
unsigned int rb_id;
|
||||
unsigned int data_size;
|
||||
int inst;
|
||||
int dummy;
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
ip_traffic_type_t dummy_traffic_type;
|
||||
} pdcp_data_ind_header_t;
|
||||
|
||||
|
||||
|
||||
extern struct net_device *oai_nw_drv_dev[OAI_NW_DRV_NB_INSTANCES_MAX];
|
||||
|
||||
extern u8 OAI_NW_DRV_NULL_IMEI[14];
|
||||
extern uint8_t OAI_NW_DRV_NULL_IMEI[14];
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ int oai_nw_drv_CTL_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
|
||||
/**
|
||||
\brief Find the IP traffic type (UNICAST, MULTICAST, BROADCAST) of the IP packet attached to sk_buff.
|
||||
*/
|
||||
traffic_type_t oai_nw_drv_find_traffic_type(struct sk_buff *skb);
|
||||
ip_traffic_type_t oai_nw_drv_find_traffic_type(struct sk_buff *skb);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 oai_nw_drv_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
uint8_t oai_nw_drv_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef OAI_NW_DRV_DEBUG_TOOL
|
||||
@@ -64,7 +64,7 @@ u8 oai_nw_drv_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 oai_nw_drv_TOOL_get_dscp4(struct iphdr *iph){
|
||||
uint8_t oai_nw_drv_TOOL_get_dscp4(struct iphdr *iph){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef OAI_NW_DRV_DEBUG_TOOL
|
||||
@@ -82,7 +82,7 @@ u8 oai_nw_drv_TOOL_get_dscp4(struct iphdr *iph){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
int oai_nw_drv_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, u8 plen){
|
||||
int oai_nw_drv_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, uint8_t plen){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef OAI_NW_DRV_DEBUG_TOOL
|
||||
@@ -126,7 +126,7 @@ int oai_nw_drv_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, u8
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
int oai_nw_drv_TOOL_network4(u32 *addr, u32 *prefix, u8 plen){
|
||||
int oai_nw_drv_TOOL_network4(uint32_t *addr, uint32_t *prefix, uint8_t plen){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef OAI_NW_DRV_DEBUG_TOOL
|
||||
@@ -158,9 +158,9 @@ int oai_nw_drv_TOOL_network4(u32 *addr, u32 *prefix, u8 plen){
|
||||
//}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 *oai_nw_drv_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
uint8_t *oai_nw_drv_TOOL_get_protocol6(struct ipv6hdr *iph, uint8_t *protocol){
|
||||
//---------------------------------------------------------------------------
|
||||
u16 size;
|
||||
uint16_t size;
|
||||
// Start debug information
|
||||
#ifdef OAI_NW_DRV_DEBUG_TOOL
|
||||
printk("OAI_NW_DRV_TOOL_GET_PROTOCOL6 - begin \n");
|
||||
@@ -187,16 +187,16 @@ u8 *oai_nw_drv_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
case IPPROTO_UDP:
|
||||
case IPPROTO_TCP:
|
||||
case IPPROTO_ICMPV6:
|
||||
return (u8 *)((u8 *)iph+size);
|
||||
return (uint8_t *)((uint8_t *)iph+size);
|
||||
case IPPROTO_HOPOPTS:
|
||||
case IPPROTO_ROUTING:
|
||||
case IPPROTO_DSTOPTS:
|
||||
*protocol=((u8 *)iph+size)[0];
|
||||
size+=((u8 *)iph+size)[1]*8+8;
|
||||
*protocol=((uint8_t *)iph+size)[0];
|
||||
size+=((uint8_t *)iph+size)[1]*8+8;
|
||||
break;
|
||||
case IPPROTO_FRAGMENT:
|
||||
*protocol=((u8 *)iph+size)[0];
|
||||
size+=((u8 *)iph+size)[1]+8;
|
||||
*protocol=((uint8_t *)iph+size)[0];
|
||||
size+=((uint8_t *)iph+size)[1]+8;
|
||||
break;
|
||||
case IPPROTO_NONE:
|
||||
case IPPROTO_AH:
|
||||
@@ -208,7 +208,7 @@ u8 *oai_nw_drv_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 *oai_nw_drv_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
uint8_t *oai_nw_drv_TOOL_get_protocol4(struct iphdr *iph, uint8_t *protocol){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef OAI_NW_DRV_DEBUG_TOOL
|
||||
@@ -233,7 +233,7 @@ u8 *oai_nw_drv_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
case IPPROTO_UDP:
|
||||
case IPPROTO_TCP:
|
||||
case IPPROTO_ICMP:
|
||||
return (u8 *)((u8 *)iph+iph->tot_len);
|
||||
return (uint8_t *)((uint8_t *)iph+iph->tot_len);
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@@ -241,7 +241,7 @@ u8 *oai_nw_drv_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Convert the IMEI to iid
|
||||
void oai_nw_drv_TOOL_imei2iid(u8 *imei, u8 *iid){
|
||||
void oai_nw_drv_TOOL_imei2iid(uint8_t *imei, uint8_t *iid){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef OAI_NW_DRV_DEBUG_TOOL
|
||||
@@ -325,11 +325,11 @@ char *oai_nw_drv_TOOL_get_udpmsg(struct udphdr *udph){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Compute the UDP checksum (the data size must be odd)
|
||||
u16 oai_nw_drv_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, u8 proto, u32 udplen, void *data){
|
||||
uint16_t oai_nw_drv_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, uint8_t proto, uint32_t udplen, void *data){
|
||||
//---------------------------------------------------------------------------
|
||||
u32 i;
|
||||
u16 *data16;
|
||||
u32 csum=0;
|
||||
uint32_t i;
|
||||
uint16_t *data16;
|
||||
uint32_t csum=0;
|
||||
|
||||
// Start debug information
|
||||
#ifdef OAI_NW_DRV_DEBUG_TOOL
|
||||
@@ -382,7 +382,7 @@ u16 oai_nw_drv_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, u8
|
||||
if (csum>0xffff)
|
||||
csum-=0xffff;
|
||||
}
|
||||
return htons((u16)(~csum)&0xffff);
|
||||
return htons((uint16_t)(~csum)&0xffff);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -583,12 +583,12 @@ void print_TOOL_pk_all(struct sk_buff *skb){
|
||||
}
|
||||
}*/
|
||||
|
||||
/*int oai_nw_drv_TOOL_inet_pton4(char *src, u32 *dst)
|
||||
/*int oai_nw_drv_TOOL_inet_pton4(char *src, uint32_t *dst)
|
||||
{
|
||||
u32 val;
|
||||
uint32_t val;
|
||||
int n;
|
||||
u8 c;
|
||||
u32 parts[4];
|
||||
uint8_t c;
|
||||
uint32_t parts[4];
|
||||
|
||||
c = *src;
|
||||
val=0;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Add a new classifier rule (send direction)
|
||||
struct classifier_entity *nas_CLASS_add_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
struct classifier_entity *nas_CLASS_add_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *gc;
|
||||
|
||||
@@ -93,8 +93,8 @@ struct classifier_entity *nas_CLASS_add_sclassifier(struct cx_entity *cx, u8 dsc
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Add a new classifier rule (receive direction)
|
||||
struct classifier_entity *nas_CLASS_add_rclassifier(u8 dscp,
|
||||
u16 classref,
|
||||
struct classifier_entity *nas_CLASS_add_rclassifier(uint8_t dscp,
|
||||
uint16_t classref,
|
||||
struct nas_priv *gpriv){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *gc;
|
||||
@@ -125,7 +125,7 @@ struct classifier_entity *nas_CLASS_add_rclassifier(u8 dscp,
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Add a new classifier rule (forwarding)
|
||||
struct classifier_entity *nas_CLASS_add_fclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
struct classifier_entity *nas_CLASS_add_fclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *gc;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -162,7 +162,7 @@ struct classifier_entity *nas_CLASS_add_fclassifier(struct cx_entity *cx, u8 dsc
|
||||
//---------------------------------------------------------------------------
|
||||
void nas_CLASS_flush_sclassifier(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 dscpi;
|
||||
uint8_t dscpi;
|
||||
struct classifier_entity *gc;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
printk("NAS_CLASS_FLUSH_SCLASSIFIER: begin\n");
|
||||
@@ -190,7 +190,7 @@ void nas_CLASS_flush_sclassifier(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
void nas_CLASS_flush_fclassifier(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 dscpi;
|
||||
uint8_t dscpi;
|
||||
struct classifier_entity *gc;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
printk("NAS_CLASS_FLUSH_FCLASSIFIER: begin\n");
|
||||
@@ -219,7 +219,7 @@ void nas_CLASS_flush_fclassifier(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
void nas_CLASS_flush_rclassifier(struct nas_priv *gpriv){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 dscpi;
|
||||
uint8_t dscpi;
|
||||
struct classifier_entity *gc;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
printk("NAS_CLASS_FLUSH_RCLASSIFIER: begin\n");
|
||||
@@ -240,7 +240,7 @@ void nas_CLASS_flush_rclassifier(struct nas_priv *gpriv){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a classifier rule (send direction)
|
||||
void nas_CLASS_del_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
void nas_CLASS_del_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *p,*np;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -280,7 +280,7 @@ void nas_CLASS_del_sclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a classifier rule (send direction)
|
||||
void nas_CLASS_del_fclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
void nas_CLASS_del_fclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *p,*np;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -320,7 +320,7 @@ void nas_CLASS_del_fclassifier(struct cx_entity *cx, u8 dscp, u16 classref){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a classifier rule (receive direction)
|
||||
void nas_CLASS_del_rclassifier(u8 dscp, u16 classref,struct nas_priv *gpriv){
|
||||
void nas_CLASS_del_rclassifier(uint8_t dscp, uint16_t classref,struct nas_priv *gpriv){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *p,*np;
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
@@ -438,7 +438,7 @@ struct cx_entity *nas_CLASS_cx4(struct sk_buff *skb,
|
||||
//---------------------------------------------------------------------------
|
||||
unsigned char cxi;
|
||||
unsigned char *addr;
|
||||
u32 daddr;
|
||||
uint32_t daddr;
|
||||
struct cx_entity *default_ip=NULL;
|
||||
struct classifier_entity *p=NULL;
|
||||
|
||||
@@ -566,9 +566,9 @@ struct cx_entity *nas_CLASS_MPLS(struct sk_buff *skb,
|
||||
void nas_CLASS_send(struct sk_buff *skb,int inst){
|
||||
//---------------------------------------------------------------------------
|
||||
struct classifier_entity *p, *sp;
|
||||
u8 *protocolh,version;
|
||||
u8 protocol, dscp, exp,label;
|
||||
u16 classref;
|
||||
uint8_t *protocolh,version;
|
||||
uint8_t protocol, dscp, exp,label;
|
||||
uint16_t classref;
|
||||
struct cx_entity *cx;
|
||||
unsigned int i;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#include <net/udp.h>
|
||||
|
||||
|
||||
void nas_COMMON_receive(u16 dlen,
|
||||
void nas_COMMON_receive(uint16_t dlen,
|
||||
void *pdcp_sdu,
|
||||
int inst,
|
||||
struct classifier_entity *rclass,
|
||||
@@ -65,7 +65,7 @@ void nas_COMMON_receive(u16 dlen,
|
||||
struct sk_buff *skb;
|
||||
struct ipversion *ipv;
|
||||
struct nas_priv *gpriv=netdev_priv(nasdev[inst]);
|
||||
u32 odaddr,osaddr;
|
||||
uint32_t odaddr,osaddr;
|
||||
|
||||
int i;
|
||||
|
||||
@@ -75,7 +75,7 @@ void nas_COMMON_receive(u16 dlen,
|
||||
|
||||
struct udphdr *uh;
|
||||
struct tcphdr *th;
|
||||
u16 *cksum,check;
|
||||
uint16_t *cksum,check;
|
||||
|
||||
struct iphdr *network_header;
|
||||
|
||||
@@ -244,10 +244,10 @@ void nas_COMMON_receive(u16 dlen,
|
||||
case IPPROTO_TCP:
|
||||
|
||||
#ifdef KERNEL_VERSION_GREATER_THAN_2622
|
||||
cksum = (u16*)&(((struct tcphdr*)((network_header + (network_header->ihl<<2))))->check);
|
||||
cksum = (uint16_t*)&(((struct tcphdr*)((network_header + (network_header->ihl<<2))))->check);
|
||||
//check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
|
||||
#else
|
||||
cksum = (u16*)&(((struct tcphdr*)((skb->data + (skb->nh.iph->ihl<<2))))->check);
|
||||
cksum = (uint16_t*)&(((struct tcphdr*)((skb->data + (skb->nh.iph->ihl<<2))))->check);
|
||||
//check = csum_tcpudp_magic(((struct iphdr *)skb->data)->saddr, ((struct iphdr *)skb->data)->daddr,tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
|
||||
#endif
|
||||
|
||||
@@ -274,10 +274,10 @@ void nas_COMMON_receive(u16 dlen,
|
||||
case IPPROTO_UDP:
|
||||
|
||||
#ifdef KERNEL_VERSION_GREATER_THAN_2622
|
||||
cksum = (u16*)&(((struct udphdr*)((network_header + (network_header->ihl<<2))))->check);
|
||||
cksum = (uint16_t*)&(((struct udphdr*)((network_header + (network_header->ihl<<2))))->check);
|
||||
// check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, udp_hdr(skb)->len, IPPROTO_UDP, ~(*cksum));
|
||||
#else
|
||||
cksum = (u16*)&(((struct udphdr*)((skb->data + (skb->nh.iph->ihl<<2))))->check);
|
||||
cksum = (uint16_t*)&(((struct udphdr*)((skb->data + (skb->nh.iph->ihl<<2))))->check);
|
||||
//check = csum_tcpudp_magic(((struct iphdr *)skb->data)->saddr, ((struct iphdr *)skb->data)->daddr, udp_hdr(skb)->len, IPPROTO_UDP, ~(*cksum));
|
||||
#endif
|
||||
#ifdef NAS_DEBUG_RECEIVE
|
||||
@@ -477,7 +477,7 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class
|
||||
//---------------------------------------------------------------------------
|
||||
void nas_COMMON_QOS_receive(){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 sapi;
|
||||
uint8_t sapi;
|
||||
struct pdcp_data_ind_header_s pdcph;
|
||||
unsigned char data_buffer[2048];
|
||||
struct classifier_entity *rclass;
|
||||
@@ -670,7 +670,7 @@ void nas_COMMON_flush_rb(struct cx_entity *cx){
|
||||
//---------------------------------------------------------------------------
|
||||
struct rb_entity *rb;
|
||||
struct classifier_entity *gc;
|
||||
u8 dscp;
|
||||
uint8_t dscp;
|
||||
// End debug information
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
printk("NAS_COMMON_FLUSH_RB - begin\n");
|
||||
|
||||
@@ -74,7 +74,7 @@ extern int nas_netlink_init(void);
|
||||
|
||||
//int bytes_wrote;
|
||||
//int bytes_read;
|
||||
u8 NULL_IMEI[14]={0x05, 0x04, 0x03, 0x01, 0x02 ,0x00, 0x00, 0x00, 0x05, 0x04, 0x03 ,0x00, 0x01, 0x08};
|
||||
uint8_t NULL_IMEI[14]={0x05, 0x04, 0x03, 0x01, 0x02 ,0x00, 0x00, 0x00, 0x05, 0x04, 0x03 ,0x00, 0x01, 0x08};
|
||||
|
||||
|
||||
static unsigned int nas_IMEI[6]={0x03, 0x01, 0x02 ,0x00, 0x00, 0x00}; // may change to char
|
||||
@@ -98,7 +98,7 @@ int find_inst(struct net_device *dev) {
|
||||
//void interrupt(void){
|
||||
void *nas_interrupt(void){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
|
||||
// struct nas_priv *priv=netdev_priv(dev_id);
|
||||
// unsigned int flags;
|
||||
@@ -325,7 +325,7 @@ static const struct net_device_ops nasmesh_netdev_ops = {
|
||||
// Initialisation of the network device
|
||||
void nas_init(struct net_device *dev){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi, dscpi;
|
||||
uint8_t cxi, dscpi;
|
||||
struct nas_priv *priv;
|
||||
// int inst;
|
||||
|
||||
@@ -398,7 +398,7 @@ void nas_init(struct net_device *dev){
|
||||
priv->cx[cxi].nsclassifier=0;
|
||||
priv->cx[cxi].nfclassifier=0;
|
||||
// initialisation of the IP address
|
||||
// TOOL_imei2iid(IMEI, (u8 *)priv->cx[cxi].iid6);
|
||||
// TOOL_imei2iid(IMEI, (uint8_t *)priv->cx[cxi].iid6);
|
||||
priv->cx[cxi].iid4=0;
|
||||
//
|
||||
}
|
||||
@@ -407,10 +407,10 @@ void nas_init(struct net_device *dev){
|
||||
#ifdef ADDRCONF
|
||||
#ifdef NETLINK
|
||||
nas_TOOL_imei2iid(IMEI, dev->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
|
||||
nas_TOOL_imei2iid(IMEI, (u8 *)priv->cx[0].iid6);
|
||||
nas_TOOL_imei2iid(IMEI, (uint8_t *)priv->cx[0].iid6);
|
||||
#else
|
||||
nas_TOOL_imei2iid(nas_IMEI, dev->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
|
||||
nas_TOOL_imei2iid(nas_IMEI, (u8 *)priv->cx[0].iid6);
|
||||
nas_TOOL_imei2iid(nas_IMEI, (uint8_t *)priv->cx[0].iid6);
|
||||
#endif
|
||||
// this is more appropriate for user space soft realtime emulation
|
||||
#else
|
||||
@@ -419,7 +419,7 @@ void nas_init(struct net_device *dev){
|
||||
|
||||
((unsigned char*)dev->dev_addr)[7] = (unsigned char)find_inst(dev);
|
||||
|
||||
memcpy((u8 *)priv->cx[0].iid6,&nas_IMEI[0],8);
|
||||
memcpy((uint8_t *)priv->cx[0].iid6,&nas_IMEI[0],8);
|
||||
|
||||
printk("INIT: init IMEI to IID\n");
|
||||
#endif
|
||||
@@ -477,7 +477,7 @@ int init_module (void) {
|
||||
nas_mesh_init(inst);
|
||||
//memcpy(nasdev[inst]->dev_addr,&nas_IMEI[0],8);
|
||||
nas_TOOL_imei2iid(nas_IMEI, nasdev[inst]->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
|
||||
nas_TOOL_imei2iid(nas_IMEI, (u8 *)priv->cx[0].iid6);
|
||||
nas_TOOL_imei2iid(nas_IMEI, (uint8_t *)priv->cx[0].iid6);
|
||||
// TO HAVE DIFFERENT HW @
|
||||
((unsigned char*)nasdev[inst]->dev_addr)[7] = ((unsigned char*)nasdev[inst]->dev_addr)[7] + (unsigned char)inst + 1;
|
||||
printk("Setting HW addr for INST %d to : %X%X\n",inst,*((unsigned int *)&nasdev[inst]->dev_addr[0]),*((unsigned int *)&nasdev[inst]->dev_addr[4]));
|
||||
|
||||
@@ -70,7 +70,7 @@ int nas_ioCTL_statistic_request(struct nas_ioctl *gifr,
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Connections List
|
||||
//---------------------------------------------------------------------------
|
||||
void nas_set_msg_cx_list_reply(u8 *msgrep,
|
||||
void nas_set_msg_cx_list_reply(uint8_t *msgrep,
|
||||
struct nas_priv *priv){
|
||||
//---------------------------------------------------------------------------
|
||||
struct cx_entity *cx;
|
||||
@@ -97,7 +97,7 @@ void nas_set_msg_cx_list_reply(u8 *msgrep,
|
||||
int nas_ioCTL_cx_list_request(struct nas_ioctl *gifr,
|
||||
struct nas_priv *priv){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 msgrep[NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1];
|
||||
uint8_t msgrep[NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1];
|
||||
printk("NAS_IOCTL_CX_LIST: connection list requested\n");
|
||||
nas_set_msg_cx_list_reply(msgrep,priv);
|
||||
if (copy_to_user(gifr->msg, msgrep, NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1))
|
||||
@@ -190,7 +190,7 @@ int nas_ioCTL_cx_release_request(struct nas_ioctl *gifr,struct nas_priv *priv){
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Radio Bearer List
|
||||
//---------------------------------------------------------------------------
|
||||
void nas_set_msg_rb_list_reply(u8 *msgrep,
|
||||
void nas_set_msg_rb_list_reply(uint8_t *msgrep,
|
||||
struct nas_msg_rb_list_request *msgreq,
|
||||
struct nas_priv *priv){
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -198,7 +198,7 @@ void nas_set_msg_rb_list_reply(u8 *msgrep,
|
||||
cx=nas_COMMON_search_cx(msgreq->lcr,priv);
|
||||
if (cx!=NULL)
|
||||
{
|
||||
u8 rbi;
|
||||
uint8_t rbi;
|
||||
struct rb_entity *rb;
|
||||
struct nas_msg_rb_list_reply *list;
|
||||
if (cx->num_rb > NAS_LIST_RB_MAX)
|
||||
@@ -222,7 +222,7 @@ void nas_set_msg_rb_list_reply(u8 *msgrep,
|
||||
int nas_ioCTL_rb_list_request(struct nas_ioctl *gifr,
|
||||
struct nas_priv *priv){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 msgrep[NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1];
|
||||
uint8_t msgrep[NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1];
|
||||
struct nas_msg_rb_list_request msgreq;
|
||||
printk("NAS_IOCTL_RB_LIST: Radio Bearer list requested\n");
|
||||
if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq)))
|
||||
@@ -342,14 +342,14 @@ int nas_ioCTL_rb_release_request(struct nas_ioctl *gifr,
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Classifier List
|
||||
//---------------------------------------------------------------------------
|
||||
void nas_set_msg_class_list_reply(u8 *msgrep,
|
||||
void nas_set_msg_class_list_reply(uint8_t *msgrep,
|
||||
struct nas_msg_class_list_request *msgreq,
|
||||
struct nas_priv *priv){
|
||||
//---------------------------------------------------------------------------
|
||||
struct cx_entity *cx;
|
||||
struct classifier_entity *gc;
|
||||
struct nas_msg_class_list_reply *list;
|
||||
u8 cli;
|
||||
uint8_t cli;
|
||||
list=(struct nas_msg_class_list_reply *)(msgrep+1);
|
||||
switch(msgreq->dir)
|
||||
{
|
||||
@@ -404,7 +404,7 @@ void nas_set_msg_class_list_reply(u8 *msgrep,
|
||||
int nas_ioCTL_class_list_request(struct nas_ioctl *gifr,
|
||||
struct nas_priv *priv){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 msgrep[NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1];
|
||||
uint8_t msgrep[NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1];
|
||||
struct nas_msg_class_list_request msgreq;
|
||||
printk("NAS_IOCTL_CLASS_LIST: classifier list requested\n");
|
||||
if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq)))
|
||||
|
||||
@@ -76,27 +76,27 @@ struct rb_entity
|
||||
nasRadioBearerId_t rab_id;
|
||||
nasSapId_t sapi;
|
||||
nasQoSTrafficClass_t qos;
|
||||
u8 state;
|
||||
u8 retry;
|
||||
u32 countimer;
|
||||
uint8_t state;
|
||||
uint8_t retry;
|
||||
uint32_t countimer;
|
||||
struct rb_entity *next;
|
||||
};
|
||||
|
||||
struct cx_entity{
|
||||
int sap[NAS_SAPI_CX_MAX];
|
||||
u8 state; // state of the connection
|
||||
uint8_t state; // state of the connection
|
||||
nasLocalConnectionRef_t lcr; // Local connection reference
|
||||
nasCellID_t cellid; // cell identification
|
||||
u32 countimer; // timeout's counter
|
||||
u8 retry; // number of retransmission
|
||||
uint32_t countimer; // timeout's counter
|
||||
uint8_t retry; // number of retransmission
|
||||
struct classifier_entity *sclassifier[NAS_DSCP_MAX]; // send classifier;
|
||||
struct classifier_entity *fclassifier[NAS_DSCP_MAX]; // send classifier;
|
||||
u16 nsclassifier;
|
||||
u16 nfclassifier;
|
||||
u32 iid6[2]; // IPv6 interface identification
|
||||
u8 iid4; // IPv4 interface identification
|
||||
uint16_t nsclassifier;
|
||||
uint16_t nfclassifier;
|
||||
uint32_t iid6[2]; // IPv6 interface identification
|
||||
uint8_t iid4; // IPv4 interface identification
|
||||
struct rb_entity *rb;
|
||||
u16 num_rb;
|
||||
uint16_t num_rb;
|
||||
int lastRRCprimitive;
|
||||
//measures
|
||||
int req_prov_id[MAX_MEASURE_NB];
|
||||
@@ -109,24 +109,24 @@ struct cx_entity{
|
||||
|
||||
struct classifier_entity
|
||||
{
|
||||
u32 classref;
|
||||
uint32_t classref;
|
||||
struct classifier_entity *next;
|
||||
u8 version;
|
||||
uint8_t version;
|
||||
union{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
} saddr; // IP source address
|
||||
u8 splen; // prefix length
|
||||
uint8_t splen; // prefix length
|
||||
union{
|
||||
struct in6_addr ipv6;
|
||||
u32 ipv4;
|
||||
uint32_t ipv4;
|
||||
unsigned int mpls_label;
|
||||
} daddr; // IP destination address
|
||||
u8 dplen; // prefix length
|
||||
u8 protocol; // high layer protocol type
|
||||
uint8_t dplen; // prefix length
|
||||
uint8_t protocol; // high layer protocol type
|
||||
unsigned char protocol_message_type;
|
||||
u16 sport; // source port
|
||||
u16 dport; // destination port
|
||||
uint16_t sport; // source port
|
||||
uint16_t dport; // destination port
|
||||
struct rb_entity *rb; //pointer to rb_entity for sending function or receiving in case of forwarding rule
|
||||
struct rb_entity *rb_rx; //pointer to rb_entity for receiving (in case of forwarding rule)
|
||||
nasRadioBearerId_t rab_id; // RAB identification for sending
|
||||
@@ -144,25 +144,25 @@ struct nas_priv
|
||||
struct timer_list timer;
|
||||
spinlock_t lock;
|
||||
struct net_device_stats stats;
|
||||
u8 retry_limit;
|
||||
u32 timer_establishment;
|
||||
u32 timer_release;
|
||||
uint8_t retry_limit;
|
||||
uint32_t timer_establishment;
|
||||
uint32_t timer_release;
|
||||
struct cx_entity cx[NAS_CX_MAX];
|
||||
struct classifier_entity *rclassifier[NAS_DSCP_MAX]; // receive classifier
|
||||
u16 nrclassifier;
|
||||
uint16_t nrclassifier;
|
||||
int sap[NAS_SAPI_MAX];
|
||||
struct sock *nl_sk;
|
||||
u8 nlmsg[NAS_MAX_LENGTH+sizeof(struct nlmsghdr)];
|
||||
u8 xbuffer[NAS_MAX_LENGTH]; // transmition buffer
|
||||
u8 rbuffer[NAS_MAX_LENGTH]; // reception buffer
|
||||
uint8_t nlmsg[NAS_MAX_LENGTH+sizeof(struct nlmsghdr)];
|
||||
uint8_t xbuffer[NAS_MAX_LENGTH]; // transmition buffer
|
||||
uint8_t rbuffer[NAS_MAX_LENGTH]; // reception buffer
|
||||
};
|
||||
|
||||
struct ipversion {
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
u8 reserved:4,
|
||||
uint8_t reserved:4,
|
||||
version:4;
|
||||
#else
|
||||
u8 version:4,
|
||||
uint8_t version:4,
|
||||
reserved:4;
|
||||
#endif
|
||||
};
|
||||
@@ -171,26 +171,26 @@ typedef struct pdcp_data_req_header_s {
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
traffic_type_t traffic_type;
|
||||
ip_traffic_type_t traffic_type;
|
||||
} pdcp_data_req_header_t;
|
||||
|
||||
typedef struct pdcp_data_ind_header_s {
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
traffic_type_t dummy_traffic_type;
|
||||
ip_traffic_type_t dummy_traffic_type;
|
||||
} pdcp_data_ind_header_t;
|
||||
|
||||
extern struct net_device *nasdev[NB_INSTANCES_MAX];
|
||||
//extern int bytes_wrote;
|
||||
//extern int bytes_read;
|
||||
|
||||
extern u8 NAS_NULL_IMEI[14];
|
||||
extern uint8_t NAS_NULL_IMEI[14];
|
||||
|
||||
//global variables shared with RRC
|
||||
#ifndef NAS_NETLINK
|
||||
extern int pdcp_2_nas_irq;
|
||||
#endif
|
||||
//extern u8 nas_IMEI[14];
|
||||
//extern uint8_t nas_IMEI[14];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -150,7 +150,7 @@ void nas_mesh_start_default_sclassifier(struct cx_entity *cx,struct rb_entity *r
|
||||
//---------------------------------------------------------------------------
|
||||
void nas_mesh_timer(unsigned long data,struct nas_priv *gpriv){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 cxi;
|
||||
uint8_t cxi;
|
||||
struct cx_entity *cx;
|
||||
struct rb_entity *rb;
|
||||
// spin_lock(&gpriv->lock);
|
||||
@@ -324,7 +324,7 @@ int nas_mesh_DC_send_cx_release_request(struct cx_entity *cx,
|
||||
{
|
||||
cx->state=NAS_IDLE;
|
||||
cx->iid4=0;
|
||||
// nas_TOOL_imei2iid(NAS_NULL_IMEI, (u8 *)cx->iid6);
|
||||
// nas_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)cx->iid6);
|
||||
nas_COMMON_flush_rb(cx);
|
||||
|
||||
#ifdef NAS_DEBUG_DC
|
||||
@@ -424,11 +424,11 @@ void nas_mesh_DC_send_sig_data_request(struct sk_buff *skb,
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Request the transfer of data (DC SAP)
|
||||
void nas_mesh_DC_send_peer_sig_data_request(struct cx_entity *cx, u8 sig_category,
|
||||
void nas_mesh_DC_send_peer_sig_data_request(struct cx_entity *cx, uint8_t sig_category,
|
||||
struct nas_priv *gpriv){
|
||||
//---------------------------------------------------------------------------
|
||||
struct nas_ue_dc_element *p;
|
||||
u8 nas_data[10];
|
||||
uint8_t nas_data[10];
|
||||
unsigned int nas_length;
|
||||
char data_type = 'Z';
|
||||
int bytes_wrote=0;
|
||||
@@ -488,7 +488,7 @@ void nas_mesh_DC_send_peer_sig_data_request(struct cx_entity *cx, u8 sig_categor
|
||||
// Decode CONN_ESTABLISH_RESP message from RRC
|
||||
void nas_mesh_DC_decode_cx_establish_resp(struct cx_entity *cx, struct nas_ue_dc_element *p,struct nas_priv *gpriv){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 sig_category;
|
||||
uint8_t sig_category;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("NAS_MESH_DC_DECODE_CX_ESTABLISH - begin \n");
|
||||
@@ -510,7 +510,7 @@ void nas_mesh_DC_decode_cx_establish_resp(struct cx_entity *cx, struct nas_ue_dc
|
||||
if (p->nasUEDCPrimitive.conn_establish_resp.status == TERMINATED){
|
||||
cx->state=NAS_CX_DCH; //to be changed to NAS_CX_FACH
|
||||
cx->iid4=1;
|
||||
//nas_TOOL_imei2iid(NAS_RG_IMEI, (u8 *)cx->iid6);
|
||||
//nas_TOOL_imei2iid(NAS_RG_IMEI, (uint8_t *)cx->iid6);
|
||||
sig_category = NAS_CMD_OPEN_RB;
|
||||
//For demo, add automatically a radio bearer
|
||||
#ifdef DEMO_3GSM
|
||||
@@ -551,7 +551,7 @@ void nas_mesh_DC_decode_cx_loss_ind(struct cx_entity *cx, struct nas_ue_dc_eleme
|
||||
// End debug information
|
||||
cx->state=NAS_IDLE;
|
||||
cx->iid4=0;
|
||||
//nas_TOOL_imei2iid(NAS_NULL_IMEI, (u8 *)cx->iid6);
|
||||
//nas_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)cx->iid6);
|
||||
nas_COMMON_flush_rb(cx);
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("NAS_MESH_DC_RECEIVE: CONN_LOSS_IND reception\n");
|
||||
@@ -606,7 +606,7 @@ void nas_mesh_DC_decode_sig_data_ind(struct cx_entity *cx, struct nas_ue_dc_elem
|
||||
printk(" Local Connection reference %u\n",p->nasUEDCPrimitive.data_transfer_ind.localConnectionRef);
|
||||
printk(" Signaling Priority %u\n",p->nasUEDCPrimitive.data_transfer_ind.priority);
|
||||
printk(" NAS Data length %u\n",p->nasUEDCPrimitive.data_transfer_ind.nasDataLength);
|
||||
printk(" NAS Data string %s\n", (u8 *)p+p->length);
|
||||
printk(" NAS Data string %s\n", (uint8_t *)p+p->length);
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -696,7 +696,7 @@ void nas_mesh_DC_decode_rb_release_ind(struct cx_entity *cx, struct nas_ue_dc_el
|
||||
// Decode MEASUREMENT_IND message from RRC
|
||||
void nas_mesh_DC_decode_measurement_ind(struct cx_entity *cx, struct nas_ue_dc_element *p){
|
||||
//---------------------------------------------------------------------------
|
||||
u8 i;
|
||||
uint8_t i;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_DC
|
||||
printk("NAS_MESH_DC_DECODE_MEASUREMENT_IND - begin \n");
|
||||
@@ -765,7 +765,7 @@ int nas_mesh_DC_receive(struct cx_entity *cx,struct nas_priv *gpriv){
|
||||
//get the rest of the primitive
|
||||
#ifdef NAS_NETLINK
|
||||
#else
|
||||
// bytes_read += rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI], (u8 *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
// bytes_read += rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
#endif
|
||||
if (bytes_read!=p->length){
|
||||
printk("NAS_MESH_DC_RECEIVE: Problem while reading primitive header\n");
|
||||
@@ -881,7 +881,7 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv){
|
||||
//get the rest of the primitive
|
||||
#ifdef NAS_NETLINK
|
||||
#else
|
||||
// bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (u8 *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
// bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
|
||||
#endif
|
||||
if (bytes_read!=p->length)
|
||||
{
|
||||
@@ -894,7 +894,7 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv){
|
||||
case INFO_BROADCAST_IND :
|
||||
#ifdef NAS_NETLINK
|
||||
#else
|
||||
// bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (u8 *)p+p->length, p->nasUEGCPrimitive.broadcast_ind.nasDataLength);
|
||||
// bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+p->length, p->nasUEGCPrimitive.broadcast_ind.nasDataLength);
|
||||
#endif
|
||||
if (bytes_read!=p->length+p->nasUEGCPrimitive.broadcast_ind.nasDataLength)
|
||||
{
|
||||
@@ -905,7 +905,7 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv){
|
||||
printk("NAS_MESH_GC_RECEIVE: INFO_BROADCAST_IND reception\n");
|
||||
printk(" Primitive length %d \n", (int)(p->type));
|
||||
printk(" Data length %u\n", p->nasUEGCPrimitive.broadcast_ind.nasDataLength);
|
||||
printk(" Data string %s\n", (u8 *)p+p->length);
|
||||
printk(" Data string %s\n", (uint8_t *)p+p->length);
|
||||
#endif //NAS_DEBUG_GC
|
||||
return bytes_read;
|
||||
default :
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
void nas_TOOL_fct(struct classifier_entity *gc, u8 fct){
|
||||
void nas_TOOL_fct(struct classifier_entity *gc, uint8_t fct){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -76,7 +76,7 @@ void nas_TOOL_fct(struct classifier_entity *gc, u8 fct){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nas_TOOL_invfct(struct classifier_entity *gc){
|
||||
uint8_t nas_TOOL_invfct(struct classifier_entity *gc){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -102,7 +102,7 @@ u8 nas_TOOL_invfct(struct classifier_entity *gc){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nas_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
uint8_t nas_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -121,7 +121,7 @@ u8 nas_TOOL_get_dscp6(struct ipv6hdr *iph){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 nas_TOOL_get_dscp4(struct iphdr *iph){
|
||||
uint8_t nas_TOOL_get_dscp4(struct iphdr *iph){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -139,7 +139,7 @@ u8 nas_TOOL_get_dscp4(struct iphdr *iph){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
int nas_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, u8 plen){
|
||||
int nas_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, uint8_t plen){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -183,7 +183,7 @@ int nas_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, u8 plen){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
int nas_TOOL_network4(u32 *addr, u32 *prefix, u8 plen){
|
||||
int nas_TOOL_network4(uint32_t *addr, uint32_t *prefix, uint8_t plen){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -215,9 +215,9 @@ int nas_TOOL_network4(u32 *addr, u32 *prefix, u8 plen){
|
||||
//}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 *nas_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
uint8_t *nas_TOOL_get_protocol6(struct ipv6hdr *iph, uint8_t *protocol){
|
||||
//---------------------------------------------------------------------------
|
||||
u16 size;
|
||||
uint16_t size;
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
printk("NAS_TOOL_GET_PROTOCOL6 - begin \n");
|
||||
@@ -244,16 +244,16 @@ u8 *nas_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
case IPPROTO_UDP:
|
||||
case IPPROTO_TCP:
|
||||
case IPPROTO_ICMPV6:
|
||||
return (u8 *)((u8 *)iph+size);
|
||||
return (uint8_t *)((uint8_t *)iph+size);
|
||||
case IPPROTO_HOPOPTS:
|
||||
case IPPROTO_ROUTING:
|
||||
case IPPROTO_DSTOPTS:
|
||||
*protocol=((u8 *)iph+size)[0];
|
||||
size+=((u8 *)iph+size)[1]*8+8;
|
||||
*protocol=((uint8_t *)iph+size)[0];
|
||||
size+=((uint8_t *)iph+size)[1]*8+8;
|
||||
break;
|
||||
case IPPROTO_FRAGMENT:
|
||||
*protocol=((u8 *)iph+size)[0];
|
||||
size+=((u8 *)iph+size)[1]+8;
|
||||
*protocol=((uint8_t *)iph+size)[0];
|
||||
size+=((uint8_t *)iph+size)[1]+8;
|
||||
break;
|
||||
case IPPROTO_NONE:
|
||||
case IPPROTO_AH:
|
||||
@@ -265,7 +265,7 @@ u8 *nas_TOOL_get_protocol6(struct ipv6hdr *iph, u8 *protocol){
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
u8 *nas_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
uint8_t *nas_TOOL_get_protocol4(struct iphdr *iph, uint8_t *protocol){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -290,7 +290,7 @@ u8 *nas_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
case IPPROTO_UDP:
|
||||
case IPPROTO_TCP:
|
||||
case IPPROTO_ICMP:
|
||||
return (u8 *)((u8 *)iph+iph->tot_len);
|
||||
return (uint8_t *)((uint8_t *)iph+iph->tot_len);
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@@ -298,7 +298,7 @@ u8 *nas_TOOL_get_protocol4(struct iphdr *iph, u8 *protocol){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Convert the IMEI to iid
|
||||
void nas_TOOL_imei2iid(u8 *imei, u8 *iid){
|
||||
void nas_TOOL_imei2iid(uint8_t *imei, uint8_t *iid){
|
||||
//---------------------------------------------------------------------------
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -353,11 +353,11 @@ char *nas_TOOL_get_udpmsg(struct udphdr *udph){
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Compute the UDP checksum (the data size must be odd)
|
||||
u16 nas_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, u8 proto, u32 udplen, void *data){
|
||||
uint16_t nas_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, uint8_t proto, uint32_t udplen, void *data){
|
||||
//---------------------------------------------------------------------------
|
||||
u32 i;
|
||||
u16 *data16;
|
||||
u32 csum=0;
|
||||
uint32_t i;
|
||||
uint16_t *data16;
|
||||
uint32_t csum=0;
|
||||
|
||||
// Start debug information
|
||||
#ifdef NAS_DEBUG_TOOL
|
||||
@@ -410,7 +410,7 @@ u16 nas_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, u8 proto,
|
||||
if (csum>0xffff)
|
||||
csum-=0xffff;
|
||||
}
|
||||
return htons((u16)(~csum)&0xffff);
|
||||
return htons((uint16_t)(~csum)&0xffff);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -611,12 +611,12 @@ void print_TOOL_pk_all(struct sk_buff *skb){
|
||||
}
|
||||
}*/
|
||||
|
||||
/*int nas_TOOL_inet_pton4(char *src, u32 *dst)
|
||||
/*int nas_TOOL_inet_pton4(char *src, uint32_t *dst)
|
||||
{
|
||||
u32 val;
|
||||
uint32_t val;
|
||||
int n;
|
||||
u8 c;
|
||||
u32 parts[4];
|
||||
uint8_t c;
|
||||
uint32_t parts[4];
|
||||
|
||||
c = *src;
|
||||
val=0;
|
||||
@@ -655,7 +655,7 @@ void print_TOOL_pk_all(struct sk_buff *skb){
|
||||
}*/
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
void print_TOOL_state(u8 state){
|
||||
void print_TOOL_state(uint8_t state){
|
||||
//---------------------------------------------------------------------------
|
||||
// case NAS_STATE_IDLE:printk(" State NAS_STATE_IDLE\n");return;
|
||||
// case NAS_STATE_CONNECTED:printk(" State NAS_STATE_CONNECTED\n");return;
|
||||
|
||||
@@ -33,8 +33,8 @@ void nasrg_rrm_from_rrc_read (void);
|
||||
|
||||
int nasrg_meas_loop (int time, int UE_Id);
|
||||
void nas_rg_print_buffer (char *buffer, int length);
|
||||
/*void nasrg_print_meas_report (char *rrc_rrm_meas_payload, u16 type);
|
||||
void nasrg_print_bs_meas_report (char *rrc_rrm_meas_payload, u16 type);*/
|
||||
/*void nasrg_print_meas_report (char *rrc_rrm_meas_payload, uint16_t type);
|
||||
void nasrg_print_bs_meas_report (char *rrc_rrm_meas_payload, uint16_t type);*/
|
||||
void nasrg_print_meas_report (char *rrc_rrm_meas_payload, unsigned short type);
|
||||
void nasrg_print_bs_meas_report (char *rrc_rrm_meas_payload, unsigned short type);
|
||||
#endif
|
||||
|
||||
@@ -230,8 +230,8 @@ void nasrg_send_meas_request_to_rrc (int ue_id, struct rrc_rrm_measure_ctl *rrm_
|
||||
meas_request.period = rrm_control->period;
|
||||
|
||||
// send to RRC
|
||||
count = write(rrc_rg_rrm_in_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) & meas_request, sizeof (measurement_request));
|
||||
count = write(rrc_rg_rrm_in_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) & meas_request, sizeof (measurement_request));
|
||||
if (count > 0) {
|
||||
printf ("RRM message sent successfully on RRM FIFO, length: %d\n", count);
|
||||
} else {
|
||||
@@ -423,7 +423,7 @@ int nasrg_meas_loop (int time, int UE_Id){
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//void rrc_rg_print_meas_report (struct rrc_rg_mt_meas_rep *p){
|
||||
void nasrg_print_meas_report (char *rrc_rrm_meas_payload, u16 type){
|
||||
void nasrg_print_meas_report (char *rrc_rrm_meas_payload, uint16_t type){
|
||||
//-----------------------------------------------------------------------------
|
||||
int i, j;
|
||||
char *payload[20] =
|
||||
@@ -494,7 +494,7 @@ void nasrg_print_meas_report (char *rrc_rrm_meas_payload, u16 type){
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void nasrg_print_bs_meas_report (char *rrc_rrm_meas_payload, u16 type){
|
||||
void nasrg_print_bs_meas_report (char *rrc_rrm_meas_payload, uint16_t type){
|
||||
//-----------------------------------------------------------------------------
|
||||
int i, j;
|
||||
char *payload[20] =
|
||||
|
||||
@@ -84,11 +84,11 @@ void rrm_connection_response (void){
|
||||
response.equipment_id = 0;
|
||||
response.status = STATUS_CONNECTION_ACCEPTED;
|
||||
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) & response, sizeof (connection_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) sim_data, strlen (sim_data));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) & response, sizeof (connection_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) sim_data, strlen (sim_data));
|
||||
if (count > 0) {
|
||||
printf ("RRM message sent successfully on RRM FIFO, length: %d\n", count);
|
||||
} else {
|
||||
@@ -114,11 +114,11 @@ void rrm_add_user_response (char *rcve_buffer){
|
||||
response.tx_id = request->tx_id;
|
||||
response.status = ADD_USER_SUCCESSFUL;
|
||||
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) & response, sizeof (add_user_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) sim_data, strlen (sim_data));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) & response, sizeof (add_user_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) sim_data, strlen (sim_data));
|
||||
if (count > 0) {
|
||||
printf ("RRM message sent successfully on RRM FIFO, length: %d\n", count);
|
||||
} else {
|
||||
@@ -144,11 +144,11 @@ void rrm_remove_user_response (char *rcve_buffer){
|
||||
response.tx_id = request->tx_id;
|
||||
response.status = REMOVE_USER_SUCCESSFUL;
|
||||
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) & response, sizeof (remove_user_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) sim_data, strlen (sim_data));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) & response, sizeof (remove_user_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) sim_data, strlen (sim_data));
|
||||
if (count > 0) {
|
||||
printf ("RRM message sent successfully on RRM FIFO, length: %d\n", count);
|
||||
} else {
|
||||
@@ -180,11 +180,11 @@ void rrm_add_radio_access_bearer_response (char *rcve_buffer){
|
||||
response.tx_id = request->tx_id;
|
||||
response.status = ADD_RADIO_ACCESS_BEARER_SUCCESSFUL;
|
||||
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) & response, sizeof (add_radio_access_bearer_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) sim_data, strlen (sim_data));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) & response, sizeof (add_radio_access_bearer_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) sim_data, strlen (sim_data));
|
||||
if (count > 0) {
|
||||
printf ("RRM message sent successfully on RRM FIFO, length: %d\n", count);
|
||||
} else {
|
||||
@@ -227,11 +227,11 @@ void rrm_remove_radio_access_bearer_response (char *rcve_buffer){
|
||||
response.tx_id = request->tx_id;
|
||||
response.status = REMOVE_RADIO_ACCESS_BEARER_SUCCESSFUL;
|
||||
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) & response, sizeof (remove_radio_access_bearer_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (u8 *) sim_data, strlen (sim_data));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
//count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (uint8_t *) & confirm, sizeof (add_user_confirm));
|
||||
count = write(rrc_rg_rrm_in_fifo, (uint8_t *) & rpc_mess, sizeof (rpc_message));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) & response, sizeof (remove_radio_access_bearer_response));
|
||||
count += write(rrc_rg_rrm_in_fifo, (uint8_t *) sim_data, strlen (sim_data));
|
||||
if (count > 0) {
|
||||
printf ("RRM message sent successfully on RRM FIFO, length: %d\n", count);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user