nmsg  0.9.0
http.c
Go to the documentation of this file.
1 /* http nmsg message module */
2 
3 /*
4  * Copyright (c) 2009 by Farsight Security, Inc.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 /* Import. */
20 
21 #include "http.pb-c.h"
22 
23 /* Data. */
24 
25 struct nmsg_msgmod_field http_fields[] = {
26  {
28  .name = "type",
30  },
31  { .type = nmsg_msgmod_ft_ip, .name = "srcip" },
32  { .type = nmsg_msgmod_ft_string, .name = "srchost" },
33  { .type = nmsg_msgmod_ft_uint16, .name = "srcport" },
34  { .type = nmsg_msgmod_ft_ip, .name = "dstip" },
35  { .type = nmsg_msgmod_ft_uint16, .name = "dstport" },
36  { .type = nmsg_msgmod_ft_mlstring, .name = "request" },
37 
38  { .type = nmsg_msgmod_ft_string, .name = "p0f_genre" },
39  { .type = nmsg_msgmod_ft_string, .name = "p0f_detail" },
40  { .type = nmsg_msgmod_ft_int16, .name = "p0f_dist" },
41  { .type = nmsg_msgmod_ft_string, .name = "p0f_link" },
42  { .type = nmsg_msgmod_ft_string, .name = "p0f_tos" },
43  { .type = nmsg_msgmod_ft_uint16, .name = "p0f_fw" },
44  { .type = nmsg_msgmod_ft_uint16, .name = "p0f_nat" },
45  { .type = nmsg_msgmod_ft_uint16, .name = "p0f_real" },
46  { .type = nmsg_msgmod_ft_int16, .name = "p0f_score" },
47  { .type = nmsg_msgmod_ft_uint16, .name = "p0f_mflags" },
48  { .type = nmsg_msgmod_ft_int32, .name = "p0f_uptime" },
49 
50  NMSG_MSGMOD_FIELD_END
51 };
52 
53 /* Export. */
54 
55 struct nmsg_msgmod_plugin nmsg_msgmod_ctx = {
56  NMSG_MSGMOD_REQUIRED_INIT,
57  .vendor = NMSG_VENDOR_BASE,
58  .msgtype = { NMSG_VENDOR_BASE_HTTP_ID, NMSG_VENDOR_BASE_HTTP_NAME },
59 
60  .pbdescr = &nmsg__base__http__descriptor,
61  .fields = http_fields
62 };
63 
Structure exported by message modules to implement a new message type.
Protobuf enum.
Definition: msgmod.h:75
Protobuf int32.
Definition: msgmod.h:111
Protobuf byte array.
Definition: msgmod.h:96
Protobuf byte array.
Definition: msgmod.h:84
Protobuf int32.
Definition: msgmod.h:108
Structure mapping protocol buffer schema fields to nmsg_msgmod_field_type values for "transparent" mo...
Protobuf byte array.
Definition: msgmod.h:90
Protobuf uint32.
Definition: msgmod.h:99
nmsg_msgmod_field_type type
Intended (nmsg) type of this protobuf field.
#define NMSG_MSGMOD_FIELD_REQUIRED
field is required
Definition: msgmod.h:124