completeUDPWrite() — netty Function Reference
Architecture documentation for the completeUDPWrite() function in PcapWriteHandler.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 4e4d1dfd_9ca2_974c_7198_72a58937e36e["completeUDPWrite()"] 59f0289b_ecfd_de3c_3397_4cf08e2047d1["PcapWriteHandler"] 4e4d1dfd_9ca2_974c_7198_72a58937e36e -->|defined in| 59f0289b_ecfd_de3c_3397_4cf08e2047d1 06ef8177_bf66_5538_b798_56d322fe8d3e["handleUDP()"] 06ef8177_bf66_5538_b798_56d322fe8d3e -->|calls| 4e4d1dfd_9ca2_974c_7198_72a58937e36e style 4e4d1dfd_9ca2_974c_7198_72a58937e36e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
handler/src/main/java/io/netty/handler/pcap/PcapWriteHandler.java lines 556–592
private void completeUDPWrite(InetSocketAddress srcAddr, InetSocketAddress dstAddr, ByteBuf udpBuf,
ByteBufAllocator byteBufAllocator, ChannelHandlerContext ctx) {
ByteBuf ipBuf = byteBufAllocator.buffer();
ByteBuf ethernetBuf = byteBufAllocator.buffer();
ByteBuf pcap = byteBufAllocator.buffer();
try {
if (srcAddr.getAddress() instanceof Inet4Address && dstAddr.getAddress() instanceof Inet4Address) {
IPPacket.writeUDPv4(ipBuf, udpBuf,
NetUtil.ipv4AddressToInt((Inet4Address) srcAddr.getAddress()),
NetUtil.ipv4AddressToInt((Inet4Address) dstAddr.getAddress()));
EthernetPacket.writeIPv4(ethernetBuf, ipBuf);
} else if (srcAddr.getAddress() instanceof Inet6Address && dstAddr.getAddress() instanceof Inet6Address) {
IPPacket.writeUDPv6(ipBuf, udpBuf,
srcAddr.getAddress().getAddress(),
dstAddr.getAddress().getAddress());
EthernetPacket.writeIPv6(ethernetBuf, ipBuf);
} else {
logger.error("Source and Destination IP Address versions are not same. Source Address: {}, " +
"Destination Address: {}", srcAddr.getAddress(), dstAddr.getAddress());
return;
}
// Write Packet into Pcap
pCapWriter.writePacket(pcap, ethernetBuf);
} catch (IOException ex) {
logger.error("Caught Exception While Writing Packet into Pcap", ex);
ctx.fireExceptionCaught(ex);
} finally {
ipBuf.release();
ethernetBuf.release();
pcap.release();
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does completeUDPWrite() do?
completeUDPWrite() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/pcap/PcapWriteHandler.java.
Where is completeUDPWrite() defined?
completeUDPWrite() is defined in handler/src/main/java/io/netty/handler/pcap/PcapWriteHandler.java at line 556.
What calls completeUDPWrite()?
completeUDPWrite() is called by 1 function(s): handleUDP.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free