//action Set_nhop(out IPv4Address nextHop, // NOTE directioned parameters must be bound in the actions list specification (so not by api?) // IPv4Address ipv4_dest, // NOTE directionless parameters bound by control plane // PortId port) //{ // nextHop = ipv4_dest; // headers.ip.ttl = headers.ip.ttl - 1; // outCtrl.outputPort = port; //} private static void Set_nhop(TopPipe_Args args, ref IPv4Address nextHop, IPv4Address ipv4_dest, PortId port) { nextHop = ipv4_dest; args.headers.ip.ttl = new bit8((byte)(args.headers.ip.ttl.Value - 1)); args.outCtrl.outputPort = port; }
public Set_nhop_Action(IPv4Address ipv4_dest, PortId port) : base(action_list.Set_nhop) { this.ipv4_dest = ipv4_dest; this.port = port; }