Lines Matching refs:len
803 int len; in get_labels() local
808 len = hex32_arg(&buffer[i], 8, &tmp); in get_labels()
809 if (len <= 0) in get_labels()
810 return len; in get_labels()
814 i += len; in get_labels()
862 int i, max, len; in pktgen_if_write() local
886 len = strn_len(&user_buffer[i], sizeof(name) - 1); in pktgen_if_write()
887 if (len < 0) in pktgen_if_write()
888 return len; in pktgen_if_write()
891 if (copy_from_user(name, &user_buffer[i], len)) in pktgen_if_write()
893 i += len; in pktgen_if_write()
896 len = count_trail_chars(&user_buffer[i], max); in pktgen_if_write()
897 if (len < 0) in pktgen_if_write()
898 return len; in pktgen_if_write()
900 i += len; in pktgen_if_write()
914 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
915 if (len < 0) in pktgen_if_write()
916 return len; in pktgen_if_write()
918 i += len; in pktgen_if_write()
931 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
932 if (len < 0) in pktgen_if_write()
933 return len; in pktgen_if_write()
935 i += len; in pktgen_if_write()
950 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
951 if (len < 0) in pktgen_if_write()
952 return len; in pktgen_if_write()
954 i += len; in pktgen_if_write()
967 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
968 if (len < 0) in pktgen_if_write()
969 return len; in pktgen_if_write()
971 i += len; in pktgen_if_write()
978 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
979 if (len < 0) in pktgen_if_write()
980 return len; in pktgen_if_write()
982 i += len; in pktgen_if_write()
988 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
989 if (len < 0) in pktgen_if_write()
990 return len; in pktgen_if_write()
992 i += len; in pktgen_if_write()
1003 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1004 if (len < 0) in pktgen_if_write()
1005 return len; in pktgen_if_write()
1007 i += len; in pktgen_if_write()
1009 return len; in pktgen_if_write()
1018 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1019 if (len < 0) in pktgen_if_write()
1020 return len; in pktgen_if_write()
1022 i += len; in pktgen_if_write()
1024 return len; in pktgen_if_write()
1033 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1034 if (len < 0) in pktgen_if_write()
1035 return len; in pktgen_if_write()
1037 i += len; in pktgen_if_write()
1046 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1047 if (len < 0) in pktgen_if_write()
1048 return len; in pktgen_if_write()
1050 i += len; in pktgen_if_write()
1059 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1060 if (len < 0) in pktgen_if_write()
1061 return len; in pktgen_if_write()
1063 i += len; in pktgen_if_write()
1072 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1073 if (len < 0) in pktgen_if_write()
1074 return len; in pktgen_if_write()
1076 i += len; in pktgen_if_write()
1085 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1086 if (len < 0) in pktgen_if_write()
1087 return len; in pktgen_if_write()
1092 i += len; in pktgen_if_write()
1099 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1100 if (len < 0) in pktgen_if_write()
1101 return len; in pktgen_if_write()
1103 i += len; in pktgen_if_write()
1110 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1111 if (len < 0) in pktgen_if_write()
1112 return len; in pktgen_if_write()
1114 i += len; in pktgen_if_write()
1124 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1125 if (len < 0) in pktgen_if_write()
1126 return len; in pktgen_if_write()
1128 i += len; in pktgen_if_write()
1138 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1139 if (len < 0) in pktgen_if_write()
1140 return len; in pktgen_if_write()
1142 i += len; in pktgen_if_write()
1153 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1154 if (len < 0) in pktgen_if_write()
1155 return len; in pktgen_if_write()
1157 i += len; in pktgen_if_write()
1175 len = strn_len(&user_buffer[i], sizeof(f) - 1); in pktgen_if_write()
1176 if (len < 0) in pktgen_if_write()
1177 return len; in pktgen_if_write()
1179 if (copy_from_user(f, &user_buffer[i], len)) in pktgen_if_write()
1181 i += len; in pktgen_if_write()
1219 len = strn_len(&user_buffer[i], sizeof(f) - 1); in pktgen_if_write()
1220 if (len < 0) in pktgen_if_write()
1221 return len; in pktgen_if_write()
1223 if (copy_from_user(f, &user_buffer[i], len)) in pktgen_if_write()
1225 i += len; in pktgen_if_write()
1253 len = strn_len(&user_buffer[i], sizeof(pkt_dev->dst_min) - 1); in pktgen_if_write()
1254 if (len < 0) in pktgen_if_write()
1255 return len; in pktgen_if_write()
1257 if (copy_from_user(buf, &user_buffer[i], len)) in pktgen_if_write()
1259 buf[len] = 0; in pktgen_if_write()
1268 i += len; in pktgen_if_write()
1273 len = strn_len(&user_buffer[i], sizeof(pkt_dev->dst_max) - 1); in pktgen_if_write()
1274 if (len < 0) in pktgen_if_write()
1275 return len; in pktgen_if_write()
1277 if (copy_from_user(buf, &user_buffer[i], len)) in pktgen_if_write()
1279 buf[len] = 0; in pktgen_if_write()
1288 i += len; in pktgen_if_write()
1293 len = strn_len(&user_buffer[i], sizeof(buf) - 1); in pktgen_if_write()
1294 if (len < 0) in pktgen_if_write()
1295 return len; in pktgen_if_write()
1299 if (copy_from_user(buf, &user_buffer[i], len)) in pktgen_if_write()
1301 buf[len] = 0; in pktgen_if_write()
1311 i += len; in pktgen_if_write()
1316 len = strn_len(&user_buffer[i], sizeof(buf) - 1); in pktgen_if_write()
1317 if (len < 0) in pktgen_if_write()
1318 return len; in pktgen_if_write()
1322 if (copy_from_user(buf, &user_buffer[i], len)) in pktgen_if_write()
1324 buf[len] = 0; in pktgen_if_write()
1333 i += len; in pktgen_if_write()
1338 len = strn_len(&user_buffer[i], sizeof(buf) - 1); in pktgen_if_write()
1339 if (len < 0) in pktgen_if_write()
1340 return len; in pktgen_if_write()
1344 if (copy_from_user(buf, &user_buffer[i], len)) in pktgen_if_write()
1346 buf[len] = 0; in pktgen_if_write()
1354 i += len; in pktgen_if_write()
1359 len = strn_len(&user_buffer[i], sizeof(buf) - 1); in pktgen_if_write()
1360 if (len < 0) in pktgen_if_write()
1361 return len; in pktgen_if_write()
1365 if (copy_from_user(buf, &user_buffer[i], len)) in pktgen_if_write()
1367 buf[len] = 0; in pktgen_if_write()
1377 i += len; in pktgen_if_write()
1382 len = strn_len(&user_buffer[i], sizeof(pkt_dev->src_min) - 1); in pktgen_if_write()
1383 if (len < 0) in pktgen_if_write()
1384 return len; in pktgen_if_write()
1386 if (copy_from_user(buf, &user_buffer[i], len)) in pktgen_if_write()
1388 buf[len] = 0; in pktgen_if_write()
1397 i += len; in pktgen_if_write()
1402 len = strn_len(&user_buffer[i], sizeof(pkt_dev->src_max) - 1); in pktgen_if_write()
1403 if (len < 0) in pktgen_if_write()
1404 return len; in pktgen_if_write()
1406 if (copy_from_user(buf, &user_buffer[i], len)) in pktgen_if_write()
1408 buf[len] = 0; in pktgen_if_write()
1417 i += len; in pktgen_if_write()
1422 len = strn_len(&user_buffer[i], sizeof(valstr) - 1); in pktgen_if_write()
1423 if (len < 0) in pktgen_if_write()
1424 return len; in pktgen_if_write()
1427 if (copy_from_user(valstr, &user_buffer[i], len)) in pktgen_if_write()
1439 len = strn_len(&user_buffer[i], sizeof(valstr) - 1); in pktgen_if_write()
1440 if (len < 0) in pktgen_if_write()
1441 return len; in pktgen_if_write()
1444 if (copy_from_user(valstr, &user_buffer[i], len)) in pktgen_if_write()
1463 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1464 if (len < 0) in pktgen_if_write()
1465 return len; in pktgen_if_write()
1467 i += len; in pktgen_if_write()
1477 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1478 if (len < 0) in pktgen_if_write()
1479 return len; in pktgen_if_write()
1481 i += len; in pktgen_if_write()
1488 len = num_arg(&user_buffer[i], 10, &value); in pktgen_if_write()
1489 if (len < 0) in pktgen_if_write()
1490 return len; in pktgen_if_write()
1492 i += len; in pktgen_if_write()
1499 len = num_arg(&user_buffer[i], 5, &value); in pktgen_if_write()
1500 if (len < 0) in pktgen_if_write()
1501 return len; in pktgen_if_write()
1503 i += len; in pktgen_if_write()
1510 len = num_arg(&user_buffer[i], 5, &value); in pktgen_if_write()
1511 if (len < 0) in pktgen_if_write()
1512 return len; in pktgen_if_write()
1514 i += len; in pktgen_if_write()
1523 len = get_labels(&user_buffer[i], pkt_dev); in pktgen_if_write()
1524 if (len < 0) in pktgen_if_write()
1525 return len; in pktgen_if_write()
1526 i += len; in pktgen_if_write()
1544 len = num_arg(&user_buffer[i], 4, &value); in pktgen_if_write()
1545 if (len < 0) in pktgen_if_write()
1546 return len; in pktgen_if_write()
1548 i += len; in pktgen_if_write()
1571 len = num_arg(&user_buffer[i], 1, &value); in pktgen_if_write()
1572 if (len < 0) in pktgen_if_write()
1573 return len; in pktgen_if_write()
1575 i += len; in pktgen_if_write()
1586 len = num_arg(&user_buffer[i], 1, &value); in pktgen_if_write()
1587 if (len < 0) in pktgen_if_write()
1588 return len; in pktgen_if_write()
1590 i += len; in pktgen_if_write()
1601 len = num_arg(&user_buffer[i], 4, &value); in pktgen_if_write()
1602 if (len < 0) in pktgen_if_write()
1603 return len; in pktgen_if_write()
1605 i += len; in pktgen_if_write()
1628 len = num_arg(&user_buffer[i], 1, &value); in pktgen_if_write()
1629 if (len < 0) in pktgen_if_write()
1630 return len; in pktgen_if_write()
1632 i += len; in pktgen_if_write()
1643 len = num_arg(&user_buffer[i], 1, &value); in pktgen_if_write()
1644 if (len < 0) in pktgen_if_write()
1645 return len; in pktgen_if_write()
1647 i += len; in pktgen_if_write()
1659 len = hex32_arg(&user_buffer[i], 2, &tmp_value); in pktgen_if_write()
1660 if (len < 0) in pktgen_if_write()
1661 return len; in pktgen_if_write()
1663 i += len; in pktgen_if_write()
1664 if (len == 2) { in pktgen_if_write()
1675 len = hex32_arg(&user_buffer[i], 2, &tmp_value); in pktgen_if_write()
1676 if (len < 0) in pktgen_if_write()
1677 return len; in pktgen_if_write()
1679 i += len; in pktgen_if_write()
1680 if (len == 2) { in pktgen_if_write()
1690 len = num_arg(&user_buffer[i], 9, &value); in pktgen_if_write()
1691 if (len < 0) in pktgen_if_write()
1692 return len; in pktgen_if_write()
1694 i += len; in pktgen_if_write()
1754 int i, max, len, ret; in pktgen_thread_write() local
1764 len = count_trail_chars(user_buffer, max); in pktgen_thread_write()
1765 if (len < 0) in pktgen_thread_write()
1766 return len; in pktgen_thread_write()
1768 i = len; in pktgen_thread_write()
1772 len = strn_len(&user_buffer[i], sizeof(name) - 1); in pktgen_thread_write()
1773 if (len < 0) in pktgen_thread_write()
1774 return len; in pktgen_thread_write()
1777 if (copy_from_user(name, &user_buffer[i], len)) in pktgen_thread_write()
1779 i += len; in pktgen_thread_write()
1782 len = count_trail_chars(&user_buffer[i], max); in pktgen_thread_write()
1783 if (len < 0) in pktgen_thread_write()
1784 return len; in pktgen_thread_write()
1786 i += len; in pktgen_thread_write()
1802 len = strn_len(&user_buffer[i], sizeof(f) - 1); in pktgen_thread_write()
1803 if (len < 0) { in pktgen_thread_write()
1804 ret = len; in pktgen_thread_write()
1807 if (copy_from_user(f, &user_buffer[i], len)) in pktgen_thread_write()
1809 i += len; in pktgen_thread_write()
2529 x->curlft.bytes += skb->len; in pktgen_output_ipsec()
2586 iph->tot_len = htons(skb->len - ETH_HLEN); in process_ipsec()
2626 int i, len; in pktgen_finalize_skb() local
2632 len = datalen - frags * PAGE_SIZE; in pktgen_finalize_skb()
2633 if (len > 0) { in pktgen_finalize_skb()
2634 skb_put_zero(skb, len); in pktgen_finalize_skb()
2661 skb->len += skb_frag_size(&skb_shinfo(skb)->frags[i]); in pktgen_finalize_skb()
2781 skb_set_network_header(skb, skb->len); in fill_packet_ipv4()
2784 skb_set_transport_header(skb, skb->len); in fill_packet_ipv4()
2800 udph->len = htons(datalen + 8); /* DATA + udphdr */ in fill_packet_ipv4()
2909 skb_set_network_header(skb, skb->len); in fill_packet_ipv6()
2912 skb_set_transport_header(skb, skb->len); in fill_packet_ipv6()
2933 udph->len = htons(udplen); in fill_packet_ipv6()
3334 pkt_dev->last_pkt_size = pkt_dev->skb->len; in pktgen_xmit()
3538 size_t len = strlen(ifname); in pktgen_find_dev() local
3542 if (strncmp(p->odevname, ifname, len) == 0) { in pktgen_find_dev()
3543 if (p->odevname[len]) { in pktgen_find_dev()
3544 if (exact || p->odevname[len] != '@') in pktgen_find_dev()