简体   繁体   中英

opendaylight: what is the purpose of InstructionKey?

I am programming an SDN application using opendaylight. I see that an InstructionKey is required to create an instruction but I don't know where it is used. Any idea what it's use is?

I am always setting it to new InstructionKey(0) but I am not sure if this is correct. Thanks.

The InstructionKey is not necessary. This is part of code I have created :

Instruction applyActionsInstruction = new InstructionBuilder()
        .setOrder(0).setInstruction(new ApplyActionsCaseBuilder()
                .setApplyActions(applyActions)
                .build())
        .build();

instructions.add(applyActionsInstruction);

Instructions allInstructions = new InstructionsBuilder()
        .setInstruction(instructions)
        .build();

and it works fine, the Instruction is created even without the key specified.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM