Skip to content

Commit

Permalink
fixup! Add ssl parser to samples/bpf
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorNogueiraRio committed Jun 5, 2019
1 parent d1bf209 commit 19733ba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions samples/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ hostprogs-y += task_fd_query
hostprogs-y += xdp_sample_pkts
hostprogs-y += ibumad
hostprogs-y += hbm
hostprogs-y += xdp_parse_ssl
hostprogs-y += xdp_ssl_parser

# Libbpf dependencies
LIBBPF = $(TOOLS_PATH)/lib/bpf/libbpf.a
Expand Down Expand Up @@ -112,7 +112,7 @@ task_fd_query-objs := bpf_load.o task_fd_query_user.o $(TRACE_HELPERS)
xdp_sample_pkts-objs := xdp_sample_pkts_user.o $(TRACE_HELPERS)
ibumad-objs := bpf_load.o ibumad_user.o $(TRACE_HELPERS)
hbm-objs := bpf_load.o hbm.o $(CGROUP_HELPERS)
xdp_parse_ssl-objs := xdp_parse_ssl_user.o
xdp_ssl_parser-objs := xdp_ssl_parser_user.o

# Tell kbuild to always build the programs
always := $(hostprogs-y)
Expand Down Expand Up @@ -172,7 +172,7 @@ always += task_fd_query_kern.o
always += xdp_sample_pkts_kern.o
always += ibumad_kern.o
always += hbm_out_kern.o
always += xdp_parse_ssl_kern.o
always += xdp_ssl_parser_kern.o

KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include
KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/bpf.h>
#include "bpf_helpers.h"
#include "bpf_endian.h"
#include "xdp_parse_ssl_common.h"
#include "xdp_ssl_parser_common.h"

#define RANDLEN 32
#define SNIMAXLEN 253
Expand Down Expand Up @@ -245,7 +245,7 @@ static int parse_ipv4(void *data, uint64_t nh_off, void *data_end)
return tcp(data, nh_off + ihl_len, data_end);
}

SEC("parsessl")
SEC("sslparser")
int handle_ingress(struct xdp_md *ctx)
{
void *data_end = (void *)(long)ctx->data_end;
Expand Down Expand Up @@ -283,7 +283,7 @@ int handle_ingress(struct xdp_md *ctx)
}

if (h_proto == htons(ETH_P_IP))
return parse_ipv4(data, nh_off, data_end);
parse_ipv4(data, nh_off, data_end);

return rc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <unistd.h>
#include <string.h>
#include <bpf/bpf.h>
#include "xdp_parse_ssl_common.h"
#include "xdp_ssl_parser_common.h"

int main(int argc, char **argv) {
int fd = -1;
Expand Down

0 comments on commit 19733ba

Please sign in to comment.