1 /*
2  * Copyright (c) 2008-2010, 2012, 2013 by Farsight Security, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *    http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef NMSG_RES_H
18 #define NMSG_RES_H
19 
20 /*! \file nmsg/res.h
21  * \brief Possible result codes for nmsg functions.
22  */
23 
24 /** nmsg result code */
25 enum nmsg_res {
26 	nmsg_res_success,		/*%< success */
27 	nmsg_res_failure,		/*%< generic failure */
28 	nmsg_res_eof,			/*%< end of file */
29 	nmsg_res_memfail,		/*%< out of memory */
30 	nmsg_res_magic_mismatch,	/*%< nmsg header magic incorrect */
31 	nmsg_res_version_mismatch,	/*%< nmsg header version incorrect */
32 	nmsg_res_pbuf_ready,		/*%< a pbuf is ready to be written */
33 	nmsg_res_notimpl,		/*%< module lacks a function */
34 	nmsg_res_stop,			/*%< processing should stop */
35 	nmsg_res_again,			/*%< caller should try again */
36 	nmsg_res_parse_error,		/*%< unable to parse input */
37 	nmsg_res_pcap_error,		/*%< libpcap error */
38 	nmsg_res_read_failure,		/*%< read failure */
39 	nmsg_res_container_full,
40 	nmsg_res_container_overfull,
41 	nmsg_res_errno,
42 };
43 
44 /**
45  * Look up a result code by value.
46  *
47  * \param[in] val Result code value.
48  *
49  * \return String describing the result code value. If an unknown result code
50  * is passed, the string "(unknown libnmsg result code)" will be returned.
51  */
52 const char *nmsg_res_lookup(enum nmsg_res val);
53 
54 #endif /* NMSG_RES_H */
55