summaryrefslogtreecommitdiff
path: root/src/ipcpd/shim-eth-llc/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/shim-eth-llc/main.c')
-rw-r--r--src/ipcpd/shim-eth-llc/main.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c
index da0bf97e..ab25ffb1 100644
--- a/src/ipcpd/shim-eth-llc/main.c
+++ b/src/ipcpd/shim-eth-llc/main.c
@@ -315,7 +315,8 @@ static int eth_llc_ipcp_send_mgmt_frame(shim_eth_llc_msg_t * msg,
static int eth_llc_ipcp_sap_alloc(uint8_t * dst_addr,
uint8_t ssap,
char * dst_name,
- char * src_ae_name)
+ char * src_ae_name,
+ qoscube_t cube)
{
shim_eth_llc_msg_t msg = SHIM_ETH_LLC_MSG__INIT;
@@ -324,6 +325,8 @@ static int eth_llc_ipcp_sap_alloc(uint8_t * dst_addr,
msg.ssap = ssap;
msg.dst_name = dst_name;
msg.src_ae_name = src_ae_name;
+ msg.has_qoscube = true;
+ msg.qoscube = cube;
return eth_llc_ipcp_send_mgmt_frame(&msg, dst_addr);
}
@@ -349,7 +352,8 @@ static int eth_llc_ipcp_sap_alloc_resp(uint8_t * dst_addr,
static int eth_llc_ipcp_sap_req(uint8_t r_sap,
uint8_t * r_addr,
char * dst_name,
- char * src_ae_name)
+ char * src_ae_name,
+ qoscube_t cube)
{
int fd;
@@ -357,7 +361,7 @@ static int eth_llc_ipcp_sap_req(uint8_t r_sap,
pthread_rwlock_wrlock(&eth_llc_data.flows_lock);
/* reply to IRM */
- fd = ipcp_flow_req_arr(getpid(), dst_name, src_ae_name);
+ fd = ipcp_flow_req_arr(getpid(), dst_name, src_ae_name, cube);
if (fd < 0) {
pthread_rwlock_unlock(&eth_llc_data.flows_lock);
pthread_rwlock_unlock(&ipcpi.state_lock);
@@ -464,7 +468,8 @@ static int eth_llc_ipcp_mgmt_frame(uint8_t * buf, size_t len, uint8_t * r_addr)
eth_llc_ipcp_sap_req(msg->ssap,
r_addr,
msg->dst_name,
- msg->src_ae_name);
+ msg->src_ae_name,
+ msg->qoscube);
}
break;
case SHIM_ETH_LLC_MSG_CODE__FLOW_REPLY:
@@ -934,7 +939,7 @@ static int eth_llc_ipcp_name_query(char * name)
static int eth_llc_ipcp_flow_alloc(int fd,
char * dst_name,
char * src_ae_name,
- qoscube_t qos)
+ qoscube_t cube)
{
uint8_t ssap = 0;
uint8_t r_addr[MAC_SIZE];
@@ -945,8 +950,10 @@ static int eth_llc_ipcp_flow_alloc(int fd,
if (dst_name == NULL || src_ae_name == NULL)
return -1;
- if (qos != QOS_CUBE_BE)
- LOG_DBG("QoS requested. Ethernet LLC can't do that. For now.");
+ if (cube != QOS_CUBE_BE && cube != QOS_CUBE_FRC) {
+ LOG_DBG("Unsupported QoS requested.");
+ return -1;
+ }
pthread_rwlock_rdlock(&ipcpi.state_lock);
@@ -983,7 +990,8 @@ static int eth_llc_ipcp_flow_alloc(int fd,
if (eth_llc_ipcp_sap_alloc(r_addr,
ssap,
dst_name,
- src_ae_name) < 0) {
+ src_ae_name,
+ cube) < 0) {
pthread_rwlock_rdlock(&ipcpi.state_lock);
pthread_rwlock_wrlock(&eth_llc_data.flows_lock);
bmp_release(eth_llc_data.saps, eth_llc_data.fd_to_ef[fd].sap);