Package org.midonet.client.resource

Examples of org.midonet.client.resource.RuleChain.addRule()


                                    defaultBlock = true;
                                    break;
                                }
                            }
                            if (!defaultBlock) {
                                preFilter.addRule().type(DtoRule.Drop).nwDstAddress(publicIp).nwDstLength(32).create();
                            }
                        }
                    }
                }
            }
View Full Code Here


        for (Rule rule : egressChain.getRules()) {
            rule.delete();
        }

        // Add a matchForwardFlow rule so that we can accept all return traffic
        egressChain.addRule().type(DtoRule.Accept).matchForwardFlow(true).position(1).create();
    }

    protected RuleChain getOrInitEgressACLFilter(Network network) {
        boolean isVpc = getIsVpc(network);
        long id = getRouterId(network, isVpc);
View Full Code Here

            }
        }

        int pos = 1;
        // If it is ARP, accept it
        egressChain.addRule().type(DtoRule.Accept).dlType(0x0806).position(pos++).create();

        // If it is ICMP to the router, accept that
        egressChain.addRule()
            .type(DtoRule.Accept)
            .nwProto(SimpleFirewallRule.stringToProtocolNumber("icmp"))
View Full Code Here

        int pos = 1;
        // If it is ARP, accept it
        egressChain.addRule().type(DtoRule.Accept).dlType(0x0806).position(pos++).create();

        // If it is ICMP to the router, accept that
        egressChain.addRule()
            .type(DtoRule.Accept)
            .nwProto(SimpleFirewallRule.stringToProtocolNumber("icmp"))
            .nwDstAddress(network.getGateway())
            .nwDstLength(32)
            .position(pos++)
View Full Code Here

            .nwDstLength(32)
            .position(pos++)
            .create();

        // Everything else gets dropped
        egressChain.addRule().type(DtoRule.Drop).position(pos).create();

        return egressChain;
    }

    private void connectBridgeToRouter(Network network, Bridge netBridge, Router netRouter) {
View Full Code Here

            int pos = 1;

            RuleChain inc = api.addChain().name(getChainName(String.valueOf(network.getId()), routerName, RuleChainCode.ACL_INGRESS)).tenantId(accountIdStr).create();

            // If it is ARP, accept it
            inc.addRule().type(DtoRule.Accept).dlType(0x0806).position(pos++).create();

            // If it is ICMP to the router, accept that
            inc.addRule()
                .type(DtoRule.Accept)
                .nwProto(SimpleFirewallRule.stringToProtocolNumber("icmp"))
View Full Code Here

            // If it is ARP, accept it
            inc.addRule().type(DtoRule.Accept).dlType(0x0806).position(pos++).create();

            // If it is ICMP to the router, accept that
            inc.addRule()
                .type(DtoRule.Accept)
                .nwProto(SimpleFirewallRule.stringToProtocolNumber("icmp"))
                .nwDstAddress(network.getGateway())
                .nwDstLength(32)
                .position(pos++)
View Full Code Here

                .nwDstLength(32)
                .position(pos++)
                .create();

            // If it is connection tracked, accept that as well
            inc.addRule().type(DtoRule.Accept).matchReturnFlow(true).position(pos++).create();

            inc.addRule().type(DtoRule.Drop).position(pos).create();

            //
            RuleChain out = api.addChain().name(getChainName(String.valueOf(network.getId()), routerName, RuleChainCode.ACL_EGRESS)).tenantId(accountIdStr).create();
View Full Code Here

                .create();

            // If it is connection tracked, accept that as well
            inc.addRule().type(DtoRule.Accept).matchReturnFlow(true).position(pos++).create();

            inc.addRule().type(DtoRule.Drop).position(pos).create();

            //
            RuleChain out = api.addChain().name(getChainName(String.valueOf(network.getId()), routerName, RuleChainCode.ACL_EGRESS)).tenantId(accountIdStr).create();

            // Creating the first default rule here that does nothing
View Full Code Here

            //
            RuleChain out = api.addChain().name(getChainName(String.valueOf(network.getId()), routerName, RuleChainCode.ACL_EGRESS)).tenantId(accountIdStr).create();

            // Creating the first default rule here that does nothing
            // but start connection tracking.
            out.addRule().type(DtoRule.Accept).matchForwardFlow(true).position(1).create();

            routerPort.outboundFilterId(inc.getId());
            routerPort.inboundFilterId(out.getId());
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.