hi,all:
I followed <TI81XX PSP ETHERNET Switch User Guide> to add multicast config but failed.
I need someone to confirm my step:
1 Configuring Kernel with VLAN Support;
2 Switch Config Commands in the app source file.
include <stdio.h> ... include <linux/net_switch_config.h> int main(void) {
struct net_switch_config cmd_struct; struct ifreq ifr; int sockfd;
strncpy(ifr.ifr_name, "eth0", IFNAMSIZ); ifr.ifr_data = (char*)&cmd_struct; if
((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { printf("Can't open the
socket\n"); return -1; } memset(&cmd_struct, 0, sizeof(struct
net_switch_config));
...//initialise cmd_struct with switch commands
cmd_struct.cmd = CONFIG_SWITCH_ADD_MULTICAST;
if (ioctl(sockfd, SIOCDEVPRIVATE, &ifr) < 0) { printf("Command failed\n"); close(sockfd); return -1; }
printf("command success\n"); close(sockfd); return 0; }
is that right? any step I miss?
thanks ahead of time.
Best Regards,
qiuxicj