aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFan Du <fan.du@windriver.com>2014-01-02 22:18:30 -0500
committerSteffen Klassert <steffen.klassert@secunet.com>2014-01-03 01:29:11 -0500
commitde4aee7d69f2957c808572f2d5b5fc808ebe212a (patch)
treed7f5e9395d4b8cff2a202d86e11cbb5bb2247486
parent4ae770bf58ce6315e0f4a1bd4b7e574bdfa59ca9 (diff)
{pktgen, xfrm} Using "pgset spi xxx" to spedifiy SA for a given flow
User could set specific SPI value to arm pktgen flow with IPsec transformation, instead of looking up SA by sadr/daddr. The reaseon to do so is because current state lookup scheme is both slow and, most important of all, in fact pktgen doesn't need to match any SA state addresses information, all it needs is the SA transfromation shell to do the encapuslation. And this option also provide user an alternative to using pktgen test existing SA without creating new ones. Signed-off-by: Fan Du <fan.du@windriver.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-rw-r--r--net/core/pktgen.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 156d57b616ac..8bc4ddd375a9 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -389,6 +389,7 @@ struct pktgen_dev {
389#ifdef CONFIG_XFRM 389#ifdef CONFIG_XFRM
390 __u8 ipsmode; /* IPSEC mode (config) */ 390 __u8 ipsmode; /* IPSEC mode (config) */
391 __u8 ipsproto; /* IPSEC type (config) */ 391 __u8 ipsproto; /* IPSEC type (config) */
392 __u32 spi;
392#endif 393#endif
393 char result[512]; 394 char result[512];
394}; 395};
@@ -1477,6 +1478,17 @@ static ssize_t pktgen_if_write(struct file *file,
1477 return count; 1478 return count;
1478 } 1479 }
1479 1480
1481 if (!strcmp(name, "spi")) {
1482 len = num_arg(&user_buffer[i], 10, &value);
1483 if (len < 0)
1484 return len;
1485
1486 i += len;
1487 pkt_dev->spi = value;
1488 sprintf(pg_result, "OK: spi=%u", pkt_dev->spi);
1489 return count;
1490 }
1491
1480 if (!strcmp(name, "flowlen")) { 1492 if (!strcmp(name, "flowlen")) {
1481 len = num_arg(&user_buffer[i], 10, &value); 1493 len = num_arg(&user_buffer[i], 10, &value);
1482 if (len < 0) 1494 if (len < 0)