Linux-Networking Digest #698, Volume #11 Sun, 27 Jun 99 22:13:32 EDT
Contents:
Re: Linux Drivers for Allied Telesyn AT2500 NICs (L J Bayuk)
Re: Why not C++ (Don Waugaman)
Re: RH 6.0 & 3C905C TXM Problems ("Buggs")
Connecting Linux box to internet thru Sygate (Brian Devlin)
IP Masquerade with 2nd computer (bernieo)
Re: 3270 cluster server (J. Otto Tennant)
Re: Linux Drivers for Allied Telesyn AT2500 NICs ("Jason Chard")
Re: DSL filtering ports ("John Hardin")
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (L J Bayuk)
Subject: Re: Linux Drivers for Allied Telesyn AT2500 NICs
Date: 28 Jun 1999 01:05:15 GMT
[EMAIL PROTECTED] wrote:
>Hi
>
>I need Linux drivers for the Allied Telesyn At 2500 and or AT2700 nics.
>
>Has anyone used an AT 2500 nics with Linux.
I'm not sure this helps, but I've used:
AT 1500 (lance driver)
AT 2450 (pcnet32 driver)
AT 2560 (eepro100 driver) - I didn't test this much, though, so
I don't know if it really works. The card has an Intel 82557 on it, like the
Intel EtherExpress Pro 100, and was detected properly by the eepro100
driver.
------------------------------
From: [EMAIL PROTECTED] (Don Waugaman)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
Date: 27 Jun 1999 17:55:29 -0700
In article <[EMAIL PROTECTED]>,
Johan Kullstam <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] (Don Waugaman) writes:
>
>> In article <[EMAIL PROTECTED]>,
>> Johan Kullstam <[EMAIL PROTECTED]> wrote:
>>
>> Which is as much a problem for the C code as for the C++ code, if not
>> more so since schemes such as reference-counted objects is more
>> difficult to implement in C.
[ snip ]
>and in C, mallocs tend to be rare. most C programs will malloc
>everything they need right off the bat and keep hold of the memory
>until they exit.
I disagree with this generalization. I've seen numerous examples of
C programs which will use malloc() / free() frequently during their
execution.
I would welcome correction if I am wrong. Has anyone seen any studies
to either effect?
> however, C++ encourages more dynamic memory
>exercising because its syntax hides the malloc/free somewhat.
This *may* be true, but - again - this is a case of programmer choice.
Nothing stops programmers from using the style that you describe for
the C language. For many types of programs, less-powerful classes may
be better than general classes which allocate consistently on the heap -
thus a FixedSizeArray<> template may be preferable to using vector<> in
some situations. However, when you need the additional power of the
built-in classes, it's good to have them easily available.
>> >the memory fragmentation problem pretty much precludes seriously using
>> >C++ for kernel work.
>>
>> I don't think that memory fragmentation is worse in C than in C++.
>> It's true that some features of C++ can cause programmers to use
>> dynamic memory more than in C. but that's an attribute of the use of
>> the language, not of the language itself.
>>
>> What it means is that in areas where memory fragmentation is an issue,
>> you'll have to be very careful about how you manage memory. This is
>> an issue in C programs as well, of course. The difference is that you
>> can use C++'s features to more easily move between different methods
>> of memory and fragmentation management.
>
>in eg lisp you let your vendor take care of this for you.
And your vendor may sometimes get it wrong. Will he guess correctly for
every instance of a quick-and-dirty filter, an OS kernel, a daemon and
a number-crunching application?
I might add that the C++ programmer doesn't need to write the appropriate
classes for all of those instances - rather, she/he can get a library from
a vendor to do the right thing for him/her in a given situation.
>> For example: collection templates in the C++ Standard Library take an
>> "allocator" template parameter, which means that you can substitute in
>> your own memory allocator if the built-in one isn't acceptable for your
>> needs. This is part of what makes the C++ SL a rather robust design -
>> and something that can't be done without C++'s substantial template
>> support.
>
>is `alloca' a valid `allocator'?
Allocator objects are classes, not functions. alloca() could be used
by a valid allocator object, but your use of that allocator would be
pretty severely proscribed - for instance, it could only be used by
auto objects, and memory allocated by such an allocator could not be
swapped to be the representation of an object at a different scope.
Again, if you decide you need this functionality, you can write it or
get it from a library. C++ is a lot about having choices in how to
implement things - it's a larger toolbox, with better tools, which can
create an object of surpassing beauty and flexibility or mangle the
object being worked on.
>> Could you describe what you don't like about C++ templates, and how a
>> statically-checked language that intends to minimize runtime cost could
>> do better?
>static type checking has nothing to do with anything. imho it's a
>negative. static types are more a disadvantage the larger and more
>complex a program gets.
One of the design decisions behind C++ (and, to a lesser but growing
extent, behind ANSI C) is the use of static type checking. It may have
nothing to do with languages in general, but it has a great deal to do
with the design of this particular language. IMHO static type checking
is a positive, and it makes larger designs easier to maintain correctly.
We may have to agree to disagree.
>C++ doesn't have insignificant runtime costs.
Please name some of C++'s significant runtime costs (that we haven't
already addressed above - namely, memory management issues).
> when you buy into the
>complexity that C++ offers you, i think a more heavyweight language is
>in order.
That may be true in many contexts, but I would point out that no one is
forcing the programmer to write complex C++. Furthermore, while
implementing some reusable functionality in C++ may be complex, it is
often the case that use and reuse of that functionality is rather simple.
Exhibit A is the string class (actually a typedef of a template) which
has a great deal of (rather complex) extensibility for dealing with
different types of character sets and the like, but is rather trivial
for a programmer to use effectively.
>for example, here's a little macro i made in lisp
[ example of defining a new function _=, which applies its rhs function
to its lhs variable, and assigns the result back to that variable,
snipped - a good example of Lisp's flexibility, by the way ]
>this is not terribly important when x is just a variable, but if the
>left hand side is complex and involves much pointer chasing like
>x->y->z->w[5] then having a way to reference it would be a win.
>
> x->y->z->w[5] _= fabs(_);
>
>could perform
>
> x->y->z->w[5] = fabs(x->y->z->w[5]);
>
>the first is more clear imho just like += and friends.
Clearer still would be to eliminate the pointer chasing altogether,
and have each object in the "chain" of pointers return a reference
to the contained thing that ends up being w[5]. Inline functions can
make that kind access to contained members more efficient.
>with the lisp macros i made
>
> (asetf foo (abs it))
>
>is equivalent to
>
> (setf foo (abs foo)).
>
>whether asetf or _= are worthwhile ideas is not my point. my point is
>that in lisp you *can* make an asetf. in C++, no matter what
>templates you have, you cannot create a new operation like _=.
True - you lose some flexibility - but I'd tend to consider such
things a potentially much larger maintenance nightmare than the C++
overloaded operators, where the adherence to the rule of thumb "do
as the ints do" when deciding on operator behavior works pretty well
as a style guideline. C++ parsers are hard enough to write without
having to make them dynamic by the addition of new operators.
>also note that in the definition of asetf i used a lisp function
>group. how do you invoke C++ functions to help you expand a C++
>template?
Can't be done - templates are only expanded at compile time (there's
that design preference for compile-time decisions again) but there is
support for a lot of what you're looking for...
> what about functions which are 99% the same but differ in
>one spot. how can you make an template-if which could invoke the
>right part based on the type or some aspect of the type being passed?
If I interpret your question correctly, template specializations can do
much of what you want to do here. A template specialization basically
means that you fill-in parts of the template for a given instantiation
on a given type. You can also do partial template specialization, which
allows you to fill in the template parts which need to be specialized
for one of the template types, but let the rest be instantiated by the
regular mechanism.
It's not as general a functionality as what you are describing above,
but it does have zero runtime cost - which I belive is not the case in
Lisp.
>consider a min function in C++ that you wish to templatize
>
>template <class X>
>X min(
> X a,
> Y b)
>{
> return a < b ? a : b;
>}
>
>how do you use this for classes for which < is not defined? how would
>you substitute another definition of < if two less-than concepts would
>make sense for a certain class? perhaps you could pass a function.
>but now < and the alt_less_than function would take different syntaxes
>and hence not work like
>
> min(a,b,<) and min(a,b,alt_less_than)
You would use a functor (an object that encapsulates a function).
This is the exact example of how min is defined in the SGI STL:
template <class T>
inline const T& min(const T& a, const T& b) {
return b < a ? b : a;
}
template <class T, class Compare>
inline const T& min(const T& a, const T& b, Compare comp) {
return comp(b, a) ? b : a;
}
The first example uses the built-in < operator, so you can use that for
classes for which defining '<' makes sense. If you need to compare two
classes but not use the built-in operator, either because you prefer not
to use operator overloading or because you have a different ordering
scheme in a different context, you can use the second function.
You would, of course, have to write your own comparator, but that should
be pretty easy:
class StrangeClass {
public:
struct CompareStrangeKeys {
operator()(StrangeClass const&lhs, StrangeClass const& rhs)
{ return (lhs.strangeKey() < rhs.strangeKey()); };
};
operator<(StrangeClass const& rhs)
{ return this -> normalkey < rhs.normalkey; };
}
Now you could say
StrangeClass a(arguments1);
StrangeClass b(arguments2);
StrangeClass::CompareStrangeKeys key_comp;
a = min(a, b);
a = min(a, b, key_comp);
You can write a CompareStrangeKeys struct for every different sort
criteria over your class you can think of - each one just overloads
its own operator() function and you're off to the races.
Now that I think of it, you could do this a little differently:
template <class T>
class less {
public:
bool operator()(T const& a, T const& b) { return a < b; };
};
template <class T, class Compare = less<T> >
inline const T& min(T const& a, T const& b) {
Compare comp;
return comp(a, b);
}
So you would have
StrangeClass a(arguments1);
StrangeClass b(arguments2);
a = min(a, b);
a = min<StrangeClass, StrangeClass::CompareStrangeKeys>(a, b);
if you prefer a slightly different syntax.
Anyway...
I think this thread has gone on long enough for my taste, and is now
sufficiently off-topic to have likely lost the attention of the great
majority of the group. I'll try to sum up my thoughts and then let you
get the last word in. :-)
1) C++ is not perfect - but then, no language is.
2) A lot of what people think are fatal flaws in C++ have never been or
no long are true - again, this is also true of most languages.
3) C++ could be mighty useful for writing device drivers in the kernel
(aha! back on topic...) and with *proper* use of the language would
enhance the flexibility and maintainability of parts of the kernel.
4) I don't think that it's extraordinarily important to compile the whole
kernel in C++, but (by 3) it would be nice to be able to build a device
driver with it.
5) (4) ain't gonna happen soon.
6) Some of the reasons it won't happen are valid; most (see 2) are not.
--
- Don Waugaman ([EMAIL PROTECTED]) O- _|_ Will pun
Web Page: http://www.cs.arizona.edu/people/dpw/ | for food
In the Sonoran Desert, where we say: "It's a dry heat..." | <><
"Very funny, Scotty. Now beam down my clothes."
------------------------------
From: "Buggs" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware
Subject: Re: RH 6.0 & 3C905C TXM Problems
Date: Mon, 28 Jun 1999 01:10:48 GMT
Hi
I had a similar problem with the 3com 509B card. Solution was to configure
the bios of the card with the dos routine on the support disk to NOT USE
plugg and play support. Then it worked just fine with module installation.
Buggs
Tom Pfeifer <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> [EMAIL PROTECTED] wrote:
> >
> > We just purchased some Dell Dimension machines and they come with the
> > 3Com 3C905C TXM NIC cards. RedHat claims that these cards are not
> > supported and neither are the Netgear FX310 TX nor the 3C905B TX. They
> > claim that the best card to buy is the 3Com 3c595. Unfortunately, I
> > can't find this card at our local computer stores.
> >
>
> I can't speak for the other cards, but the 3C905B TX is most definitely
> supported, at least in the 2.2.XX kernels. I never tried it with 2.0.XX.
> It is of course a PCI card. I compiled the driver directly into the
> kernel as opposed to using the module, although that shouldn't matter -
> I only did that because the card is always in use so no advantage to
> using a module.
>
> Here's the relevant portion of /proc/pci
>
> --------------------------------------------------------------------------
--
> Bus 0, device 11, function 0:
> Ethernet controller: 3Com 3C905B 100bTX (rev 48).
> Medium devsel. IRQ 10. Master Capable. Latency=64. Min Gnt=10.Max
> Lat=10.
> I/O at 0x6c00 [0x6c01].
> Non-prefetchable 32 bit memory at 0xe8000000 [0xe8000000].
> --------------------------------------------------------------------------
--
>
> And the relevant portion of /var/log/kern.log
>
> --------------------------------------------------------------------------
--
> 3c59x.c:v0.99H 11/17/98 Donald Becker http://cesdis.gsfc.nasa.gov/linux
> /drivers/vortex.html
> eth0: 3Com 3c905B Cyclone 100baseTx at 0x6c00, 00:10:5a:a6:2c:da, IRQ
> 10
> 8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate interface
> MII transceiver found at address 24, status 786d.
> MII transceiver found at address 0, status 786d.
> Enabling bus-master transmits and whole-frame receives.
> --------------------------------------------------------------------------
--
>
> Tom
------------------------------
From: Brian Devlin <[EMAIL PROTECTED]>
Subject: Connecting Linux box to internet thru Sygate
Date: Mon, 28 Jun 1999 01:16:08 GMT
I have two computers (one is my family's). We have a cable modem hooked
up to that box. It is running Win98 and uses sygate to share the cable
modem. My computer is dual booting linux and Win98. I can access the
internet using win98, but I am not sure how I should configure linux to
access the internet.
Here is a list of the settings.
Sygate computer:
Internal IP - 192.168.0.1
SUBNET - 255.255.255.0
DNS - 24.0.240.33
24.0.240.34
HOSTNAME CX500477-a.shing1.ri.home.com
Linux machine (Win98 settings):
IP - 192.168.0.1
SUBNET - 255.255.255.0
GATEWAY - 192.168.0.1
Any help would be appreciated. If you can just point me to a faq that
would explain to me how to do it, I would appreciate that. You can
e-mail me at [EMAIL PROTECTED] if you don't want to post.
Thank You
Patrick Devlin
------------------------------
From: bernieo <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: IP Masquerade with 2nd computer
Date: Mon, 28 Jun 1999 00:31:51 GMT
I have a direct connection to the internet via Cable Modem
with a static ip address.
I have successfully installed VMWare and have Win98 running
in a virtual session (address 172.16.90.2) and it is talking
through linux (ip masquerading) to the internet. No problems
at all!
However... I also want to network my laptop into the mix.
What do I need to do???
I already have:
1 network card in the Linux machine.
1 5-port hub
The linux machine and the Cable Modem are currently working through
the hub (not direct connected to each other like when they installed
it).
I know that VMWare communicates with Linux (Host-Only Networking)
though a fake network device called vmnet1.
Is there any way to connect my laptop to this network without having
to install a 2nd network card in my linux machine. I recently saw
something about being able to create another interface (eth1)
and somehow have it redirecting from/to eth0.
I'm assuming that since the VMWare virtual machine is using and
address like 172.16.90.x, that I'll have to use another address range
like 192.168.0.x in order to get this to work.
Please help. I cannot seem to find anything SPECIFIC on how to
do this.
Thanks.
------------------------------
Subject: Re: 3270 cluster server
From: [EMAIL PROTECTED] (J. Otto Tennant)
Date: Mon, 28 Jun 1999 01:09:35 GMT
[EMAIL PROTECTED] (steve payton) writes:
>Hi
>I need to connect terminals running vt emulation via a linux box to an
>ibm mainframe.
>Does anybody know of a product that does the 3270 to vt translation
>bit?
I'm not certain I understand the question. tn3270 will work with
any terminal that has a valid terminfo entry. It connects to
an IP address and port number. We've kind of hacked around with it,
so I don't know how this would actually connect to a system/390.
--
J.Otto Tennant [EMAIL PROTECTED]
Forsan et haec olim meminisse juvabit.
Charter Member of the Vast Right Wing Conspiracy
------------------------------
From: "Jason Chard" <[EMAIL PROTECTED]>
Subject: Re: Linux Drivers for Allied Telesyn AT2500 NICs
Date: Mon, 28 Jun 1999 01:15:45 GMT
The Allied Telesyn uses (from what I found on the allied telesyn site) the
RealTek RTL8129/8139 chipset. The following site has the source for a linux
driver for that chipset.
http://cesdis.gsfc.nasa.gov/linux/
While I have compiled the driver I have not had the opertunity to try it out
yet. Please post back if the driver works.
L J Bayuk wrote in message <7l6hob$so4$[EMAIL PROTECTED]>...
>[EMAIL PROTECTED] wrote:
>>Hi
>>
>>I need Linux drivers for the Allied Telesyn At 2500 and or AT2700 nics.
>>
>>Has anyone used an AT 2500 nics with Linux.
>
>I'm not sure this helps, but I've used:
> AT 1500 (lance driver)
> AT 2450 (pcnet32 driver)
> AT 2560 (eepro100 driver) - I didn't test this much, though, so
>I don't know if it really works. The card has an Intel 82557 on it, like
the
>Intel EtherExpress Pro 100, and was detected properly by the eepro100
>driver.
------------------------------
From: "John Hardin" <[EMAIL PROTECTED]>
Subject: Re: DSL filtering ports
Date: Sun, 27 Jun 1999 14:29:16 -0700
Scott Sweeting wrote in message <[EMAIL PROTECTED]>...
>I plan to set up a network of four workstation computers with a linux
>box as a gateway to a DSL connection. Since I only get one IP #, I want
>to use IP Masquerading so that all four workstations can get online.
>But, according to my DSL provider's web page:
>
>"Pacific Bell Internet Services filters out all non-IP protocols for DSL
>customers, however, this does not guarantee the security of your
>computer or LAN. If file and print sharing is not required on your
>computer or network, we recommend that you turn it off as a minimum
>security solution."
>
>What bothers me is the filtering of non-IP protocols. Does that mean
>that IP Masquerading won't work, or does it mean that things like SMB
>and the like won't be accessable from outside the LAN? Does anyone know
>about PacBell specifically?
Non-IP protocols means, I would assume, IPX and similar things.
This should have no effect on masquerading. You do not, however, want to
provide SMB to the world at large. I suggest you also look into VPN
technologies to allow trusted remote users to access your local network via
the Internet.
See ftp://ftp.rubyriver.com/pub/jhardin/masquerade/ip_masq_vpn.html for
info and links.
--
John Hardin KA7OHZ [EMAIL PROTECTED]
pgpk -a finger://gonzo.wolfenet.com/jhardin PGP key ID: 0x41EA94F5
PGP key fingerprint: A3 0C 5B C2 EF 0D 2C E5 E9 BF C8 33 A7 A9 CE 76
=======================================================================
In the Lion
the Mighty Lion
the Zebra sleeps tonight...
Dee de-ee-ee-ee-ee de de de we um umma way!
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.networking) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Networking Digest
******************************