nmsg  0.9.0
email.c
Go to the documentation of this file.
1 /* email nmsg message module */
2 
3 /*
4  * Copyright (c) 2008, 2009, 2013 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 "email.pb-c.h"
22 
23 /* Data. */
24 
25 struct nmsg_msgmod_field email_fields[] = {
26  { .type = nmsg_msgmod_ft_enum, .name = "type" },
27  { .type = nmsg_msgmod_ft_mlstring, .name = "headers" },
28  { .type = nmsg_msgmod_ft_ip, .name = "srcip" },
29  { .type = nmsg_msgmod_ft_string, .name = "srchost" },
30  { .type = nmsg_msgmod_ft_string, .name = "helo" },
31  { .type = nmsg_msgmod_ft_string, .name = "from" },
32  {
33  .type = nmsg_msgmod_ft_string,
34  .name = "rcpt",
36  },
37  {
38  .type = nmsg_msgmod_ft_string,
39  .name = "bodyurl",
41  },
42  { .type = nmsg_msgmod_ft_mlstring, .name = "body" },
43  NMSG_MSGMOD_FIELD_END
44 };
45 
46 /* Export. */
47 
48 struct nmsg_msgmod_plugin nmsg_msgmod_ctx = {
49  NMSG_MSGMOD_REQUIRED_INIT,
50  .vendor = NMSG_VENDOR_BASE,
51  .msgtype = { NMSG_VENDOR_BASE_EMAIL_ID, NMSG_VENDOR_BASE_EMAIL_NAME },
52 
53  .pbdescr = &nmsg__base__email__descriptor,
54  .fields = email_fields
55 };
56 
Structure exported by message modules to implement a new message type.
Protobuf enum.
Definition: msgmod.h:75
Protobuf byte array.
Definition: msgmod.h:96
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_REPEATED
field is repeated
Definition: msgmod.h:123