Part Number: TDA2PXEVM
[TDA2PX]How to create two vlan socket that bind same IP but different vlan-id? (TI-RTOS)
we have already added two vlan by VLANAddDevice, the default usage for vlan is bind to different IP address, we also send data success with different vlan-id socket that bind with different IP address
but we need to create two vlan socket with different vlan-id that bind same IP address and this config is failure
1. we need send RTP on vlan id 5 with IP("198.18.36.96")
2. we need send other data on vlan id 12 with IP("198.18.36.96")
but the NDK seems not support the two configs working at same time, we can not create one socket(vlan5) for sending RTP while create another(vlan12) for sending data, so how to solve this?
code:
m_eth_elan = 1;
int m_eth_vlan5 = eth_vlan_add(5,2);
int m_eth_vlan12 = eth_vlan_add(12,0);
nt_print("m_eth_elan(real port):%d m_eth_vlan5(vlan port):%d m_eth_vlan12(vlan port):%d",m_eth_elan,m_eth_vlan5,m_eth_vlan12);
eth_dev_ifconfig(m_eth_elan, (uint8_t*)("198.18.36.96"), (uint8_t*)("255.255.0.0"), NULL);
eth_dev_ifconfig(m_eth_vlan5, (uint8_t*)("198.18.36.96"), (uint8_t*)("255.255.0.0"), NULL);
eth_dev_ifconfig(m_eth_vlan12, (uint8_t*)("198.18.36.96"), (uint8_t*)("255.255.0.0"), NULL);
log
network session start
eth_vlan_add tagid:5 priority:2
eth_vlan_add VLANAddDevice ret:2
eth_vlan_add tagid:12 priority:0
eth_vlan_add VLANAddDevice ret:3
m_eth_elan(real port):1 m_eth_vlan5(vlan port):2 m_eth_vlan12(vlan port):3ifconfig eth index:1 name:eth0 mtu:1500 addr:198.18.36.96 mask:255.255.0.0
ifconfig eth index:1 success
ifconfig eth index:2 name:eth0:5 mtu:1496 addr:198.18.36.96 mask:255.255.0.0
ifconfig eth index:2 CfgAddEntry failure, ret_code:-101
ifconfig eth index:3 name:eth0:12 mtu:1496 addr:198.18.36.96 mask:255.255.0.0
ifconfig eth index:3 CfgAddEntry failure, ret_code:-101