Struct protoent Problems

Source: Internet
Author: User
The void initprotonames () function in Snort. C is used to obtain the protocol name in protocol_names [256].
Struct protoent {
Char * p_name; // name
Char * p_aliases; // alias
Short * p_proto; // No.
}
Getprotobyname (): obtains other information about the protocol based on the protocol name.
Format: struct protoent * getprotobyname (const char * Name );
Parameter: Name communication protocol name
Return Value: Success-pointer to struct protoent

Failure-null Description: The name of the communication agreement is used to learn the alias, number, and other information of the communication agreement.
Getprotobynumber (): obtains other information about the protocol according to the number of the Protocol.
Format: struct protoent * getprotobynumber (INT number );
Parameter: Number of the communication protocol in host arrangement
Return Value: Success-pointer to struct protoent
Failed-Null
Note: The name and alias of the communication agreement are known by the number of the communication agreement.

Also ,:-)
Toupper (char c) converts character C to uppercase letters.
D = strdup (char * s): copy the string s to D and return a pointer to the string to be copied. The space required is allocated by malloc () and can be released by free.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.