⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 packet.h

📁 Linux 上的socket嗅探器
💻 H
字号:
/*
 *
 * Copyright (C) 2003 Xiangbin Lee <honeycombs@sina.com> <honeycombs@263.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation.
 */
 
#ifndef _PACKET_H_
#define _PACKET_H_

#include "ache.h"
#include "netdrv.h"

#define EXTRANS_FP_HEAD        0x01
#define EXTRANS_FP_TAIL        0x02

#define EXTRANS_CP_HEAD        0x03
#define EXTRANS_CP_TAIL        0x04

/* password inche */
void TransPass(unsigned char *lpbuf, int buflen, unsigned short randid);
/* trans packet */
int TransPacket(unsigned char *dest, unsigned char *source, int scrlen);
int ExTransPacket(unsigned char *dest, unsigned char *source, int scrlen);
int AchbufToPktbuf(unsigned char *dest, unsigned char *frame, int framelen);
int PktbufToAchbuf(unsigned char *dest, unsigned char *buf, int buflen);

#define MAXRECLEN            4096    /* Request Packet Lenght */
#define CHIPBUFLENGTH        1024    /* length of chip */

typedef struct _CLIP_ACHE
{
    unsigned char TRANSACHE[MAXRECLEN*3*5];        /* more than 5 packet for protocal */
    unsigned char CHIPACHE[CHIPBUFLENGTH*30];        /* more than 30 chip packet for receive */
    ACHSTATUS PKTAche,CHIPAche ;
    unsigned char SENDACHE[CHIPBUFLENGTH*30];
    ACHSTATUS SendAche;
}CLIP_ACHE;

int ClipAche_Reset(CLIP_ACHE *lpache);
int ClipAche_WriteClip(CLIP_ACHE *lpache, unsigned char *lpbuf, unsigned long chiplen);
int ClipAche_ClipToPacketPro(CLIP_ACHE *lpache);
int ClipAche_ReadPacket(CLIP_ACHE *lpache, unsigned char *lpbuf);

int ClipAche_SendPacket(CLIP_ACHE *lpache, unsigned char *dest, int sendlen);
int ClipAche_ClipSendPro(CLIP_ACHE *lpache, SOCKET sd_socket);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -