Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| int | ifcommon_exec (int argc, char **argv, int(*payload)(struct net_device *), const char *verb) |
| Execute if<xxx> command. | |
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
| int ifcommon_exec | ( | int | argc, | |
| char ** | argv, | |||
| int(*)(struct net_device *) | payload, | |||
| const char * | verb | |||
| ) |
Execute if<xxx> command.
| argc | Argument count | |
| argv | Argument list | |
| payload | Command to execute | |
| verb | Verb describing the action of the command |
| rc | Exit code |
Definition at line 107 of file ifmgmt_cmd.c.
References getopt_long(), ifcommon_do_all(), ifcommon_do_list(), ifcommon_syntax(), NULL, and optind.
Referenced by ifclose_exec(), ifopen_exec(), ifstat_exec(), iwlist_exec(), iwstat_exec(), and startpxe_exec().
00109 { 00110 int c; 00111 00112 /* Parse options */ 00113 while ( ( c = getopt_long ( argc, argv, "h", ifcommon_longopts, 00114 NULL ) ) >= 0 ) { 00115 switch ( c ) { 00116 case 'h': 00117 /* Display help text */ 00118 default: 00119 /* Unrecognised/invalid option */ 00120 ifcommon_syntax ( argv, verb ); 00121 return 1; 00122 } 00123 } 00124 00125 if ( optind == argc ) { 00126 return ifcommon_do_all ( payload ); 00127 } else { 00128 return ifcommon_do_list ( payload, &argv[optind], 00129 ( argc - optind ) ); 00130 } 00131 }
1.5.7.1