use of android.net.netlink.StructNlMsgErr in project android_frameworks_base by crdroidandroid.
the class NetlinkErrorMessageTest method testParseNlmErrorOk.
public void testParseNlmErrorOk() {
final ByteBuffer byteBuffer = ByteBuffer.wrap(NLM_ERROR_OK);
// For testing.
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer);
assertNotNull(msg);
assertTrue(msg instanceof NetlinkErrorMessage);
final NetlinkErrorMessage errorMsg = (NetlinkErrorMessage) msg;
final StructNlMsgHdr hdr = errorMsg.getHeader();
assertNotNull(hdr);
assertEquals(36, hdr.nlmsg_len);
assertEquals(NetlinkConstants.NLMSG_ERROR, hdr.nlmsg_type);
assertEquals(0, hdr.nlmsg_flags);
assertEquals(13606, hdr.nlmsg_seq);
assertEquals(4196, hdr.nlmsg_pid);
final StructNlMsgErr err = errorMsg.getNlMsgError();
assertNotNull(err);
assertEquals(0, err.error);
assertNotNull(err.msg);
assertEquals(48, err.msg.nlmsg_len);
assertEquals(NetlinkConstants.RTM_NEWNEIGH, err.msg.nlmsg_type);
assertEquals((NLM_F_REQUEST | NLM_F_ACK | NLM_F_REPLACE), err.msg.nlmsg_flags);
assertEquals(13606, err.msg.nlmsg_seq);
assertEquals(0, err.msg.nlmsg_pid);
}
use of android.net.netlink.StructNlMsgErr in project android_frameworks_base by DirtyUnicorns.
the class NetlinkErrorMessageTest method testParseNlmErrorOk.
public void testParseNlmErrorOk() {
final ByteBuffer byteBuffer = ByteBuffer.wrap(NLM_ERROR_OK);
// For testing.
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer);
assertNotNull(msg);
assertTrue(msg instanceof NetlinkErrorMessage);
final NetlinkErrorMessage errorMsg = (NetlinkErrorMessage) msg;
final StructNlMsgHdr hdr = errorMsg.getHeader();
assertNotNull(hdr);
assertEquals(36, hdr.nlmsg_len);
assertEquals(NetlinkConstants.NLMSG_ERROR, hdr.nlmsg_type);
assertEquals(0, hdr.nlmsg_flags);
assertEquals(13606, hdr.nlmsg_seq);
assertEquals(4196, hdr.nlmsg_pid);
final StructNlMsgErr err = errorMsg.getNlMsgError();
assertNotNull(err);
assertEquals(0, err.error);
assertNotNull(err.msg);
assertEquals(48, err.msg.nlmsg_len);
assertEquals(NetlinkConstants.RTM_NEWNEIGH, err.msg.nlmsg_type);
assertEquals((NLM_F_REQUEST | NLM_F_ACK | NLM_F_REPLACE), err.msg.nlmsg_flags);
assertEquals(13606, err.msg.nlmsg_seq);
assertEquals(0, err.msg.nlmsg_pid);
}
use of android.net.netlink.StructNlMsgErr in project android_frameworks_base by ResurrectionRemix.
the class NetlinkErrorMessageTest method testParseNlmErrorOk.
public void testParseNlmErrorOk() {
final ByteBuffer byteBuffer = ByteBuffer.wrap(NLM_ERROR_OK);
// For testing.
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer);
assertNotNull(msg);
assertTrue(msg instanceof NetlinkErrorMessage);
final NetlinkErrorMessage errorMsg = (NetlinkErrorMessage) msg;
final StructNlMsgHdr hdr = errorMsg.getHeader();
assertNotNull(hdr);
assertEquals(36, hdr.nlmsg_len);
assertEquals(NetlinkConstants.NLMSG_ERROR, hdr.nlmsg_type);
assertEquals(0, hdr.nlmsg_flags);
assertEquals(13606, hdr.nlmsg_seq);
assertEquals(4196, hdr.nlmsg_pid);
final StructNlMsgErr err = errorMsg.getNlMsgError();
assertNotNull(err);
assertEquals(0, err.error);
assertNotNull(err.msg);
assertEquals(48, err.msg.nlmsg_len);
assertEquals(NetlinkConstants.RTM_NEWNEIGH, err.msg.nlmsg_type);
assertEquals((NLM_F_REQUEST | NLM_F_ACK | NLM_F_REPLACE), err.msg.nlmsg_flags);
assertEquals(13606, err.msg.nlmsg_seq);
assertEquals(0, err.msg.nlmsg_pid);
}
use of android.net.netlink.StructNlMsgErr in project platform_frameworks_base by android.
the class NetlinkErrorMessageTest method testParseNlmErrorOk.
@SmallTest
public void testParseNlmErrorOk() {
final ByteBuffer byteBuffer = ByteBuffer.wrap(NLM_ERROR_OK);
// For testing.
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer);
assertNotNull(msg);
assertTrue(msg instanceof NetlinkErrorMessage);
final NetlinkErrorMessage errorMsg = (NetlinkErrorMessage) msg;
final StructNlMsgHdr hdr = errorMsg.getHeader();
assertNotNull(hdr);
assertEquals(36, hdr.nlmsg_len);
assertEquals(NetlinkConstants.NLMSG_ERROR, hdr.nlmsg_type);
assertEquals(0, hdr.nlmsg_flags);
assertEquals(13606, hdr.nlmsg_seq);
assertEquals(4196, hdr.nlmsg_pid);
final StructNlMsgErr err = errorMsg.getNlMsgError();
assertNotNull(err);
assertEquals(0, err.error);
assertNotNull(err.msg);
assertEquals(48, err.msg.nlmsg_len);
assertEquals(NetlinkConstants.RTM_NEWNEIGH, err.msg.nlmsg_type);
assertEquals((NLM_F_REQUEST | NLM_F_ACK | NLM_F_REPLACE), err.msg.nlmsg_flags);
assertEquals(13606, err.msg.nlmsg_seq);
assertEquals(0, err.msg.nlmsg_pid);
}
Aggregations