예제 #1
0
static int cmd_dumplist(struct team_handle *th, int argc, char **argv)
{
	char *opt;

	if (argc == 1) {
		fprintf(stderr, "List name not specified\n");
		usage();
	}

	opt = argv[1];

	if (strcmp(opt, "ports") == 0) {
		struct team_port *port;

		team_for_each_port(port, th) {
			uint32_t ifindex = team_get_port_ifindex(port);

			printf("ifname %s, linkup %d, changed %d, speed %d, "
			       "duplex %d\n",
			       get_port_name(th, ifindex),
			       team_is_port_link_up(port),
			       team_is_port_changed(port),
			       team_get_port_speed(port),
			       team_get_port_duplex(port));
		}
	} else {
예제 #2
0
static int port_change_handler_func(struct team_handle *th, void *arg,
				    team_change_type_mask_t type_mask)
{
	struct team_port *port;

	printf("------------------\nport change\n\tport list:\n");
	team_for_each_port(port, th) {
		uint32_t ifindex = team_get_port_ifindex(port);

		printf("\tifname %s, linkup %d, changed %d, speed %d, "
		       "duplex %d\n",
		       get_port_name(th, ifindex),
		       team_is_port_link_up(port),
		       team_is_port_changed(port),
		       team_get_port_speed(port),
		       team_get_port_duplex(port));
	}