473,653 Members | 3,000 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

working with bits

I am working on creating a DNS resolver. According to RPC 1035 a
number of fields a certain number of bits long need to be sent with
certain information in it. For example: a 1-bit field followed by a 4-
bit field followed by 3 1-bit fields, followed by a 16-bit field. How
do I create these fields and combine them to send to a dns server?

Apr 11 '07 #1
0 1864

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1595
by: Scott David Daniels | last post by:
I've been working on a module to get at the bits of all numeric types (no, I haven't thought of how to solve the decimal data type that is coming). I've finally got the bits module to pass all of my own tests, so I'm looking for bug reports, design critiques, and general input. I eventually plan to release this under an MIT-style license. If you are interested in seeing read access to the bits of python's numbers, and want to see what...
6
5984
by: Aaron Broad | last post by:
I can't get STL sort to work for this little huffman encoding program i'm writing. I get a whole whack of errors eminating from the line that call sthe sort. They all look like the following error: main.cpp:44: instantiated from here /usr/include/c++/3.2.2/bits/stl_algo.h:2004: no match for ` std::_List_iterator<HuffmanNode, HuffmanNode&, HuffmanNode*>& + int' operator /usr/include/c++/3.2.2/bits/stl_algo.h:2079: instantiated...
2
3231
by: VanBurg | last post by:
Hallo! I have to do the following tasks: 1) I need to read first 4 bytes from file 2) Get all 32 bits for editing 3) Change some bits and save its back to file For now i have to understand how to do only this:
39
3998
by: Frederick Gotham | last post by:
I have a general idea about how negative number systems work, but I'd appreciate some clarification if anyone would be willing to help me. Let's assume we're working with an 8-Bit signed integer, and that it contains no padding. Firstly, I realise that the MSB is known as the sign-bit, and that it indicates whether the number is positive or negative (irrespective of which negative number system is used).
132
4575
by: Frederick Gotham | last post by:
If we look at a programming language such as C++: When an updated Standard comes out, everyone adopts it and abandons the previous one. It seems though that things aren't so clear-cut in the C community. It would seem that C99 is the most up-to-date Standard, but far more people seem to be working off the C89 Standard. Could someone please explain to me why this is so? --
8
5044
by: den 2005 | last post by:
Hi everybody, I am not sure where to put this in this forum. So, I posted this at several topics. I created a class library that has two public methods Encrypt() and Decrypt(). I reference this dll to a window application. I used DESCryptoServiceProvider Algorithm to encrypt and decrypt then with same Key and IV. But unable to decrypt it back to original text. This project I plan to use all algorithm and Hash. This is Phase One. There is...
13
3656
by: arnuld | last post by:
/* C++ Primer 4/e * section 3.2 - String Standard Library * exercise 3.10 * STATEMENT * write a programme to strip the punctation from the string. */ #include <iostream> #include <string>
10
5221
by: Stephen.Schoenberger | last post by:
Hello, Sorry if this is not "exactly" a C topic but I thought this would be the best place to start. I need some guidance on working with bitmap images in ANSI C. I need to "read" in a bitmap image, then break it up into pieces (say 32x32) then take those pieces and "save" them, granted they do not need to be a readable image, then perform some other operations on the pieces, and then combine the manipulated pieces back into one image.
7
5150
by: Ja NE | last post by:
(as first - thank you for all your help several years ago, and second - please apologise me for my clumsy enlgish) so, preface: some users on my photo related site sometimes enter (link) giant photo in their post or coment, and while I was writting new bbcode for my forum, I have got idea to check size of linked pictures to scale them down if needed (matamethic of that part isn't written in folowing code and would not be a problem). ...
2
1954
by: s gall | last post by:
Hi all I have a task to test a checksum algrorithum. This requires changing a string of 12 chr's to a stream of 96 bits and then manipulating these. Currently I work in vb (vb2008). Would it be better for me to use another language (say vc++) and build a DLL to do the bit manipulating or does vb.net have some way of working with bits. Stephen
0
8370
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8590
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4147
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.