Exemple #1
0
 public static Zen <Matrix3x3> Add(Zen <Matrix3x3> x, Zen <Matrix3x3> y)
 {
     return(Create <Matrix3x3>(
                ("v11", x.GetField <Matrix3x3, int>("v11") + y.GetField <Matrix3x3, int>("v11")),
                ("v12", x.GetField <Matrix3x3, int>("v12") + y.GetField <Matrix3x3, int>("v12")),
                ("v13", x.GetField <Matrix3x3, int>("v13") + y.GetField <Matrix3x3, int>("v13")),
                ("v21", x.GetField <Matrix3x3, int>("v21") + y.GetField <Matrix3x3, int>("v21")),
                ("v22", x.GetField <Matrix3x3, int>("v22") + y.GetField <Matrix3x3, int>("v22")),
                ("v23", x.GetField <Matrix3x3, int>("v23") + y.GetField <Matrix3x3, int>("v23")),
                ("v31", x.GetField <Matrix3x3, int>("v31") + y.GetField <Matrix3x3, int>("v31")),
                ("v32", x.GetField <Matrix3x3, int>("v32") + y.GetField <Matrix3x3, int>("v32")),
                ("v33", x.GetField <Matrix3x3, int>("v33") + y.GetField <Matrix3x3, int>("v33"))));
 }
Exemple #2
0
 internal static Zen <ushort> GetTimeStamp(this Zen <Event> e)
 {
     return(e.GetField <Event, ushort>("TimeStamp"));
 }
Exemple #3
0
 /// <summary>
 /// Get the node of a LocatedPacket.
 /// </summary>
 /// <param name="lp">The LocatedPacket.</param>
 /// <returns>The node.</returns>
 public static Zen <byte> GetNode(this Zen <LocatedPacket> lp)
 {
     return(lp.GetField <LocatedPacket, byte>("Node"));
 }
 /// <summary>
 /// Get keys of labels of the pod.
 /// </summary>
 /// <param name="pod">pod.</param>
 /// <returns>list of label keys.</returns>
 public static Zen <IList <string> > GetKeys(this Zen <Pod> pod) => pod.GetField <Pod, IList <string> >("LabelKeys");
 /// <summary>
 /// Get keys of labels of the namespace.
 /// </summary>
 /// <param name="ns">namespace.</param>
 /// <returns>keys of labels of ns.</returns>
 public static Zen <IList <string> > GetLabelKeys(this Zen <Namespace> ns) => ns.GetField <Namespace, IList <string> >("LabelKeys");
 /// <summary>
 /// Get name of the namesapce.
 /// </summary>
 /// <param name="ns">namespace.</param>
 /// <returns>name of the ns.</returns>
 public static Zen <string> GetName(this Zen <Namespace> ns) => ns.GetField <Namespace, string>("Name");
 /// <summary>
 /// Get policy type.
 /// </summary>
 /// <param name="policy">policy.</param>
 /// <returns>if it is an ingress policy.</returns>
 public static Zen <bool> GetIngress(this Zen <Policy> policy) => policy.GetField <Policy, bool>("Ingress");
 /// <summary>
 /// Get labels of allowed pods.
 /// </summary>
 /// <param name="policy">policy.</param>
 /// <returns>labels of allowed pods.</returns>
 public static Zen <IDictionary <string, string> > GetAllowLabels(this Zen <Policy> policy) => policy.GetField <Policy, IDictionary <string, string> >("AllowLabels");
Exemple #9
0
 public static Zen <Ip> GetSrcIp(this Zen <IpHeader> hdr)
 {
     return(hdr.GetField <IpHeader, Ip>("SrcIp"));
 }
Exemple #10
0
 public static Zen <ushort> GetSrcPort(this Zen <Packet> packet)
 {
     return(packet.GetField <Packet, ushort>("SrcPort"));
 }
Exemple #11
0
 public static Zen <uint> GetDstIp(this Zen <Packet> packet)
 {
     return(packet.GetField <Packet, uint>("DstIp"));
 }
Exemple #12
0
 public static Zen <Ip> GetSrcIp(this Zen <SimplePacket> packet)
 {
     return(packet.GetField <SimplePacket, Ip>("SrcIp"));
 }
Exemple #13
0
 public static Zen <byte> GetPriorityClass(this Zen <Event> e)
 {
     return(e.GetField <Event, byte>("PriorityClass"));
 }
