Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3351346
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:53:51+00:00 2026-05-18T01:53:51+00:00

can somebody tell me does my conversation from c to delphi is well: c

  • 0

can somebody tell me does my conversation from c to delphi is well:

c code

struct nfq_data {
    /* packet_hdr - it HAVE to be the same as struct nfqnl_msg_packet_hdr */
    struct {
        uint32_t packet_id; /* unique ID of packet in queue in network order */
        uint16_t hw_protocol; /* hw protocol in network order */
        uint8_t hook; /* netfilter hook */
    } packet_hdr;
    /* packet_hw - it HAVE to be the same as struct nfqnl_msg_packet_hw */
    struct {
        uint16_t hw_addrlen; /* len of hw_addr in network order */
        uint16_t _pad;
        uint8_t hw_addr[8];
    } packet_hw;
    /* tm */
    struct {
        long sec;
        long usec;
    } tm;

    uint32_t if_index; /* Unique iface id */
    uint32_t verdict; /* Netfilter verdict value */
    uint32_t mark; /* Mark value */
    uint8_t if_name[IFNAMSIZE]; /* Name of incoming or outgoing iface */
    uint32_t data_len; /* Length of packet */
    uint8_t payload[0]; /* packet data */
};

where

typedef unsigned char uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;

delphi

_packet_hdr = record
    packet_id: Cardinal;
    hw_protocol: Word;
    hook: Byte;
  end;

  _packet_hw = record
    hw_addrlen: Word;
    _pad: Word;
    hw_addr: array[0..7] of byte;
  end;

  _tm = record
    sec: Int64;
    usec: Int64;
  end;

  pnfq_data = ^nfq_data;
  nfq_data = record
    packet_hdr: _packet_hdr;
    packet_hw: _packet_hw;
    tm: _tm;
    if_index: Cardinal;
    verdict: Cardinal;
    mark: Cardinal;
    if_name: array[0..254] of Byte;
    data_len: Cardinal;
    payload: PChar; //TBytes;
  end;

    packet_hdr: _packet_hdr;
    packet_hw: _packet_hw;

I am receiving well, but after those nothing well.

Thanks in advance

Bojan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:53:52+00:00Added an answer on May 18, 2026 at 1:53 am
    uint8_t payload[0];
    

    Is that really a pointer(as in your delphi-code) or an inplace array of size 0 used to represent data coming after the header

    And you should mark your records as packed. I don’t think it makes a difference in your specific code, but it is good practice since the packing rules are easy to get wrong, might change and not everybody knows them.
    It probably makes a difference because packet_hdr is 7 bytes larges when packed, so the following packet_hw starts at offset 7 when packed, and probably at 8 when aligned.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can somebody tell me what does this mean? I'm going trough Java book and
can somebody tell me why my code is not working? class Connection { public
can somebody tell me what is jQuery plugin? I have used the jQuery library
Can somebody tell me what does User Space NIC exactly means and when it
Can somebody tell me why I ALWAYS get "1" from : public boolean onTouchEvent(MotionEvent
Can somebody tell me what is the meaning of Installs: 100-500. What Google Play
Can somebody tell me how I can find out how many threads are in
Can somebody tell me why compiler thinks that break is necessary after yield return
Can somebody tell me what lazy-loading policy NHibernate uses? Various sources provides contradictory information
TO_CHAR(( TO_DATE(calendar_key,'YYYYMMDD' )+ 1),'IW') week Can somebody tell me what's happening in this query?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.