Found that snort can apply both fast and unsock modes. -A fast -A unsock However, some functions are learned after the fast unsock ######### process.
*Structure in_addr is used to represent a 32-bit IPv4 address.
extern void *memcpy(void *destin, void *source, unsigned n); ###point to address by source The data of consecutive n bytes of the start address is copied into the space starting from the destination address of destin. (baidu)
public: int SendTo( SOCKET s; unsigned char buffer __gc[], int size, SocketFlags socketFlags, sockaddr FAR *addr int len ); Return value: The length of the actual data sent. Parameter : s socket buff buffer size of the data to be sent size buffer length Flags call mode flag, usually 0, change Flags, will change the form addr (optional) pointer sent by Sendto, point to the destination socket The length of the address pointed to by the address len addr
size_t fwrite(const void*buffer,size_t size,size_t count,FILE*stream); Note: This function operates on the file in binary form, not limited to text files. Return value: Returns the number of data blocks actually written. (1) buffer: is a pointer. For fwrite, it is the address of the data to be output. (2) size: the number of single bytes to be written to the content; (3) count: the number of data items to be written to the size byte; (4) stream: the target file pointer.
1. Void *memset(void *s, int c,size_t n) The total effect: set the value of the first n bytes of the opened memory space s to the value c. Set the contents of each byte in a block of memory pointed to by s to the ASCII value specified by ch. The size of the block is specified by the third parameter. This function usually initializes the newly applied memory, and its return value. Is a pointer to S.
#p>############################################################################################# Output
find this structure is to find the LogIpAddrs function through the symbol between -> ip, output ip-> ip.
printf("!!!!!!!!!!!!!%s:%d\ ", inet_ntoax(GET_SRC_ADDR(p)), p->sp); can be output The ip and port
in the structure p are: x->ip4_header->source and x->iph->ip_src in the packet structure to store the original ip address.
Shun vine finds: inet_ntoax(GET_SRC_ADDR(p)), p->sp ########output ip and port. (It is suspected that inet_ntoax is a variant of inet_ntoa, implemented in the header file of snort)
Linux: Function declaration: char *inet_ntoa (struct in_addr); Returns the dotted decimal string in static memory pointer.
printf("@@@@@@@@@@@@ss%d\ ", inet_ntoax(GET_SRC_ADDR(p)), p->sp); ## can IP and port output in p.
Find if pkt has ip. . Etc.
(2) Timestamp LogTimeStamp(data->log, p); implemented here. The same is simple.
Create the structure of Alertpkt_txt and load the msg ip timestamp port. Use the socket to pass the structure, the purpose is achieved.
system to establish IPC communication (such as message queue, shared memory) must specify an ID valu
you want under Linux How to install the jdk you want under Linux? Last time we talked about how to u
This article mainly introduces the DB2 database in the inux installation process detailed, the step
Kobject, kset is the basic structure of the device model. The device model uses these two structure
Centos6.2 install IOU-web-interface Note
How to solve the problem that the Linux operating system can't find the network card
Linux coding conversion basic tutorial
Linux system root password reset method diagram detailed tutorial
Novice Academy: Installing two hard drives for the Linux operating system
Nginx replace text module Substitution
Use mutexes to control Linux thread synchronization
How to load a USB flash drive or a removable hard disk under Linux system
How does Win10 set the screen rotation?
Font file information to learn how to hide
Windows 10 China Conference: The best and most Chinese in history!
Win8 shared wireless network settings graphic tutorial
Win7 mysql server forgot password solution
Quick login NetEase mailbox has a high trick
Win7 system problem step recorder how to open?
Under what circumstances is it best to turn off the win7 system network firewall