From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id C01385F5B for ; Wed, 1 Aug 2018 15:31:15 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id l2-v6so13875452wme.1 for ; Wed, 01 Aug 2018 06:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jXsxAd/9yTwGe4TdkEcRM0jP/mbBWkc9EvDCB25WMH4=; b=RIRQO2fpEgCjiTp24gZ7jP4J1evc4zw9vxWq8/T3f76CsDCCiEpLb46s/5k7NVjff8 rVDO6I8ItMNx0B2dZ0Sv3YaZvpQorOlR4YCVVyJIGsbCi/7H3c8IcrqUFNTYaFdaU5pU V3rbaUAb/Yh8YZGcIXHT0d0XC+sziyG9T4iq/c8jW6ple34hwwc0PEdgqXffJqodiM1v 0FFJVNtBY6XmWH5a5zbyxIpsHe/2uFykBNkkcFEkK+0W1zpVuf5eezWWqA8ukaeTvNJD 4OAr/ALEIEIths6Vmh6myIQIWoGVYRhA5dpgzZ2HJnIaGoC1YhppxewbW3mJrDpuUwuj 9uCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jXsxAd/9yTwGe4TdkEcRM0jP/mbBWkc9EvDCB25WMH4=; b=IECLrZOLi3/lHdDuNnsHJPcOjS2lfoGtvrQm8UdY9QqijanVb1ELEDvTbl73bB38GM T7OPNT8CPdLiewIYk3x9M6km7pEDcb36fKee3+VXb+T6Ly/mh+2VKyUHd6hZBDfOjUup 8RcN3LDf7JY+zSCgF+QLov1jGly5SH+66QWh+P6bxmTw2X+DEszZpQXUx63uKg4KUDkp JaMusLETA1NGFuJsjcf2ggnx+/u6eb8wYoqvT8lK5+F3We7IhajjCPAY6STz42zXlhqR XSlEty4tgTxeXxA7pxWWLh9lTZOeZBlHyHvh6H1+Pk4A7KpaTbQbv0kty7qIeQPQ/Y1E pLQw== X-Gm-Message-State: AOUpUlEvfu8wY4+XAa2p5NuNwaW78wIbFnKso8cK4pOVFOhK/N/dkMFD mHc9XB9iVeooatwiedd9Msh+YeRxWmaEZ3CHH1g= X-Google-Smtp-Source: AAOMgpcZ/13bTq6XBoMrdYDpKp0cObkh23zDvz/okRsQQNKzA+w41DqzRPEmbT4gknJf20byPjnEqUBB1ulkH6FJtmA= X-Received: by 2002:a1c:c3c6:: with SMTP id t189-v6mr2623926wmf.59.1533130275540; Wed, 01 Aug 2018 06:31:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:f7c1:0:0:0:0:0 with HTTP; Wed, 1 Aug 2018 06:31:15 -0700 (PDT) In-Reply-To: References: From: Shyam Shrivastav Date: Wed, 1 Aug 2018 19:01:15 +0530 Message-ID: To: Matt Laswell Cc: Konstantinos Schoinas , users Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] SSL-Packet X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2018 13:31:16 -0000 Assuming mbuf data includes ethernet header struct ipv4_hdr *iphdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, sizeof(struct ether_hdr)); uint32_t ihlen = (iphdr->version_ihl & 0x0f)*4; struct tcp_hdr *th = (struct tcp_hdr *)((char *)iphdr + ihlen); uint32_t thlen = (th->data_off & 0xf0)*4; struct ssl_recrod *ssl = ( struct ssl_recrod *) ((char *)th + thlen); On Wed, Aug 1, 2018 at 6:44 PM, Matt Laswell wrote: > At a minimum, you're going to want to account for options in the TCP and IP > headers. A better way would be to do a little parsing of the IP header to > get the header length field, then using that to find the start of the TCP > header, etc. > > -- > Matt Laswell > infinite io, inc. > > On Wed, Aug 1, 2018 at 5:20 AM, Konstantinos Schoinas > wrote: > > > Hello, > > > > Can somebody tell me how to cast a tcp packet to an ssl packet? > > > > I tried these lines but i dont things they are completely right. > > > > Struct ssl_record { > > uint8_t type; > > uint16_t version; > > uint16_t length; > > } > > > > > > tcp = (struct tcp_hdr *)(ip + 1); > > ssl = (struct ssl_record *)(tcp + 1); > > > > >