#include <stdio.h>
#include <signal.h>
#include <memory.h>
#include <assert.h>
enum {
/* ftp */
FTP_TEST = 10,
};
struct oam_excute_st
{
int (*doit)(char*, char*, int*);
int (*dumpit)(char*, char*, int*, int);
};
extern struct oam_excute_st* oam_execute;
int ftp_test(char* buf, char* outbuf, int* len) {
printf("hello,world\n");
return 0;
}
int ftp_test_2(char* buf, char* outbuf, int* len, int num) {
printf("hahahaha\n");
return 0;
}
struct oam_excute_st ftp_oam_table[] =
{
[FTP_TEST] = {.doit = ftp_test ,.dumpit = ftp_test_2},
};
int main()
{
int i = 2;
ftp_oam_table[FTP_TEST].doit(NULL, NULL, &i);
ftp_oam_table[FTP_TEST].dumpit(NULL, NULL, &i, 3);
return 0;
}
文章评论