public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null || GetType() != obj.GetType()) { return(false); } ProxyRequestContext that = obj as ProxyRequestContext; return(ServiceId.Equals(that.ServiceId) && Path.Equals(that.Path) && HttpMethod.Equals(that.HttpMethod) && RequestId.Equals(that.RequestId) && Identity.Equals(that.Identity) && SourceIp.Equals(that.SourceIp) && Stage.Equals(that.Stage)); }
public void MergeFrom(Template other) { if (other == null) { return; } if (other.TraceId.Length != 0) { TraceId = other.TraceId; } if (other.SpanId.Length != 0) { SpanId = other.SpanId; } if (other.ParentSpanId.Length != 0) { ParentSpanId = other.ParentSpanId; } if (other.SpanName.Length != 0) { SpanName = other.SpanName; } if (other.startTime_ != null) { if (startTime_ == null) { startTime_ = new global::Istio.Policy.V1Beta1.TimeStamp(); } StartTime.MergeFrom(other.StartTime); } if (other.endTime_ != null) { if (endTime_ == null) { endTime_ = new global::Istio.Policy.V1Beta1.TimeStamp(); } EndTime.MergeFrom(other.EndTime); } spanTags_.Add(other.spanTags_); if (other.HttpStatusCode != 0L) { HttpStatusCode = other.HttpStatusCode; } if (other.ClientSpan != false) { ClientSpan = other.ClientSpan; } if (other.RewriteClientSpanId != false) { RewriteClientSpanId = other.RewriteClientSpanId; } if (other.SourceName.Length != 0) { SourceName = other.SourceName; } if (other.sourceIp_ != null) { if (sourceIp_ == null) { sourceIp_ = new global::Istio.Policy.V1Beta1.IPAddress(); } SourceIp.MergeFrom(other.SourceIp); } if (other.DestinationName.Length != 0) { DestinationName = other.DestinationName; } if (other.destinationIp_ != null) { if (destinationIp_ == null) { destinationIp_ = new global::Istio.Policy.V1Beta1.IPAddress(); } DestinationIp.MergeFrom(other.DestinationIp); } if (other.RequestSize != 0L) { RequestSize = other.RequestSize; } if (other.RequestTotalSize != 0L) { RequestTotalSize = other.RequestTotalSize; } if (other.ResponseSize != 0L) { ResponseSize = other.ResponseSize; } if (other.ResponseTotalSize != 0L) { ResponseTotalSize = other.ResponseTotalSize; } if (other.ApiProtocol.Length != 0) { ApiProtocol = other.ApiProtocol; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public override int GetHashCode() { int hash = 1; if (TraceId.Length != 0) { hash ^= TraceId.GetHashCode(); } if (SpanId.Length != 0) { hash ^= SpanId.GetHashCode(); } if (ParentSpanId.Length != 0) { hash ^= ParentSpanId.GetHashCode(); } if (SpanName.Length != 0) { hash ^= SpanName.GetHashCode(); } if (startTime_ != null) { hash ^= StartTime.GetHashCode(); } if (endTime_ != null) { hash ^= EndTime.GetHashCode(); } hash ^= SpanTags.GetHashCode(); if (HttpStatusCode != 0L) { hash ^= HttpStatusCode.GetHashCode(); } if (ClientSpan != false) { hash ^= ClientSpan.GetHashCode(); } if (RewriteClientSpanId != false) { hash ^= RewriteClientSpanId.GetHashCode(); } if (SourceName.Length != 0) { hash ^= SourceName.GetHashCode(); } if (sourceIp_ != null) { hash ^= SourceIp.GetHashCode(); } if (DestinationName.Length != 0) { hash ^= DestinationName.GetHashCode(); } if (destinationIp_ != null) { hash ^= DestinationIp.GetHashCode(); } if (RequestSize != 0L) { hash ^= RequestSize.GetHashCode(); } if (RequestTotalSize != 0L) { hash ^= RequestTotalSize.GetHashCode(); } if (ResponseSize != 0L) { hash ^= ResponseSize.GetHashCode(); } if (ResponseTotalSize != 0L) { hash ^= ResponseTotalSize.GetHashCode(); } if (ApiProtocol.Length != 0) { hash ^= ApiProtocol.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override int GetHashCode() { return(ServiceId.GetHashCode() ^ Path.GetHashCode() ^ HttpMethod.GetHashCode() ^ RequestId.GetHashCode() ^ Identity.GetHashCode() ^ SourceIp.GetHashCode() ^ Stage.GetHashCode()); }
public bool IsMatch(EthernetPacket packet) { var validationStack = new Stack <Func <bool> >(); if (SourceMac != null) { validationStack.Push(() => SourceMac.Equals(packet.SourceHardwareAddress)); } if (DestinationMac != null) { validationStack.Push(() => DestinationMac.Equals(packet.DestinationHardwareAddress)); } var arp = packet.Extract <ArpPacket>(); if (arp != null && RuleProtocol.Equals(Protocol.Arp)) { return(resolveValidationStack(validationStack)); } var lldp = packet.Extract <LldpPacket>(); if (lldp != null && RuleProtocol.Equals(Protocol.Lldp)) { return(resolveValidationStack(validationStack)); } var ipv4 = packet.Extract <IPv4Packet>(); if (ipv4 != null) { if (SourceIp != null) { validationStack.Push(() => SourceIp.Equals(ipv4.SourceAddress)); } if (DestinationIp != null) { validationStack.Push(() => DestinationIp.Equals(ipv4.DestinationAddress)); } if (RuleProtocol.Equals(Protocol.Ipv4)) { return(resolveValidationStack(validationStack)); } } var ipv6 = packet.Extract <IPv6Packet>(); if (ipv6 != null) { if (SourceIp != null) { validationStack.Push(() => SourceIp.Equals(ipv6.SourceAddress)); } if (DestinationIp != null) { validationStack.Push(() => DestinationIp.Equals(ipv6.DestinationAddress)); } if (RuleProtocol.Equals(Protocol.Ipv6)) { return(resolveValidationStack(validationStack)); } } var icmpv4 = packet.Extract <IcmpV4Packet>(); if (icmpv4 != null && RuleProtocol.Equals(Protocol.Icmpv4)) { if (DestinationPort != null) { validationStack.Push(() => (((ushort)icmpv4.TypeCode) / 256) == DestinationPort); } return(resolveValidationStack(validationStack)); } var icmpv6 = packet.Extract <IcmpV4Packet>(); if (icmpv6 != null && RuleProtocol.Equals(Protocol.Icmpv6)) { if (DestinationPort != null) { validationStack.Push(() => (((ushort)icmpv6.TypeCode) / 256) == DestinationPort); } return(resolveValidationStack(validationStack)); } var tcp = packet.Extract <TcpPacket>(); if (tcp != null && RuleProtocol.Equals(Protocol.Tcp)) { if (SourcePort != null) { validationStack.Push(() => SourcePort.Equals(tcp.SourcePort)); } if (DestinationPort != null) { validationStack.Push(() => DestinationPort.Equals(tcp.DestinationPort)); } return(resolveValidationStack(validationStack)); } var udp = packet.Extract <UdpPacket>(); if (udp != null && RuleProtocol.Equals(Protocol.Udp)) { if (SourcePort != null) { validationStack.Push(() => SourcePort.Equals(udp.SourcePort)); } if (DestinationPort != null) { validationStack.Push(() => DestinationPort.Equals(udp.DestinationPort)); } return(resolveValidationStack(validationStack)); } return(false); }