Home
last modified time | relevance | path

Searched refs:byteBuffer (Results 1 – 25 of 127) sorted by relevance

123456

/packages/modules/IPsec/src/java/com/android/internal/net/eap/message/simaka/
DEapSimAkaAttribute.java147 public abstract void encode(ByteBuffer byteBuffer); in encode() argument
207 protected void encodeAttributeHeader(ByteBuffer byteBuffer) { in encodeAttributeHeader() argument
208 byteBuffer.put((byte) attributeType); in encodeAttributeHeader()
209 byteBuffer.put((byte) (lengthInBytes / LENGTH_SCALING)); in encodeAttributeHeader()
212 void consumePadding(int bytesUsed, ByteBuffer byteBuffer) { in consumePadding() argument
214 byteBuffer.get(new byte[paddingRemaining]); in consumePadding()
217 void addPadding(int bytesUsed, ByteBuffer byteBuffer) { in addPadding() argument
219 byteBuffer.put(new byte[paddingNeeded]); in addPadding()
234 ByteBuffer byteBuffer) throws EapSimAkaInvalidAttributeException { in EapSimAkaUnsupportedAttribute() argument
240 byteBuffer.get(data); in EapSimAkaUnsupportedAttribute()
[all …]
DEapSimAkaAttributeFactory.java83 EapSimAkaAttribute getAttribute(int attributeType, int lengthInBytes, ByteBuffer byteBuffer) in getAttribute() argument
88 return new AtPermanentIdReq(lengthInBytes, byteBuffer); in getAttribute()
90 return new AtAnyIdReq(lengthInBytes, byteBuffer); in getAttribute()
92 return new AtFullauthIdReq(lengthInBytes, byteBuffer); in getAttribute()
94 return new AtIdentity(lengthInBytes, byteBuffer); in getAttribute()
96 return new AtPadding(lengthInBytes, byteBuffer); in getAttribute()
98 return new AtMac(lengthInBytes, byteBuffer); in getAttribute()
100 return new AtCounter(lengthInBytes, byteBuffer); in getAttribute()
102 return new AtCounterTooSmall(lengthInBytes, byteBuffer); in getAttribute()
104 return new AtNonceS(lengthInBytes, byteBuffer); in getAttribute()
[all …]
DEapAkaAttributeFactory.java66 public EapSimAkaAttribute getAttribute(ByteBuffer byteBuffer) in getAttribute() argument
68 int attributeType = Byte.toUnsignedInt(byteBuffer.get()); in getAttribute()
71 int lengthInBytes = Byte.toUnsignedInt(byteBuffer.get()) * LENGTH_SCALING; in getAttribute()
73 return getAttribute(attributeType, lengthInBytes, byteBuffer); in getAttribute()
78 int attributeType, int lengthInBytes, ByteBuffer byteBuffer) in getAttribute() argument
82 return new AtRandAka(lengthInBytes, byteBuffer); in getAttribute()
84 return new AtAutn(lengthInBytes, byteBuffer); in getAttribute()
86 return new AtRes(lengthInBytes, byteBuffer); in getAttribute()
88 return new AtAuts(lengthInBytes, byteBuffer); in getAttribute()
90 return new AtBidding(lengthInBytes, byteBuffer); in getAttribute()
[all …]
/packages/modules/Connectivity/staticlibs/device/com/android/net/module/util/netlink/
DStructNlAttr.java60 public static StructNlAttr peek(ByteBuffer byteBuffer) { in peek() argument
61 if (byteBuffer == null || byteBuffer.remaining() < NLA_HEADERLEN) { in peek()
64 final int baseOffset = byteBuffer.position(); in peek()
67 final ByteOrder originalOrder = byteBuffer.order(); in peek()
68 byteBuffer.order(ByteOrder.nativeOrder()); in peek()
70 struct.nla_len = byteBuffer.getShort(); in peek()
71 struct.nla_type = byteBuffer.getShort(); in peek()
73 byteBuffer.order(originalOrder); in peek()
76 byteBuffer.position(baseOffset); in peek()
91 public static StructNlAttr parse(ByteBuffer byteBuffer) { in parse() argument
[all …]
DNetlinkMessage.java52 public static NetlinkMessage parse(@NonNull ByteBuffer byteBuffer, int nlFamily) { in parse() argument
53 final int startPosition = (byteBuffer != null) ? byteBuffer.position() : -1; in parse()
54 final StructNlMsgHdr nlmsghdr = StructNlMsgHdr.parse(byteBuffer); in parse()
61 if (payloadLength < 0 || payloadLength > byteBuffer.remaining()) { in parse()
63 byteBuffer.position(byteBuffer.limit()); in parse()
70 return parseCtlMessage(nlmsghdr, byteBuffer, payloadLength); in parse()
78 parsed = parseRtMessage(nlmsghdr, byteBuffer); in parse()
80 parsed = parseInetDiagMessage(nlmsghdr, byteBuffer); in parse()
82 parsed = parseNfMessage(nlmsghdr, byteBuffer); in parse()
84 parsed = parseXfrmMessage(nlmsghdr, byteBuffer); in parse()
[all …]
DStructInetDiagSockId.java84 public static StructInetDiagSockId parse(final ByteBuffer byteBuffer, final short family) { in parse() argument
85 if (byteBuffer.remaining() < STRUCT_SIZE) { in parse()
89 byteBuffer.order(BIG_ENDIAN); in parse()
90 final int srcPort = Short.toUnsignedInt(byteBuffer.getShort()); in parse()
91 final int dstPort = Short.toUnsignedInt(byteBuffer.getShort()); in parse()
98 byteBuffer.get(srcAddrByte); in parse()
101 byteBuffer.position(byteBuffer.position() + (IPV6_ADDR_LEN - IPV4_ADDR_LEN)); in parse()
102 byteBuffer.get(dstAddrByte); in parse()
103 byteBuffer.position(byteBuffer.position() + (IPV6_ADDR_LEN - IPV4_ADDR_LEN)); in parse()
114 byteBuffer.get(srcAddrByte); in parse()
[all …]
DStructNfGenMsg.java50 public static StructNfGenMsg parse(@NonNull ByteBuffer byteBuffer) { in parse() argument
51 Objects.requireNonNull(byteBuffer); in parse()
53 if (!hasAvailableSpace(byteBuffer)) return null; in parse()
55 final byte nfgen_family = byteBuffer.get(); in parse()
56 final byte version = byteBuffer.get(); in parse()
58 final ByteOrder originalOrder = byteBuffer.order(); in parse()
59 byteBuffer.order(ByteOrder.BIG_ENDIAN); in parse()
60 final short res_id = byteBuffer.getShort(); in parse()
61 byteBuffer.order(originalOrder); in parse()
81 public void pack(ByteBuffer byteBuffer) { in pack() argument
[all …]
DStructNdMsg.java118 private static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
119 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
129 public static StructNdMsg parse(ByteBuffer byteBuffer) { in parse() argument
130 if (!hasAvailableSpace(byteBuffer)) return null; in parse()
136 struct.ndm_family = byteBuffer.get(); in parse()
137 final byte pad1 = byteBuffer.get(); in parse()
138 final short pad2 = byteBuffer.getShort(); in parse()
139 struct.ndm_ifindex = byteBuffer.getInt(); in parse()
140 struct.ndm_state = byteBuffer.getShort(); in parse()
141 struct.ndm_flags = byteBuffer.get(); in parse()
[all …]
DRtNetlinkNeighborMessage.java61 @NonNull ByteBuffer byteBuffer) { in parse() argument
64 neighMsg.mNdmsg = StructNdMsg.parse(byteBuffer); in parse()
70 final int baseOffset = byteBuffer.position(); in parse()
71 StructNlAttr nlAttr = StructNlAttr.findNextAttrOfType(NDA_DST, byteBuffer); in parse()
76 byteBuffer.position(baseOffset); in parse()
77 nlAttr = StructNlAttr.findNextAttrOfType(NDA_LLADDR, byteBuffer); in parse()
82 byteBuffer.position(baseOffset); in parse()
83 nlAttr = StructNlAttr.findNextAttrOfType(NDA_PROBES, byteBuffer); in parse()
88 byteBuffer.position(baseOffset); in parse()
89 nlAttr = StructNlAttr.findNextAttrOfType(NDA_CACHEINFO, byteBuffer); in parse()
[all …]
DConntrackMessage.java206 final ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); in newIPv4TimeoutUpdateRequest() local
207 byteBuffer.order(ByteOrder.nativeOrder()); in newIPv4TimeoutUpdateRequest()
215 ctmsg.pack(byteBuffer); in newIPv4TimeoutUpdateRequest()
217 ctaTupleOrig.pack(byteBuffer); in newIPv4TimeoutUpdateRequest()
218 ctaTimeout.pack(byteBuffer); in newIPv4TimeoutUpdateRequest()
233 @NonNull ByteBuffer byteBuffer) { in parse() argument
237 final StructNfGenMsg nfGenMsg = StructNfGenMsg.parse(byteBuffer); in parse()
242 final int baseOffset = byteBuffer.position(); in parse()
243 StructNlAttr nlAttr = findNextAttrOfType(CTA_STATUS, byteBuffer); in parse()
249 byteBuffer.position(baseOffset); in parse()
[all …]
DRtNetlinkRouteMessage.java193 @NonNull final ByteBuffer byteBuffer) { in parse() argument
194 final StructRtMsg rtmsg = StructRtMsg.parse(byteBuffer); in parse()
201 final int baseOffset = byteBuffer.position(); in parse()
202 StructNlAttr nlAttr = StructNlAttr.findNextAttrOfType(RTA_DST, byteBuffer); in parse()
219 byteBuffer.position(baseOffset); in parse()
220 nlAttr = StructNlAttr.findNextAttrOfType(RTA_SRC, byteBuffer); in parse()
231 byteBuffer.position(baseOffset); in parse()
232 nlAttr = StructNlAttr.findNextAttrOfType(RTA_GATEWAY, byteBuffer); in parse()
242 byteBuffer.position(baseOffset); in parse()
243 nlAttr = StructNlAttr.findNextAttrOfType(RTA_IIF, byteBuffer); in parse()
[all …]
DStructNlMsgHdr.java93 private static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
94 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
101 public static StructNlMsgHdr parse(@NonNull ByteBuffer byteBuffer) { in parse() argument
102 if (!hasAvailableSpace(byteBuffer)) return null; in parse()
108 struct.nlmsg_len = byteBuffer.getInt(); in parse()
109 struct.nlmsg_type = byteBuffer.getShort(); in parse()
110 struct.nlmsg_flags = byteBuffer.getShort(); in parse()
111 struct.nlmsg_seq = byteBuffer.getInt(); in parse()
112 struct.nlmsg_pid = byteBuffer.getInt(); in parse()
146 public void pack(ByteBuffer byteBuffer) { in pack() argument
[all …]
DRtNetlinkAddressMessage.java111 @NonNull final ByteBuffer byteBuffer) { in parse() argument
114 addrMsg.mIfaddrmsg = StructIfaddrMsg.parse(byteBuffer); in parse()
118 final int baseOffset = byteBuffer.position(); in parse()
119 StructNlAttr nlAttr = StructNlAttr.findNextAttrOfType(IFA_ADDRESS, byteBuffer); in parse()
125 byteBuffer.position(baseOffset); in parse()
126 nlAttr = StructNlAttr.findNextAttrOfType(IFA_CACHEINFO, byteBuffer); in parse()
135 byteBuffer.position(baseOffset); in parse()
136 nlAttr = StructNlAttr.findNextAttrOfType(IFA_FLAGS, byteBuffer); in parse()
149 protected void pack(ByteBuffer byteBuffer) { in pack() argument
150 getHeader().pack(byteBuffer); in pack()
[all …]
DRtNetlinkLinkMessage.java93 @NonNull final ByteBuffer byteBuffer) { in parse() argument
96 linkMsg.mIfinfomsg = StructIfinfoMsg.parse(byteBuffer); in parse()
100 final int baseOffset = byteBuffer.position(); in parse()
101 StructNlAttr nlAttr = StructNlAttr.findNextAttrOfType(IFLA_MTU, byteBuffer); in parse()
107 byteBuffer.position(baseOffset); in parse()
108 nlAttr = StructNlAttr.findNextAttrOfType(IFLA_ADDRESS, byteBuffer); in parse()
114 byteBuffer.position(baseOffset); in parse()
115 nlAttr = StructNlAttr.findNextAttrOfType(IFLA_IFNAME, byteBuffer); in parse()
127 protected void pack(ByteBuffer byteBuffer) { in pack() argument
128 getHeader().pack(byteBuffer); in pack()
[all …]
DStructInetDiagMsg.java67 public static StructInetDiagMsg parse(@NonNull ByteBuffer byteBuffer) { in parse() argument
68 if (byteBuffer.remaining() < STRUCT_SIZE) { in parse()
72 struct.idiag_family = unsignedByte(byteBuffer.get()); in parse()
73 struct.idiag_state = unsignedByte(byteBuffer.get()); in parse()
74 struct.idiag_timer = unsignedByte(byteBuffer.get()); in parse()
75 struct.idiag_retrans = unsignedByte(byteBuffer.get()); in parse()
76 struct.id = StructInetDiagSockId.parse(byteBuffer, struct.idiag_family); in parse()
80 struct.idiag_expires = Integer.toUnsignedLong(byteBuffer.getInt()); in parse()
81 struct.idiag_rqueue = Integer.toUnsignedLong(byteBuffer.getInt()); in parse()
82 struct.idiag_wqueue = Integer.toUnsignedLong(byteBuffer.getInt()); in parse()
[all …]
DStructNlMsgErr.java31 private static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
32 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
42 public static StructNlMsgErr parse(ByteBuffer byteBuffer) { in parse() argument
43 if (!hasAvailableSpace(byteBuffer)) return null; in parse()
49 struct.error = byteBuffer.getInt(); in parse()
50 struct.msg = StructNlMsgHdr.parse(byteBuffer); in parse()
60 public void pack(ByteBuffer byteBuffer) { in pack() argument
64 byteBuffer.putInt(error); in pack()
66 msg.pack(byteBuffer); in pack()
DStructNdaCacheInfo.java34 private static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
35 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
45 public static StructNdaCacheInfo parse(ByteBuffer byteBuffer) { in parse() argument
46 if (!hasAvailableSpace(byteBuffer)) return null; in parse()
52 struct.ndm_used = byteBuffer.getInt(); in parse()
53 struct.ndm_confirmed = byteBuffer.getInt(); in parse()
54 struct.ndm_updated = byteBuffer.getInt(); in parse()
55 struct.ndm_refcnt = byteBuffer.getInt(); in parse()
DStructInetDiagReqV2.java63 public void pack(ByteBuffer byteBuffer) { in pack() argument
65 byteBuffer.put((byte) mSdiagFamily); in pack()
66 byteBuffer.put((byte) mSdiagProtocol); in pack()
67 byteBuffer.put((byte) mIdiagExt); in pack()
68 byteBuffer.put((byte) mPad); in pack()
69 byteBuffer.putInt(mState); in pack()
70 if (mId != null) mId.pack(byteBuffer); in pack()
/packages/modules/Connectivity/staticlibs/tests/unit/src/com/android/net/module/util/netlink/
DRtNetlinkRouteMessageTest.java99 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWROUTE_HEX); in testParseRtmRouteMessage() local
100 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmRouteMessage()
102 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, NETLINK_ROUTE); in testParseRtmRouteMessage()
120 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWROUTE_PACK_HEX); in testPackRtmNewRoute() local
121 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testPackRtmNewRoute()
122 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, NETLINK_ROUTE); in testPackRtmNewRoute()
151 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWROUTE_MULTICAST_IPV6_HEX); in testParseRtmNewRoute_MulticastIpv6() local
152 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmNewRoute_MulticastIpv6()
154 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, NETLINK_ROUTE); in testParseRtmNewRoute_MulticastIpv6()
187 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWROUTE_MULTICAST_IPV6_PACK_HEX); in testPackRtmNewRoute_MulticastIpv6() local
[all …]
DRtNetlinkLinkMessageTest.java64 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWLINK_HEX); in testParseRtmNewLink() local
65 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmNewLink()
66 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, NETLINK_ROUTE); in testParseRtmNewLink()
116 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWLINK_UTF8_HEX); in testParseRtmNewLink_utf8Ifname() local
117 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmNewLink_utf8Ifname()
118 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, NETLINK_ROUTE); in testParseRtmNewLink_utf8Ifname()
135 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWLINK_PACK_HEX); in testPackRtmNewLink() local
136 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testPackRtmNewLink()
137 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, NETLINK_ROUTE); in testPackRtmNewLink()
160 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWLINK_TRUNCATED_HEX); in testTruncatedRtmNewLink() local
[all …]
DConntrackMessageTest.java149 final ByteBuffer byteBuffer = ByteBuffer.wrap(tcp); in testConntrackParseIPv4TcpTimeoutUpdate() local
150 byteBuffer.order(ByteOrder.nativeOrder()); in testConntrackParseIPv4TcpTimeoutUpdate()
151 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, OsConstants.NETLINK_NETFILTER); in testConntrackParseIPv4TcpTimeoutUpdate()
198 final ByteBuffer byteBuffer = ByteBuffer.wrap(udp); in testConntrackParseIPv4UdpTimeoutUpdate() local
199 byteBuffer.order(ByteOrder.nativeOrder()); in testConntrackParseIPv4UdpTimeoutUpdate()
200 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, OsConstants.NETLINK_NETFILTER); in testConntrackParseIPv4UdpTimeoutUpdate()
292 final ByteBuffer byteBuffer = ByteBuffer.wrap(CT_V4NEW_TCP_BYTES); in testParseCtNew() local
293 byteBuffer.order(ByteOrder.nativeOrder()); in testParseCtNew()
294 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, OsConstants.NETLINK_NETFILTER); in testParseCtNew()
343 final ByteBuffer byteBuffer = ByteBuffer.wrap(truncated); in testParseTruncation() local
[all …]
DRtNetlinkAddressMessageTest.java72 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWADDR_HEX); in testParseRtmNewAddress() local
73 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmNewAddress()
74 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, NETLINK_ROUTE); in testParseRtmNewAddress()
112 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWADDR_PACK_HEX); in testPackRtmNewAddr() local
113 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testPackRtmNewAddr()
114 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, NETLINK_ROUTE); in testPackRtmNewAddr()
134 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWADDR_TRUNCATED_HEX); in testTruncatedRtmNewAddr() local
135 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testTruncatedRtmNewAddr()
136 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer, NETLINK_ROUTE); in testTruncatedRtmNewAddr()
322 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWADDR_HEX); in testToString() local
[all …]
/packages/apps/Gallery2/src/com/android/gallery3d/glrenderer/
DNinePatchChunk.java50 ByteBuffer byteBuffer = in deserialize() local
53 byte wasSerialized = byteBuffer.get(); in deserialize()
57 chunk.mDivX = new int[byteBuffer.get()]; in deserialize()
58 chunk.mDivY = new int[byteBuffer.get()]; in deserialize()
59 chunk.mColor = new int[byteBuffer.get()]; in deserialize()
65 byteBuffer.getInt(); in deserialize()
66 byteBuffer.getInt(); in deserialize()
68 chunk.mPaddings.left = byteBuffer.getInt(); in deserialize()
69 chunk.mPaddings.right = byteBuffer.getInt(); in deserialize()
70 chunk.mPaddings.top = byteBuffer.getInt(); in deserialize()
[all …]
/packages/modules/HealthFitness/service/java/com/android/server/healthconnect/storage/utils/
DStorageUtils.java130 ByteBuffer byteBuffer = ByteBuffer.allocate(total); in getUUID() local
132 byteBuffer.put(byteArray); in getUUID()
134 return UUID.nameUUIDFromBytes(byteBuffer.array()); in getUUID()
416 ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); in convertBytesToUUID() local
417 long high = byteBuffer.getLong(); in convertBytesToUUID()
418 long low = byteBuffer.getLong(); in convertBytesToUUID()
423 ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[16]); in convertUUIDToBytes() local
424 byteBuffer.putLong(uuid.getMostSignificantBits()); in convertUUIDToBytes()
425 byteBuffer.putLong(uuid.getLeastSignificantBits()); in convertUUIDToBytes()
426 return byteBuffer.array(); in convertUUIDToBytes()
[all …]
/packages/modules/Connectivity/staticlibs/device/com/android/net/module/util/netlink/xfrm/
DXfrmNetlinkMessage.java68 @NonNull final StructNlMsgHdr nlmsghdr, @NonNull final ByteBuffer byteBuffer) { in parseXfrmInternal() argument
71 return XfrmNetlinkNewSaMessage.parseInternal(nlmsghdr, byteBuffer); in parseXfrmInternal()
73 return XfrmNetlinkGetSaMessage.parseInternal(nlmsghdr, byteBuffer); in parseXfrmInternal()
79 protected abstract void packPayload(@NonNull final ByteBuffer byteBuffer); in packPayload() argument
82 public void pack(@NonNull final ByteBuffer byteBuffer) { in pack() argument
83 getHeader().pack(byteBuffer); in pack()
84 packPayload(byteBuffer); in pack()

123456