public State9Builder setRemotePort(PortNumber value) { if (value != null) { checkRemotePortRange(value.getValue()); } this._remotePort = value; return this; } /**
/** * @param connection Connection that will be parsed * @return InetSocket address of provided connection */ private InetSocketAddress getConnection(Connection connection) { return new InetSocketAddress(Search.getAddress(Preconditions.checkNotNull(connection).getPeerAddress()), Preconditions.checkNotNull(connection.getTcpPort()).getValue()); }
/** * Converts IpAddress and PortNumber to InetSocketAddress * * @param ipAddress * @param port * @return InetSocketAddress */ public static InetSocketAddress toInetSocketAddress(final IpAddress ipAddress, final PortNumber port) { final String ipString = toStringIP(ipAddress); return new InetSocketAddress(InetAddresses.forString(ipString), port.getValue()); }
@Override public void serialize(MatchEntry entry, ByteBuf outBuffer) { super.serialize(entry, outBuffer); UdpDstCase entryValue = (UdpDstCase) entry.getMatchEntryValue(); outBuffer.writeShort(entryValue.getUdpDst().getPort().getValue().intValue()); }
@Override public void serialize(MatchEntry entry, ByteBuf outBuffer) { super.serialize(entry, outBuffer); SctpDstCase entryValue = (SctpDstCase) entry.getMatchEntryValue(); outBuffer.writeShort(entryValue.getSctpDst().getPort().getValue().intValue()); }
@Override public void serialize(MatchEntry entry, ByteBuf outBuffer) { super.serialize(entry, outBuffer); TcpSrcCase entryValue = (TcpSrcCase) entry.getMatchEntryValue(); outBuffer.writeShort(entryValue.getTcpSrc().getPort().getValue().intValue()); }
@Override public void serialize(MatchEntry entry, ByteBuf outBuffer) { super.serialize(entry, outBuffer); UdpSrcCase entryValue = (UdpSrcCase) entry.getMatchEntryValue(); outBuffer.writeShort(entryValue.getUdpSrc().getPort().getValue().intValue()); }
public String addCcap() { ccapClient.connect(); if (ccapClient.isConnected) { logger.info("Connected to CCAP with ID - " + ccap.getCcapId()); return String .format("200 OK - CCAP %s connected @ %s:%d", ccap.getCcapId(), ipAddr.getIpv4Address().getValue(), portNum.getValue()); } else { return String.format("404 Not Found - CCAP %s failed to connect @ %s:%d - %s", ccap.getCcapId(), ipAddr.getIpv4Address().getValue(), portNum.getValue(), ccapClient.errMessage); } }
private static boolean convertL4TpSrcMatch(final MatchV10Builder matchBuilder, final TcpMatch tcpMatch) { if (tcpMatch.getTcpSourcePort() != null) { matchBuilder.setTpSrc(tcpMatch.getTcpSourcePort().getValue()); return false; } return true; }
public void handleSerializedLispBuffer(TransportAddress address, ByteBuffer outBuffer, final MessageType packetType) { InetAddress ip = getInetAddress(address); handleSerializedLispBuffer(ip, outBuffer, packetType, address.getPort().getValue()); }
private static boolean convertL4TpDstMatch(final MatchV10Builder matchBuilder, final TcpMatch tcpMatch) { if (tcpMatch.getTcpDestinationPort() != null) { matchBuilder.setTpDst(tcpMatch.getTcpDestinationPort().getValue()); return false; } return true; }
private static boolean convertL4UdpDstMatch(final MatchV10Builder matchBuilder, final UdpMatch udpMatch) { if (udpMatch.getUdpDestinationPort() != null) { matchBuilder.setTpDst(udpMatch.getUdpDestinationPort().getValue()); return false; } return true; }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); UdpDstCaseValue udpDstCase = ((UdpDstCaseValue) input.getMatchEntryValue()); outBuffer.writeShort(udpDstCase.getUdpDstValues().getPort().getValue()); outBuffer.writeShort(udpDstCase.getUdpDstValues().getMask()); }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); TcpSrcCaseValue tcpSrcCase = ((TcpSrcCaseValue) input.getMatchEntryValue()); outBuffer.writeShort(tcpSrcCase.getTcpSrcValues().getPort().getValue()); outBuffer.writeShort(tcpSrcCase.getTcpSrcValues().getMask()); }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); TcpDstCaseValue tcpDstCase = ((TcpDstCaseValue) input.getMatchEntryValue()); outBuffer.writeShort(tcpDstCase.getTcpDstValues().getPort().getValue()); outBuffer.writeShort(tcpDstCase.getTcpDstValues().getMask()); }
@Override public void customValidation() { JmxAttributeValidationException.checkNotNull(getBindingPort(), bindingPortJmxAttribute); // check if unix root user if (!PlatformDependent.isWindows() && !PlatformDependent.isRoot() && getBindingPort().getValue() < PRIVILEGED_PORTS) { throw new AccessControlException("Unable to bind port " + getBindingPort().getValue() + " while running as non-root user."); } }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); UdpSrcCaseValue udpSrcCase = ((UdpSrcCaseValue) input.getMatchEntryValue()); outBuffer.writeShort(udpSrcCase.getUdpSrcValues().getPort().getValue()); outBuffer.writeShort(udpSrcCase.getUdpSrcValues().getMask()); }
private InetSocketAddress getAddress() { final InetAddress inetAddr; try { inetAddr = InetAddress.getByName(getBindingAddress() .getIpv4Address() != null ? getBindingAddress() .getIpv4Address().getValue() : getBindingAddress() .getIpv6Address().getValue()); } catch (final UnknownHostException e) { throw new IllegalArgumentException("Illegal binding address " + getBindingAddress(), e); } return new InetSocketAddress(inetAddr, getBindingPort().getValue()); }
public PCMMService(final short clientType, final Ccap ccap) { this.clientType = clientType; this.ccap = ccap; ipAddr = ccap.getConnection().getIpAddress(); portNum = ccap.getConnection().getPort(); ccapClient = new CcapClient(ipAddr, portNum); logger.info("Attempting to add CCAP with ID {} @ {}:{}", ccap.getCcapId(), ipAddr.getIpv4Address().getValue(), portNum.getValue()); }
private void addIpProtocolMatch(AceIp aceIp) { int srcPort = 0; int dstPort = 0; // TODO Ranges are not supported yet if (aceIp.getSourcePortRange() != null && aceIp.getSourcePortRange().getLowerPort() != null) { srcPort = aceIp.getSourcePortRange().getLowerPort().getValue(); } if (aceIp.getDestinationPortRange() != null && aceIp.getDestinationPortRange().getLowerPort() != null) { dstPort = aceIp.getDestinationPortRange().getLowerPort().getValue(); } MatchUtils.createIpProtocolMatch(matchBuilder, aceIp.getProtocol()); MatchUtils.addLayer4Match(matchBuilder, aceIp.getProtocol().intValue(), srcPort, dstPort); }