コード例 #1
0
ファイル: luareplace.c プロジェクト: ttgb/luadec
int replaceFunction(Proto* fparent, int cdest, Proto* fsrc) {
	int diff = checkProto(fparent->p[cdest], fsrc, -1);
	fparent->p[cdest] = fsrc;
	if (diff > 0){
		return diff;
	}
	return 0;
}
コード例 #2
0
ファイル: luareplace.c プロジェクト: ttgb/luadec
int replaceSubFunctions(Proto* fdest, Proto* fsrc) {
	int i = 0, diff = 0;
	int minsizep = MIN(fdest->sizep, fsrc->sizep);
	for (i = 0; i < minsizep; i++){
		diff += checkProto(fdest->p[i], fsrc->p[i], i);
		fdest->p[i] = fsrc->p[i];
	}
	if (diff > 0){
		return diff;
	}
	return 0;
}
コード例 #3
0
ファイル: wslua_pinfo.c プロジェクト: DuLerWeil/wireshark
/* WSLUA_ATTRIBUTE Pinfo_conversation WO sets the packet conversation to the given Proto object. */
static int Pinfo_set_conversation(lua_State *L) {
    Pinfo pinfo = checkPinfo(L,1);
    Proto proto = checkProto(L,2);
    conversation_t  *conversation;

    if (!proto->handle) {
        luaL_error(L,"Proto %s has no registered dissector", proto->name? proto->name:"<UKNOWN>");
        return 0;
    }

    conversation = find_or_create_conversation(pinfo->ws_pinfo);
    conversation_set_dissector(conversation,proto->handle);

    return 0;
}