ifmgmt_cmd.h File Reference

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.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

int ifcommon_exec ( int  argc,
char **  argv,
int(*)(struct net_device *)  payload,
const char *  verb 
)

Execute if<xxx> command.

Parameters:
argc Argument count
argv Argument list
payload Command to execute
verb Verb describing the action of the command
Return values:
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 }


Generated on Tue Apr 6 20:01:53 2010 for gPXE by  doxygen 1.5.7.1