Exemple #14
0
 internal static Zen <byte> GetEventType(this Zen <Event> e)
 {
     return(e.GetField <Event, byte>("EventType"));
 }
 /// <summary>
 /// Get keys of pod selector.
 /// </summary>
 /// <param name="policy">policy.</param>
 /// <returns>keys of labels of pod selector.</returns>
 public static Zen <IList <string> > GetSelectKeys(this Zen <Policy> policy) => policy.GetField <Policy, IList <string> >("SelectKeys");
Exemple #16
0
 public static Zen <ushort> GetSrcPort(this Zen <IpHeader> hdr)
 {
     return(hdr.GetField <IpHeader, ushort>("SrcPort"));
 }
 /// <summary>
 /// Get keys of allowed namespaces.
 /// </summary>
 /// <param name="policy">policy.</param>
 /// <returns>keys of labels of allowed namespaces.</returns>
 public static Zen <IList <string> > GetAllowNSKeys(this Zen <Policy> policy) => policy.GetField <Policy, IList <string> >("AllowNSKeys");
Exemple #18
0
 public static Zen <byte> GetProtocol(this Zen <IpHeader> hdr)
 {
     return(hdr.GetField <IpHeader, byte>("Protocol"));
 }
 /// <summary>
 /// Get labels of allowed namespaces.
 /// </summary>
 /// <param name="policy">policy.</param>
 /// <returns>labels of allowed namespaces.</returns>
 public static Zen <IDictionary <string, string> > GetAllowNS(this Zen <Policy> policy) => policy.GetField <Policy, IDictionary <string, string> >("AllowNamespaces");
Exemple #20
0
 internal static Zen <ushort> GetStormEndedTime2(this Zen <SwitchState> wd)
 {
     return(wd.GetField <SwitchState, ushort>("StormEndedTime2"));
 }
 /// <summary>
 /// Get deny all flag.
 /// </summary>
 /// <param name="policy">policy.</param>
 /// <returns>if it is a deny-all policy.</returns>
 public static Zen <bool> GetDenyAll(this Zen <Policy> policy) => policy.GetField <Policy, bool>("DenyAll");
Exemple #22
0
 internal static Zen <IList <Pair <ushort, Pair <byte, bool> > > > GetPackets(this Zen <SwitchState> wd)
 {
     return(wd.GetField <SwitchState, IList <Pair <ushort, Pair <byte, bool> > > >("Packets"));
 }
 /// <summary>
 /// Get labels of the namespace.
 /// </summary>
 /// <param name="ns">namespace.</param>
 /// <returns>labels.</returns>
 public static Zen <IDictionary <string, string> > GetLabels(this Zen <Namespace> ns) => ns.GetField <Namespace, IDictionary <string, string> >("Labels");
Exemple #24
0
 internal static Zen <bool> GetWatchdogDropPackets2(this Zen <SwitchState> wd)
 {
     return(wd.GetField <SwitchState, bool>("WatchdogDropPackets2"));
 }
 /// <summary>
 /// Get labels of the pod.
 /// </summary>
 /// <param name="pod">pod.</param>
 /// <returns>labels.</returns>
 public static Zen <IDictionary <string, string> > GetLabels(this Zen <Pod> pod) => pod.GetField <Pod, IDictionary <string, string> >("Labels");
Exemple #26
0
 internal static Zen <ushort> GetWatchdogStartDropTime1(this Zen <SwitchState> wd)
 {
     return(wd.GetField <SwitchState, ushort>("WatchdogStartDropTime1"));
 }
 /// <summary>
 /// Get namespace of the pod.
 /// </summary>
 /// <param name="pod">pod.</param>
 /// <returns>name of namespace.</returns>
 public static Zen <string> GetNS(this Zen <Pod> pod) => pod.GetField <Pod, string>("Namespace");
 /// <summary>
 /// Get namespace of the policy.
 /// </summary>
 /// <param name="policy">policy.</param>
 /// <returns>name of the namespace.</returns>
 public static Zen <string> GetNS(this Zen <Policy> policy) => policy.GetField <Policy, string>("Namespace");
Exemple #29
0
 /// <summary>
 /// Get the Packet of a LocatedPacket.
 /// </summary>
 /// <param name="lp">The LocatedPacket.</param>
 /// <returns>The packet.</returns>
 public static Zen <IpHeader> GetHeader(this Zen <LocatedPacket> lp)
 {
     return(lp.GetField <LocatedPacket, IpHeader>("Header"));
 }
Exemple #30
0
 public static Zen <Option <IpHeader> > GetUnderlayHeader(this Zen <Packet> packet)
 {
     return(packet.GetField <Packet, Option <IpHeader> >("UnderlayHeader"));
 }