This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
[TDA2PX]如何创建两个 VLAN 套接字,以绑定相同的 IP 但不同的 VLAN-id? (TI-RTOS)
我们已经通过 VLANAddDevice 添加了两个 VLAN、VLAN 的默认用法是绑定到不同的 IP 地址、我们还使用不同的 VLAN ID 套接字发送数据成功、这些套接字绑定到不同的 IP 地址
但是,我们需要创建两个 VLAN 套接字,该套接字具有绑定相同 IP 地址的不同 VLAN-id,并且此配置失败
1.我们需要在 VLAN id 5上使用 IP 发送 RTP ("198.18.36.96")
2.我们需要使用 IP 在 VLAN id 12上发送其他数据("198.18.36.96")
但是 NDK 似乎不支持两个配置同时工作、我们无法创建一个用于发送 RTP 的套接字(vlan5)、而创建另一个(vlan12)用于发送数据、那么如何解决这个问题?
代码:
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 (实端口):%d m_eth_vlan5 (VLAN 端口):%d m_eth_vlan12 (VLAN 端口):%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);
日志
网络会话开始
ETH_VLAN_add tagid:5优先级:2.
ETH_VLAN_add VLANAddDevice ret:2.
ETH_VLAN_add tagid:12优先级:0
ETH_VLAN_add VLANAddDevice ret:3.
m_eth_Elan (实端口):1 m_eth_vlan5 (VLAN 端口):2 m_eth_vlan12 (VLAN 端口):3ifconfig 索引:1名称:eth0 MTU:1500 addr:198.18.36.96 mask:255.255.0.0
ifconfig eth 索引:1成功
ifconfig eth 索引:2名称:eth0:5 MTU:1496 addr:198.18.36.96掩码:255.255.0.0
ifconfig eth 索引:2 CfgAddEntry 失败、ret_code:-101
ifconfig eth 索引:3名称:eth0:12 MTU :1496 addr:198.18.36.96掩码:255.255.0.0
ifconfig eth 索引:3 CfgAddEntry 失败、ret_code:-101