The structure of the NetBios is detailed

Source: Internet
Author: User

"A detailed description of the structure of NetBios "

1, the structure of the body.

  

2. command NetBIOS commands are used in two ways, that is, wait and non-wait (or synchronous and asynchronous).

If the high order bit of the command code is 0 o'clock is the wait method, the command will block the application that commits the command to continue execution until the NetBIOS command is completed before allowing the application to continue execution. NetBIOS can only process one wait-mode command at a time.

If the high-order bit of the command code is binary 1 o'clock, the command is queued internally by NetBIOS and does not prevent the application that submits the command from continuing execution. The application can see the status of the command execution by polling the command End Flag field value (see the Command End field for details). After the command is executed, the final return code is stored in the command End flag field of the NCB structure. NetBIOS can suspend several non-wait mode commands at a time.

3. command End flag The NetBIOS driver uses this field to indicate that the asynchronous command is complete. Initially, when an application submits an asynchronous command, NetBIOS resets the field value to FFH. After the command is finished, fill in the field with the final value. That is, after a non-wait command is submitted, the application can monitor (poll) The value of the field to see if the command is complete until its value is no longer FFH.

4. After the return code command is submitted to the NetBIOS driver, the success of the command is reflected in the field. If the Return Code field value is 00h, the command succeeds. For asynchronous NetBIOS command NetBIOS will return the value FFH in the Return Code field immediately, indicating that the command is queued and is about to be executed. When the command finishes executing, the field is placed into the final return code.

5.Lana number there may be more than one Lana (lan-adapter) card or network protocol (or transmission driver) on a single workstation, So the Lana number field in the NCB is used to indicate which network protocol the application wants to use on which network adapter. This field is called the LAN adapter number or the Lana number, and the LANA number is between 0~9.

  

Note: Only programs that are based on the same NetBIOS protocol can communicate with each other. Based on this, the server application should listen for the client connection on each LANA number while the program is being designed, and the application on the client computer will attempt to connect through each LANA number that is installed on the computer.

6.Post routine address when you submit an asynchronous command, the application can set the field. In MS-DOS, the application fills the address of the post-processing routine in the field. The so-called post-processing routine, the routine that the NetBIOS driver will invoke after the command has finished executing.

7, event handle When you submit an asynchronous command, the application can set the field. This field is used to hold the handle of the post-processing routine. Note: When the setting of the command domain uses the Asynch (asynchronous) flag, the setting of the domain is mutually exclusive with the setting of the Post routine address field, where one must have a domain set to 0 and the other a value other than 0.

Reference:

1, http://www.cnblogs.com/tianya2543/p/3888907.html

2, https://msdn.microsoft.com/en-us/library/bb870902 (v=vs.85). aspx

The structure of the NetBios is detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.