|
| 1 | +using System; |
| 2 | +using System.Linq.Expressions; |
| 3 | +using System.Runtime.Serialization; |
| 4 | +using Elasticsearch.Net.Utf8Json; |
| 5 | + |
| 6 | +namespace Nest |
| 7 | +{ |
| 8 | + [InterfaceDataContract] |
| 9 | + public interface INetworkCommunityIdProcessor : IProcessor |
| 10 | + { |
| 11 | + [DataMember(Name = "destination_ip")] |
| 12 | + Field DestinationIp { get; set; } |
| 13 | + |
| 14 | + [DataMember(Name = "destination_port")] |
| 15 | + Field DestinationPort { get; set; } |
| 16 | + |
| 17 | + [DataMember(Name = "iana_number")] |
| 18 | + Field IanaNumber { get; set; } |
| 19 | + |
| 20 | + [DataMember(Name = "icmp_type")] |
| 21 | + Field IcmpType { get; set; } |
| 22 | + |
| 23 | + [DataMember(Name = "icmp_code")] |
| 24 | + Field IcmpCode { get; set; } |
| 25 | + |
| 26 | + [DataMember(Name = "ignore_missing")] |
| 27 | + bool? IgnoreMissing { get; set; } |
| 28 | + |
| 29 | + [DataMember(Name = "seed")] |
| 30 | + int? Seed { get; set; } |
| 31 | + |
| 32 | + [DataMember(Name = "source_ip")] |
| 33 | + Field SourceIp { get; set; } |
| 34 | + |
| 35 | + [DataMember(Name = "source_port")] |
| 36 | + Field SourcePort { get; set; } |
| 37 | + |
| 38 | + [DataMember(Name = "target_field")] |
| 39 | + Field TargetField { get; set; } |
| 40 | + |
| 41 | + [DataMember(Name = "transport")] |
| 42 | + Field Transport { get; set; } |
| 43 | + } |
| 44 | + |
| 45 | + public class NetworkCommunityIdProcessor : ProcessorBase, INetworkCommunityIdProcessor |
| 46 | + { |
| 47 | + protected override string Name => "community_id"; |
| 48 | + |
| 49 | + /// <inheritdoc /> |
| 50 | + public Field DestinationIp { get; set; } |
| 51 | + /// <inheritdoc /> |
| 52 | + public Field DestinationPort { get; set; } |
| 53 | + /// <inheritdoc /> |
| 54 | + public Field IanaNumber { get; set; } |
| 55 | + /// <inheritdoc /> |
| 56 | + public Field IcmpType { get; set; } |
| 57 | + /// <inheritdoc /> |
| 58 | + public Field IcmpCode { get; set; } |
| 59 | + /// <inheritdoc /> |
| 60 | + public bool? IgnoreMissing { get; set; } |
| 61 | + /// <inheritdoc /> |
| 62 | + public int? Seed { get; set; } |
| 63 | + /// <inheritdoc /> |
| 64 | + public Field SourceIp { get; set; } |
| 65 | + /// <inheritdoc /> |
| 66 | + public Field SourcePort { get; set; } |
| 67 | + /// <inheritdoc /> |
| 68 | + public Field TargetField { get; set; } |
| 69 | + /// <inheritdoc /> |
| 70 | + public Field Transport { get; set; } |
| 71 | + } |
| 72 | + |
| 73 | + /// <inheritdoc cref="IFingerprintProcessor" /> |
| 74 | + public class NetworkCommunityIdProcessorDescriptor<T> |
| 75 | + : ProcessorDescriptorBase<NetworkCommunityIdProcessorDescriptor<T>, INetworkCommunityIdProcessor>, INetworkCommunityIdProcessor |
| 76 | + where T : class |
| 77 | + { |
| 78 | + protected override string Name => "community_id"; |
| 79 | + |
| 80 | + Field INetworkCommunityIdProcessor.DestinationIp { get; set; } |
| 81 | + |
| 82 | + Field INetworkCommunityIdProcessor.DestinationPort { get; set; } |
| 83 | + |
| 84 | + Field INetworkCommunityIdProcessor.IanaNumber { get; set; } |
| 85 | + |
| 86 | + Field INetworkCommunityIdProcessor.IcmpType { get; set; } |
| 87 | + |
| 88 | + Field INetworkCommunityIdProcessor.IcmpCode { get; set; } |
| 89 | + |
| 90 | + bool? INetworkCommunityIdProcessor.IgnoreMissing { get; set; } |
| 91 | + |
| 92 | + int? INetworkCommunityIdProcessor.Seed { get; set; } |
| 93 | + |
| 94 | + Field INetworkCommunityIdProcessor.SourceIp { get; set; } |
| 95 | + |
| 96 | + Field INetworkCommunityIdProcessor.SourcePort { get; set; } |
| 97 | + |
| 98 | + Field INetworkCommunityIdProcessor.TargetField { get; set; } |
| 99 | + |
| 100 | + Field INetworkCommunityIdProcessor.Transport { get; set; } |
| 101 | + |
| 102 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.DestinationIp" /> |
| 103 | + public NetworkCommunityIdProcessorDescriptor<T> DestinationIp(Field field) => Assign(field, (a, v) => a.DestinationIp = v); |
| 104 | + |
| 105 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.DestinationIp" /> |
| 106 | + public NetworkCommunityIdProcessorDescriptor<T> DestinationIp<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 107 | + Assign(objectPath, (a, v) => a.DestinationIp = v); |
| 108 | + |
| 109 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.DestinationPort" /> |
| 110 | + public NetworkCommunityIdProcessorDescriptor<T> DestinationPort(Field field) => Assign(field, (a, v) => a.DestinationPort = v); |
| 111 | + |
| 112 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.DestinationPort" /> |
| 113 | + public NetworkCommunityIdProcessorDescriptor<T> DestinationPort<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 114 | + Assign(objectPath, (a, v) => a.DestinationPort = v); |
| 115 | + |
| 116 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.IanaNumber" /> |
| 117 | + public NetworkCommunityIdProcessorDescriptor<T> IanaNumber(Field field) => Assign(field, (a, v) => a.IanaNumber = v); |
| 118 | + |
| 119 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.IanaNumber" /> |
| 120 | + public NetworkCommunityIdProcessorDescriptor<T> IanaNumber<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 121 | + Assign(objectPath, (a, v) => a.IanaNumber = v); |
| 122 | + |
| 123 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.IcmpType" /> |
| 124 | + public NetworkCommunityIdProcessorDescriptor<T> IcmpType(Field field) => Assign(field, (a, v) => a.IcmpType = v); |
| 125 | + |
| 126 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.IcmpType" /> |
| 127 | + public NetworkCommunityIdProcessorDescriptor<T> IcmpType<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 128 | + Assign(objectPath, (a, v) => a.IcmpType = v); |
| 129 | + |
| 130 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.IcmpCode" /> |
| 131 | + public NetworkCommunityIdProcessorDescriptor<T> IcmpCode(Field field) => Assign(field, (a, v) => a.IcmpCode = v); |
| 132 | + |
| 133 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.IcmpType" /> |
| 134 | + public NetworkCommunityIdProcessorDescriptor<T> IcmpCode<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 135 | + Assign(objectPath, (a, v) => a.IcmpCode = v); |
| 136 | + |
| 137 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.IgnoreMissing" /> |
| 138 | + public NetworkCommunityIdProcessorDescriptor<T> IgnoreMissing(bool? ignoreMissing = true) => Assign(ignoreMissing, (a, v) => a.IgnoreMissing = v); |
| 139 | + |
| 140 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.Seed" /> |
| 141 | + public NetworkCommunityIdProcessorDescriptor<T> Seed(int? seed = null) => Assign(seed, (a, v) => a.Seed = v); |
| 142 | + |
| 143 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.SourceIp" /> |
| 144 | + public NetworkCommunityIdProcessorDescriptor<T> SourceIp(Field field) => Assign(field, (a, v) => a.SourceIp = v); |
| 145 | + |
| 146 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.SourceIp" /> |
| 147 | + public NetworkCommunityIdProcessorDescriptor<T> SourceIp<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 148 | + Assign(objectPath, (a, v) => a.SourceIp = v); |
| 149 | + |
| 150 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.SourcePort" /> |
| 151 | + public NetworkCommunityIdProcessorDescriptor<T> SourcePort(Field field) => Assign(field, (a, v) => a.SourcePort = v); |
| 152 | + |
| 153 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.SourcePort" /> |
| 154 | + public NetworkCommunityIdProcessorDescriptor<T> SourcePort<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 155 | + Assign(objectPath, (a, v) => a.SourcePort = v); |
| 156 | + |
| 157 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.TargetField" /> |
| 158 | + public NetworkCommunityIdProcessorDescriptor<T> TargetField(Field field) => Assign(field, (a, v) => a.TargetField = v); |
| 159 | + |
| 160 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.TargetField" /> |
| 161 | + public NetworkCommunityIdProcessorDescriptor<T> TargetField<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 162 | + Assign(objectPath, (a, v) => a.TargetField = v); |
| 163 | + |
| 164 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.Transport" /> |
| 165 | + public NetworkCommunityIdProcessorDescriptor<T> Transport(Field field) => Assign(field, (a, v) => a.Transport = v); |
| 166 | + |
| 167 | + /// <inheritdoc cref="INetworkCommunityIdProcessor.Transport" /> |
| 168 | + public NetworkCommunityIdProcessorDescriptor<T> Transport<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 169 | + Assign(objectPath, (a, v) => a.Transport = v); |
| 170 | + } |
| 171 | +} |
0 commit comments