nmsg  0.9.0
linkpair.c
Go to the documentation of this file.
1 /* link pair nmsg message module */
2 
3 /*
4  * Copyright (c) 2008, 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 "linkpair.pb-c.h"
22 
23 /* Data. */
24 
25 struct nmsg_msgmod_field linkpair_fields[] = {
26  {
28  .name = "type",
30  },
31  {
32  .type = nmsg_msgmod_ft_string,
33  .name = "src",
35  },
36  {
37  .type = nmsg_msgmod_ft_string,
38  .name = "dst",
40  },
41  { .type = nmsg_msgmod_ft_mlstring, .name = "headers" },
42  NMSG_MSGMOD_FIELD_END
43 };
44 
45 /* Export. */
46 
47 struct nmsg_msgmod_plugin nmsg_msgmod_ctx = {
48  NMSG_MSGMOD_REQUIRED_INIT,
49  .vendor = NMSG_VENDOR_BASE,
50  .msgtype = { NMSG_VENDOR_BASE_LINKPAIR_ID, NMSG_VENDOR_BASE_LINKPAIR_NAME },
51 
52  .pbdescr = &nmsg__base__linkpair__descriptor,
53  .fields = linkpair_fields
54 };
55 
Structure exported by message modules to implement a new message type.
Protobuf enum.
Definition: msgmod.h:75
Protobuf byte array.
Definition: msgmod.h:84
Structure mapping protocol buffer schema fields to nmsg_msgmod_field_type values for "transparent" mo...
Protobuf byte array.
Definition: msgmod.h:90
nmsg_msgmod_field_type type
Intended (nmsg) type of this protobuf field.
#define NMSG_MSGMOD_FIELD_REQUIRED
field is required
Definition: msgmod.h:124