Lines Matching refs:args
53 static void extractIpPorts(WakeupController::ReportArgs& args, Slice payload) { in extractIpPorts() argument
54 switch (args.ipNextHeader) { in extractIpPorts()
60 args.srcPort = ntohs(header.th_sport); in extractIpPorts()
61 args.dstPort = ntohs(header.th_dport); in extractIpPorts()
69 args.srcPort = ntohs(header.uh_sport); in extractIpPorts()
70 args.dstPort = ntohs(header.uh_dport); in extractIpPorts()
78 static void extractIpHeader(WakeupController::ReportArgs& args, Slice payload) { in extractIpHeader() argument
79 switch (args.ethertype) { in extractIpHeader()
85 args.ipNextHeader = header.protocol; in extractIpHeader()
88 args.srcIp = addr; in extractIpHeader()
90 args.dstIp = addr; in extractIpHeader()
91 extractIpPorts(args, drop(payload, header.ihl * 4)); // ipv4 IHL counts 32 bit words. in extractIpHeader()
99 args.ipNextHeader = header.ip6_nxt; in extractIpHeader()
102 args.srcIp = addr; in extractIpHeader()
104 args.dstIp = addr; in extractIpHeader()
106 if (args.ipNextHeader == IPPROTO_TCP || args.ipNextHeader == IPPROTO_UDP) { in extractIpHeader()
107 extractIpPorts(args, drop(payload, sizeof(header))); in extractIpHeader()
124 struct WakeupController::ReportArgs args = { in init() local
135 const auto attrHandler = [&args, &parseAgain](const nlattr attr, const Slice payload) { in init()
141 args.timestampNs = ntohl(ts.tv_nsec) + (ntohl(ts.tv_sec) * kNsPerS); in init()
146 args.prefix = toString(take(payload, payload.size() - 1)); in init()
149 extract(payload, args.uid); in init()
150 args.uid = ntohl(args.uid); in init()
153 extract(payload, args.gid); in init()
154 args.gid = ntohl(args.gid); in init()
161 args.dstHw.assign(hwaddr.hw_addr, hwaddr.hw_addr + hwAddrLen); in init()
167 args.ethertype = ntohs(packetHdr.hw_protocol); in init()
174 parseAgain = (args.ethertype == -1); in init()
175 extractIpHeader(args, payload); in init()
188 mReport(args); in init()