473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Pointers are writing a messaging proxy in C

Yan
I want to begin a project to write a proxy for instant messaging
protocols in C and make it posix compliant. I originally wanted to write
the proxy for one protocol, but not im thinking if i was to write one i
want to make it modular to handle a few. The platform of development
will be FreeBSD, but that's really neither here nor there. My question
is as follows:

- What packages/language features can I use to add this modularity?
- Make each protocol a dynamically linked library? (preferred i guess)
use libtool?
- What is the preferred (proper) way to parse data, exctract protocol
information (maybe assign each session a protocol based on
port/initialization packets) and then pass each packet to a handler?
Basically, how do i properly interface with each protocol handler?
Ive been a UNIX user for a few years, and a C rookie for a few as well,
and want to actually write something to progress my knowledge and gain
experience. Any help would be appreciated. I understand that the fact
that I will be writing this for unix or making it conform to posix is
irrelevant for this group, but i thought it might narrow down to what i
actually want to do.

thanks in advance
Nov 14 '05 #1
2 1326
Yan
Ny mistake, the subject was meant to say "Pointers on writing a
messaging proxy in C"
Nov 14 '05 #2
On Wed, 29 Dec 2004 04:00:38 +0000, Yan wrote:
I want to begin a project to write a proxy for instant messaging
protocols in C and make it posix compliant. I originally wanted to write
the proxy for one protocol, but not im thinking if i was to write one i
want to make it modular to handle a few. The platform of development
will be FreeBSD, but that's really neither here nor there. My question
is as follows:

- What packages/language features can I use to add this modularity?
At the C language level you have things like functions, internal/external
linkage, separately compiled source files and headers.
- Make each protocol a dynamically linked library? (preferred i guess)
use libtool?
Possibly but that is an implementation detail, not something that the C
language itself covers. Since you mention POSIX and FreeBSD
comp.unix.programmer or a FreeBSD related newsgroup would be a good place
to discuss this.
- What is the preferred (proper) way to parse data, exctract protocol
information (maybe assign each session a protocol based on
port/initialization packets) and then pass each packet to a handler?
Sounds reasonable.
Basically, how do i properly interface with each protocol handler?
All you get in standard C is effectively a statically linked program. If
you want any more than that you have to use platform-specific extensions.
Ive been a UNIX user for a few years, and a C rookie for a few as well,
and want to actually write something to progress my knowledge and gain
experience. Any help would be appreciated. I understand that the fact
that I will be writing this for unix or making it conform to posix is
irrelevant for this group, but i thought it might narrow down to what i
actually want to do.


A good design approach is to hide the implementation details behind a
standardised interface. For example

struct {
int (*protofunc1)(int arg);
...
} Msgproto;
Msgproto *msgproto_open(const char *protoname);
void msgproto_close(Msgproto *proto);

I.e. msgproto_open() deals with the details of "opening" a protocol
whether that is implemented as a set of statically linked functions, open
a dynamic library or whatever. It returns a pointer to a Msgproto
structure which contains pointers to functions that implement the
protocol, and anything else relevant to a general protocol.
msgproto_close() cleans up when you have finished using the protocol. For
some implementations it may not need to do anything but it should still
be there for cases wher cleanup is necessary.

Lawrence

Nov 14 '05 #3

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

Similar topics

2
by: Dennis Owens | last post by:
I want to develop a Client/Server messaging system that does not require Microsoft messaging. I want to use the .Net remoting, but I am having some real problems with the remoting. The remoting...
0
by: Dennis Owens | last post by:
Read below for previous conversation. We are developing an application that will some day run on anything from a computer down to a PDA (this is were the Lightweight comes in). The messaging...
1
by: ptdaw | last post by:
After spending a little time reading the documentation, I attempted to add some messaging code to my VB.Net project, only to discover that I couldn't get past my Imports System.Messaging ...
4
by: Mark Stijnman | last post by:
A while ago I posted a question about how to get operator behave differently for reading and writing. I basically wanted to make a vector that can be queried about whether it is modified recently...
388
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
1
by: John A Grandy | last post by:
in .NET 2.0 where is the type Message located ? in .NET 1.1 it was System.Messaging.Message
21
by: Jim | last post by:
I am trying to write an HTTP/HTTPS proxy server in VB.Net 2005. But, I don't really even know how the internal workings of a proxy should act. Does anyone have anything on the protocols used in...
1
by: NvrBst | last post by:
I'd like to simulate keypresses at the lowest level I can (writing to the keyboard buffer if possible). I can find x86 solutions but nothing for a higher level language. Does anyone know how I...
2
by: jparulan | last post by:
Hi All, I am developing web service that does not use IIS, I was successful on deploying a normal web service with System.Data and System.Web namespaces. BUT when I added the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.