Add a method to fetch protocol description.

svn path=/trunk/; revision=38736
This commit is contained in:
Stig Bjørlykke 2011-08-25 18:52:54 +00:00
parent 1be5bf9bcc
commit f7956e0e1d
1 changed files with 10 additions and 0 deletions

View File

@ -1278,6 +1278,12 @@ static int Proto_get_name(lua_State* L) {
return 1;
}
static int Proto_get_description(lua_State* L) {
Proto proto = toProto(L,1);
lua_pushstring(L,proto->desc);
return 1;
}
static int Proto_get_fields(lua_State* L) {
Proto proto = toProto(L,1);
lua_rawgeti(L, LUA_REGISTRYINDEX, proto->fields);
@ -1344,6 +1350,10 @@ static const proto_actions_t proto_actions[] = {
/* WSLUA_ATTRIBUTE Proto_name RO The name given to this dissector */
{"name",Proto_get_name,NULL},
/* WSLUA_ATTRIBUTE Proto_description RO The description given to this dissector */
{"description",Proto_get_description,NULL},
{NULL,NULL,NULL}
};